Package com.sendmail.jilter
Class JilterHandlerAdapter
- java.lang.Object
-
- com.sendmail.jilter.JilterHandlerAdapter
-
- All Implemented Interfaces:
JilterHandler
public abstract class JilterHandlerAdapter extends java.lang.Object implements JilterHandler
An adapter to implement methods in JilterHander interface so subclasses may override only those methods they desire.- Author:
- Neil Aggarwal (neil@JAMMConsulting.com)
-
-
Field Summary
-
Fields inherited from interface com.sendmail.jilter.JilterHandler
PROCESS_BODY, PROCESS_CONNECT, PROCESS_ENVFROM, PROCESS_ENVRCPT, PROCESS_HEADER, PROCESS_HELO, SMFIF_ADDHDRS, SMFIF_ADDRCPT, SMFIF_CHGBODY, SMFIF_CHGHDRS, SMFIF_DELRCPT, SMFIF_MODBODY, SMFIF_NONE
-
-
Constructor Summary
Constructors Constructor Description JilterHandlerAdapter()
-
Method Summary
All Methods Instance Methods Concrete 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.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.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.sendmail.jilter.JilterHandler
getSupportedProcesses
-
-
-
-
Method Detail
-
connect
public JilterStatus connect(java.lang.String hostname, java.net.InetAddress hostaddr, java.util.Properties properties)
Description copied from interface:JilterHandlerCalled once at the start of each SMTP connection.- Specified by:
connectin interfaceJilterHandler- 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
public JilterStatus helo(java.lang.String helohost, java.util.Properties properties)
Description copied from interface:JilterHandlerHandle the HELO/EHLO command. Called whenever the client sends a HELO/EHLO command. It may therefore be called between zero and three times.- Specified by:
heloin interfaceJilterHandler- 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
public JilterStatus envfrom(java.lang.String[] argv, java.util.Properties properties)
Description copied from interface:JilterHandlerHandle the envelope FROM command. Called once at the beginning of each message, beforeenvrcpt.- Specified by:
envfromin interfaceJilterHandler- 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
public JilterStatus envrcpt(java.lang.String[] argv, java.util.Properties properties)
Description copied from interface:JilterHandlerHandle the envelope RCPT command. Called once per recipient, hence one or more times per message, immediately afterenvfrom.- Specified by:
envrcptin interfaceJilterHandler- 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
public JilterStatus header(java.lang.String headerf, java.lang.String headerv)
Description copied from interface:JilterHandlerHandle a message header. Called zero or more times betweenenvrcptandeoh, once per message header.- Specified by:
headerin interfaceJilterHandler- 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
public JilterStatus eoh()
Description copied from interface:JilterHandlerHandle the end of message headers. Called once after all headers have been sent and processed.- Specified by:
eohin interfaceJilterHandler- Returns:
SMFIS_return codes fromJilterStatus.
-
body
public JilterStatus body(java.nio.ByteBuffer bodyp)
Description copied from interface:JilterHandler- Specified by:
bodyin interfaceJilterHandler- Parameters:
bodyp- This block of body data.- Returns:
SMFIS_return codes fromJilterStatus.
-
eom
public JilterStatus eom(JilterEOMActions eomActions, java.util.Properties properties)
Description copied from interface:JilterHandlerEnd of a message. Called once after all calls tobodyfor a given message.- Specified by:
eomin interfaceJilterHandler- Parameters:
eomActions- Interface for effecting message changes.properties- Any properties (macros) received from the MTA.- Returns:
SMFIS_return codes fromJilterStatus.
-
abort
public JilterStatus abort()
Description copied from interface:JilterHandlerHandle the current message being aborted. Called at any time during message processing (i.e. between some message-oriented routine andeom).- Specified by:
abortin interfaceJilterHandler- Returns:
SMFIS_return codes fromJilterStatus.
-
close
public JilterStatus close()
Description copied from interface:JilterHandlerThe current connection is being closed. Always called at the end of each connection.- Specified by:
closein interfaceJilterHandler- Returns:
SMFIS_return codes fromJilterStatus.
-
getRequiredModifications
public int getRequiredModifications()
Description copied from interface:JilterHandlerGet the list of required modifications needed by this handler.- Specified by:
getRequiredModificationsin interfaceJilterHandler- Returns:
- a combination of values from the
SMFIF_constants.
-
-