com.sendmail.jilter

Interface JilterHandler

public interface JilterHandler

The main handler interface for writing a Java-based milter (Jilter).
Field Summary
static intPROCESS_BODY
Flag for getSupportedProcesses to indicate that body is supported.
static intPROCESS_CONNECT
Flag for getSupportedProcesses to indicate that connect is supported.
static intPROCESS_ENVFROM
Flag for getSupportedProcesses to indicate that envfrom is supported.
static intPROCESS_ENVRCPT
Flag for getSupportedProcesses to indicate that JilterHandler is supported.
static intPROCESS_HEADER
Flag for getSupportedProcesses to indicate that header is supported.
static intPROCESS_HELO
Flag for getSupportedProcesses to indicate that helo is supported.
static intSMFIF_ADDHDRS
Flag for getRequiredModifications to indicate that headers may be added.
static intSMFIF_ADDRCPT
Flag for getRequiredModifications to indicate that recipients may be added.
static intSMFIF_CHGBODY
Flag for getRequiredModifications to indicate that the body may be changed.
static intSMFIF_CHGHDRS
Flag for getRequiredModifications to indicate that headers may be changed or deleted.
static intSMFIF_DELRCPT
Flag for getRequiredModifications to indicate that recipients may be deleted.
static intSMFIF_MODBODY
Flag for getRequiredModifications to indicate that headers may be added.
static intSMFIF_NONE
Flag for getRequiredModifications to indicate that no modifications will be made.
Method Summary
JilterStatusabort()
Handle the current message being aborted.
JilterStatusbody(ByteBuffer bodyp)
Handle a piece of a message's body.
JilterStatusclose()
The current connection is being closed.
JilterStatusconnect(String hostname, InetAddress hostaddr, Properties properties)
Called once at the start of each SMTP connection.
JilterStatusenvfrom(String[] argv, Properties properties)
Handle the envelope FROM command.
JilterStatusenvrcpt(String[] argv, Properties properties)
Handle the envelope RCPT command.
JilterStatuseoh()
Handle the end of message headers.
JilterStatuseom(JilterEOMActions eomActions, 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(String headerf, String headerv)
Handle a message header.
JilterStatushelo(String helohost, Properties properties)
Handle the HELO/EHLO command.

Field Detail

PROCESS_BODY

public static final int PROCESS_BODY
Flag for getSupportedProcesses to indicate that body is supported.

PROCESS_CONNECT

public static final int PROCESS_CONNECT
Flag for getSupportedProcesses to indicate that connect is supported.

PROCESS_ENVFROM

public static final int PROCESS_ENVFROM
Flag for getSupportedProcesses to indicate that envfrom is supported.

PROCESS_ENVRCPT

public static final int PROCESS_ENVRCPT
Flag for getSupportedProcesses to indicate that JilterHandler is supported.

PROCESS_HEADER

public static final int PROCESS_HEADER
Flag for getSupportedProcesses to indicate that header is supported.

PROCESS_HELO

public static final int PROCESS_HELO
Flag for getSupportedProcesses to indicate that helo is supported.

SMFIF_ADDHDRS

public static final int SMFIF_ADDHDRS
Flag for getRequiredModifications to indicate that headers may be added.

SMFIF_ADDRCPT

public static final int SMFIF_ADDRCPT
Flag for getRequiredModifications to indicate that recipients may be added.

SMFIF_CHGBODY

public static final int SMFIF_CHGBODY
Flag for getRequiredModifications to indicate that the body may be changed.

SMFIF_CHGHDRS

public static final int SMFIF_CHGHDRS
Flag for getRequiredModifications to indicate that headers may be changed or deleted.

SMFIF_DELRCPT

public static final int SMFIF_DELRCPT
Flag for getRequiredModifications to indicate that recipients may be deleted.

SMFIF_MODBODY

public static final int SMFIF_MODBODY
Flag for getRequiredModifications to indicate that headers may be added.

SMFIF_NONE

public static final int SMFIF_NONE
Flag for getRequiredModifications to indicate that no modifications will be made.

Method Detail

abort

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

Returns: SMFIS_ return codes from JilterStatus.

body

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

Parameters: bodyp This block of body data.

Returns: SMFIS_ return codes from JilterStatus.

close

public JilterStatus close()
The current connection is being closed. Always called at the end of each connection.

Returns: SMFIS_ return codes from JilterStatus.

connect

public JilterStatus connect(String hostname, InetAddress hostaddr, 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 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.

envfrom

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

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)
Handle the envelope RCPT command. Called once per recipient, hence one or more times per message, immediately after envfrom.

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.

eoh

public JilterStatus eoh()
Handle the end of message headers. Called once after all headers have been sent and processed.

Returns: SMFIS_ return codes from JilterStatus.

eom

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

Parameters: eomActions Interface for effecting message changes. properties Any properties (macros) received from the MTA.

Returns: SMFIS_ return codes from JilterStatus.

getRequiredModifications

public int getRequiredModifications()
Get the list of required modifications needed by this handler.

Returns: a combination of values from the SMFIF_ constants.

getSupportedProcesses

public int getSupportedProcesses()
Get the list of callbacks implemented by this handler.

Returns: a combination of values from the PROCESS_ constants.

header

public JilterStatus header(String headerf, String headerv)
Handle a message header. Called zero or more times between envrcpt and eoh, 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 from JilterStatus.

helo

public JilterStatus helo(String helohost, 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 from JilterStatus.

Copyright B) 2001-2004, Sendmail, Inc. All Rights Reserved.