1 /**************************************************************** 2 * Licensed to the Apache Software Foundation (ASF) under one * 3 * or more contributor license agreements. See the NOTICE file * 4 * distributed with this work for additional information * 5 * regarding copyright ownership. The ASF licenses this file * 6 * to you under the Apache License, Version 2.0 (the * 7 * "License"); you may not use this file except in compliance * 8 * with the License. You may obtain a copy of the License at * 9 * * 10 * http://www.apache.org/licenses/LICENSE-2.0 * 11 * * 12 * Unless required by applicable law or agreed to in writing, * 13 * software distributed under the License is distributed on an * 14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * 15 * KIND, either express or implied. See the License for the * 16 * specific language governing permissions and limitations * 17 * under the License. * 18 ****************************************************************/ 19 20 21 22 package org.apache.james.smtpserver.core.filter.fastfail; 23 24 import org.apache.james.dsn.DSNStatus; 25 26 public class JunkHandlerData { 27 28 private String rejectLogString = "Bad email. Reject email"; 29 private String rejectResponseString = "554 " + DSNStatus.getStatus(DSNStatus.PERMANENT,DSNStatus.SECURITY_OTHER) + " " + rejectLogString; 30 private String junkScoreLogString = "Bad email. Add JunkScore"; 31 private String scoreName = "JunkHandler"; 32 33 /** 34 * The ResponseString which get returned in SMTP transaction if the email get rejected 35 * 36 * @param rejectResponseString the responseString 37 */ 38 public void setRejectResponseString(String rejectResponseString) { 39 this.rejectResponseString = rejectResponseString; 40 } 41 42 /** 43 * Set the logString which will be used on junkScore action 44 * 45 * @param junkScoreLogString the logString 46 */ 47 public void setJunkScoreLogString(String junkScoreLogString) { 48 this.junkScoreLogString = junkScoreLogString; 49 } 50 51 /** 52 * Set the logString which will be used on reject action 53 * 54 * @param rejectLogString the logString 55 */ 56 public void setRejectLogString(String rejectLogString) { 57 this.rejectLogString = rejectLogString; 58 } 59 60 /** 61 * The the keyname which will be used to store the junkScore 62 * 63 * @param scoreName the name 64 */ 65 public void setScoreName(String scoreName) { 66 this.scoreName = scoreName; 67 } 68 69 /** 70 * Get the reponseString to return 71 * 72 * @return rejectResponseString 73 */ 74 public String getRejectResponseString() { 75 return rejectResponseString; 76 } 77 78 /** 79 * Return the LogString if a JunkScore action is used 80 * 81 * @return the LogString 82 */ 83 public String getJunkScoreLogString() { 84 return junkScoreLogString; 85 } 86 87 /** 88 * Return the LogString if a Reject action is used 89 * 90 * @return the LogString 91 */ 92 public String getRejectLogString() { 93 return rejectLogString; 94 } 95 96 /** 97 * Return the Name which will used to store the JunkScore and get used in the headers 98 * 99 * @return the name 100 */ 101 protected String getScoreName() { 102 return scoreName; 103 } 104 105 }