com.sendmail.jilter
Class JilterHandlerAdapter

java.lang.Object
  extended by com.sendmail.jilter.JilterHandlerAdapter
All Implemented Interfaces:
JilterHandler

public abstract class JilterHandlerAdapter
extends 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
JilterHandlerAdapter()
           
 
Method Summary
 JilterStatus abort()
          Handle the current message being aborted.
 JilterStatus body(ByteBuffer bodyp)
          Handle a piece of a message's body.
 JilterStatus close()
          The current connection is being closed.
 JilterStatus connect(String hostname, InetAddress hostaddr, Properties properties)
          Called once at the start of each SMTP connection.
 JilterStatus envfrom(String[] argv, Properties properties)
          Handle the envelope FROM command.
 JilterStatus envrcpt(String[] argv, Properties properties)
          Handle the envelope RCPT command.
 JilterStatus eoh()
          Handle the end of message headers.
 JilterStatus eom(JilterEOMActions eomActions, Properties properties)
          End of a message.
 int getRequiredModifications()
          Get the list of required modifications needed by this handler.
 JilterStatus header(String headerf, String headerv)
          Handle a message header.
 JilterStatus helo(String helohost, 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
 

Constructor Detail

JilterHandlerAdapter

public JilterHandlerAdapter()
Method Detail

connect

public JilterStatus connect(String hostname,
                            InetAddress hostaddr,
                            Properties properties)
Description copied from interface: JilterHandler
Called once at the start of each SMTP connection.

Specified by:
connect in interface JilterHandler
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 a getpeername() call on the SMTP socket.
properties - Any properties (macros) received from the MTA.
Returns:
SMFIS_ return codes from JilterStatus. NOTE: The MTA will currently ignore any custom values (values other than SMFIS_ values). Specifically, values created with JilterStatus.makeCustomStatus will not be honored.

helo

public JilterStatus helo(String helohost,
                         Properties properties)
Description copied from interface: JilterHandler
Handle 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:
helo in interface JilterHandler
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 from JilterStatus.

envfrom

public JilterStatus envfrom(String[] argv,
                            Properties properties)
Description copied from interface: JilterHandler
Handle the envelope FROM command. Called once at the beginning of each message, before envrcpt.

Specified by:
envfrom in interface JilterHandler
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 from JilterStatus.

envrcpt

public JilterStatus envrcpt(String[] argv,
                            Properties properties)
Description copied from interface: JilterHandler
Handle the envelope RCPT command. Called once per recipient, hence one or more times per message, immediately after envfrom.

Specified by:
envrcpt in interface JilterHandler
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 from JilterStatus.

header

public JilterStatus header(String headerf,
                           String headerv)
Description copied from interface: JilterHandler
Handle a message header. Called zero or more times between envrcpt and eoh, once per message header.

Specified by:
header in interface JilterHandler
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 from JilterStatus.

eoh

public JilterStatus eoh()
Description copied from interface: JilterHandler
Handle the end of message headers. Called once after all headers have been sent and processed.

Specified by:
eoh in interface JilterHandler
Returns:
SMFIS_ return codes from JilterStatus.

body

public JilterStatus body(ByteBuffer bodyp)
Description copied from interface: JilterHandler
Handle a piece of a message's body. Called zero or more times between eoh and eom.

Specified by:
body in interface JilterHandler
Parameters:
bodyp - This block of body data.
Returns:
SMFIS_ return codes from JilterStatus.

eom

public JilterStatus eom(JilterEOMActions eomActions,
                        Properties properties)
Description copied from interface: JilterHandler
End of a message. Called once after all calls to body for a given message.

Specified by:
eom in interface JilterHandler
Parameters:
eomActions - Interface for effecting message changes.
properties - Any properties (macros) received from the MTA.
Returns:
SMFIS_ return codes from JilterStatus.

abort

public JilterStatus abort()
Description copied from interface: JilterHandler
Handle the current message being aborted. Called at any time during message processing (i.e. between some message-oriented routine and eom).

Specified by:
abort in interface JilterHandler
Returns:
SMFIS_ return codes from JilterStatus.

close

public JilterStatus close()
Description copied from interface: JilterHandler
The current connection is being closed. Always called at the end of each connection.

Specified by:
close in interface JilterHandler
Returns:
SMFIS_ return codes from JilterStatus.

getRequiredModifications

public int getRequiredModifications()
Description copied from interface: JilterHandler
Get the list of required modifications needed by this handler.

Specified by:
getRequiredModifications in interface JilterHandler
Returns:
a combination of values from the SMFIF_ constants.


Copyright © 2004-2006 Sendmail, Inc.. All Rights Reserved.