Package com.sendmail.jilter
Interface JilterHandler
-
- All Known Implementing Classes:
JilterHandlerAdapter
public interface JilterHandlerThe main handler interface for writing a Java-based milter (Jilter).
-
-
Field Summary
Fields Modifier and Type Field Description static intPROCESS_BODYFlag forgetSupportedProcessesto indicate thatbodyis supported.static intPROCESS_CONNECTFlag forgetSupportedProcessesto indicate thatconnectis supported.static intPROCESS_ENVFROMFlag forgetSupportedProcessesto indicate thatenvfromis supported.static intPROCESS_ENVRCPTFlag forgetSupportedProcessesto indicate thatenvrcpt(java.lang.String[], java.util.Properties)is supported.static intPROCESS_HEADERFlag forgetSupportedProcessesto indicate thatheaderis supported.static intPROCESS_HELOFlag forgetSupportedProcessesto indicate thathelois supported.static intSMFIF_ADDHDRSFlag forgetRequiredModificationsto indicate that headers may be added.static intSMFIF_ADDRCPTFlag forgetRequiredModificationsto indicate that recipients may be added.static intSMFIF_CHGBODYFlag forgetRequiredModificationsto indicate that the body may be changed.static intSMFIF_CHGHDRSFlag forgetRequiredModificationsto indicate that headers may be changed or deleted.static intSMFIF_DELRCPTFlag forgetRequiredModificationsto indicate that recipients may be deleted.static intSMFIF_MODBODYFlag forgetRequiredModificationsto indicate that headers may be added.static intSMFIF_NONEFlag forgetRequiredModificationsto indicate that no modifications will be made.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description JilterStatusabort()Handle the current message being aborted.JilterStatusbody(java.nio.ByteBuffer bodyp)Handle a piece of a message's body.JilterStatusclose()The current connection is being closed.JilterStatusconnect(java.lang.String hostname, java.net.InetAddress hostaddr, java.util.Properties properties)Called once at the start of each SMTP connection.JilterStatusenvfrom(java.lang.String[] argv, java.util.Properties properties)Handle the envelope FROM command.JilterStatusenvrcpt(java.lang.String[] argv, java.util.Properties properties)Handle the envelope RCPT command.JilterStatuseoh()Handle the end of message headers.JilterStatuseom(JilterEOMActions eomActions, java.util.Properties properties)End of a message.intgetRequiredModifications()Get the list of required modifications needed by this handler.intgetSupportedProcesses()Get the list of callbacks implemented by this handler.JilterStatusheader(java.lang.String headerf, java.lang.String headerv)Handle a message header.JilterStatushelo(java.lang.String helohost, java.util.Properties properties)Handle the HELO/EHLO command.
-
-
-
Field Detail
-
PROCESS_CONNECT
static final int PROCESS_CONNECT
Flag forgetSupportedProcessesto indicate thatconnectis supported.- See Also:
- Constant Field Values
-
PROCESS_HELO
static final int PROCESS_HELO
Flag forgetSupportedProcessesto indicate thathelois supported.- See Also:
- Constant Field Values
-
PROCESS_ENVFROM
static final int PROCESS_ENVFROM
Flag forgetSupportedProcessesto indicate thatenvfromis supported.- See Also:
- Constant Field Values
-
PROCESS_ENVRCPT
static final int PROCESS_ENVRCPT
Flag forgetSupportedProcessesto indicate thatenvrcpt(java.lang.String[], java.util.Properties)is supported.- See Also:
- Constant Field Values
-
PROCESS_HEADER
static final int PROCESS_HEADER
Flag forgetSupportedProcessesto indicate thatheaderis supported.- See Also:
- Constant Field Values
-
PROCESS_BODY
static final int PROCESS_BODY
Flag forgetSupportedProcessesto indicate thatbodyis supported.- See Also:
- Constant Field Values
-
SMFIF_NONE
static final int SMFIF_NONE
Flag forgetRequiredModificationsto indicate that no modifications will be made.- See Also:
- Constant Field Values
-
SMFIF_ADDHDRS
static final int SMFIF_ADDHDRS
Flag forgetRequiredModificationsto indicate that headers may be added.- See Also:
- Constant Field Values
-
SMFIF_CHGBODY
static final int SMFIF_CHGBODY
Flag forgetRequiredModificationsto indicate that the body may be changed.- See Also:
- Constant Field Values
-
SMFIF_MODBODY
static final int SMFIF_MODBODY
Flag forgetRequiredModificationsto indicate that headers may be added.- See Also:
- Constant Field Values
-
SMFIF_ADDRCPT
static final int SMFIF_ADDRCPT
Flag forgetRequiredModificationsto indicate that recipients may be added.- See Also:
- Constant Field Values
-
SMFIF_DELRCPT
static final int SMFIF_DELRCPT
Flag forgetRequiredModificationsto indicate that recipients may be deleted.- See Also:
- Constant Field Values
-
SMFIF_CHGHDRS
static final int SMFIF_CHGHDRS
Flag forgetRequiredModificationsto indicate that headers may be changed or deleted.- See Also:
- Constant Field Values
-
-
Method Detail
-
connect
JilterStatus connect(java.lang.String hostname, java.net.InetAddress hostaddr, java.util.Properties properties)
Called once at the start of each SMTP connection.- Parameters:
hostname- The host name of the message sender, as determined by a reverse lookup on the host address.hostaddr- The host address, as determined by agetpeername()call on the SMTP socket.properties- Any properties (macros) received from the MTA.- Returns:
SMFIS_return codes fromJilterStatus. NOTE: The MTA will currently ignore any custom values (values other thanSMFIS_values). Specifically, values created withJilterStatus.makeCustomStatuswill not be honored.
-
helo
JilterStatus helo(java.lang.String helohost, java.util.Properties properties)
Handle the HELO/EHLO command. Called whenever the client sends a HELO/EHLO command. It may therefore be called between zero and three times.- Parameters:
helohost- Value passed to HELO/EHLO command, which should be the domain name of the sending host (but is, in practice, anything the sending host wants to send).properties- Any properties (macros) received from the MTA.- Returns:
SMFIS_return codes fromJilterStatus.
-
envfrom
JilterStatus envfrom(java.lang.String[] argv, java.util.Properties properties)
Handle the envelope FROM command. Called once at the beginning of each message, beforeenvrcpt.- Parameters:
argv- An array of SMTP command arguments.argv[0]is guaranteed to be the sender address. Later arguments are the ESMTP arguments.properties- Any properties (macros) received from the MTA.- Returns:
SMFIS_return codes fromJilterStatus.
-
envrcpt
JilterStatus envrcpt(java.lang.String[] argv, java.util.Properties properties)
Handle the envelope RCPT command. Called once per recipient, hence one or more times per message, immediately afterenvfrom.- Parameters:
argv- An array of SMTP command arguments.argv[0]is guaranteed to be the recipient address. Later arguments are the ESMTP arguments.properties- Any properties (macros) received from the MTA.- Returns:
SMFIS_return codes fromJilterStatus.
-
header
JilterStatus header(java.lang.String headerf, java.lang.String headerv)
Handle a message header. Called zero or more times betweenenvrcptandeoh, once per message header.- Parameters:
headerf- Header field name.headerv- Header field value. The content of the header may include folded white space (i.e. multiple lines with following white space). The trailing line terminator (CR/LF) is removed.- Returns:
SMFIS_return codes fromJilterStatus.
-
eoh
JilterStatus eoh()
Handle the end of message headers. Called once after all headers have been sent and processed.- Returns:
SMFIS_return codes fromJilterStatus.
-
body
JilterStatus body(java.nio.ByteBuffer bodyp)
- Parameters:
bodyp- This block of body data.- Returns:
SMFIS_return codes fromJilterStatus.
-
eom
JilterStatus eom(JilterEOMActions eomActions, java.util.Properties properties)
End of a message. Called once after all calls tobodyfor a given message.- Parameters:
eomActions- Interface for effecting message changes.properties- Any properties (macros) received from the MTA.- Returns:
SMFIS_return codes fromJilterStatus.
-
abort
JilterStatus abort()
Handle the current message being aborted. Called at any time during message processing (i.e. between some message-oriented routine andeom).- Returns:
SMFIS_return codes fromJilterStatus.
-
close
JilterStatus close()
The current connection is being closed. Always called at the end of each connection.- Returns:
SMFIS_return codes fromJilterStatus.
-
getSupportedProcesses
int getSupportedProcesses()
Get the list of callbacks implemented by this handler.- Returns:
- a combination of values from the
PROCESS_constants.
-
getRequiredModifications
int getRequiredModifications()
Get the list of required modifications needed by this handler.- Returns:
- a combination of values from the
SMFIF_constants.
-
-