public class MilterHandler extends java.lang.Object implements 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 and Description |
---|
MilterHandler(java.util.Collection<IMilterListenerFactory> mlfc) |
Modifier and Type | Method and Description |
---|---|
JilterStatus |
abort()
Handle the current message being aborted.
|
JilterStatus |
body(java.nio.ByteBuffer bodyp)
Handle a piece of a message's body.
|
JilterStatus |
close()
The current connection is being closed.
|
JilterStatus |
connect(java.lang.String hostname,
java.net.InetAddress hostaddr,
java.util.Properties properties)
Called once at the start of each SMTP connection.
|
JilterStatus |
envfrom(java.lang.String[] argv,
java.util.Properties properties)
Handle the envelope FROM command.
|
JilterStatus |
envrcpt(java.lang.String[] argv,
java.util.Properties properties)
Handle the envelope RCPT command.
|
JilterStatus |
eoh()
Handle the end of message headers.
|
JilterStatus |
eom(JilterEOMActions eomActions,
java.util.Properties properties)
End of a message.
|
int |
getRequiredModifications()
Get the list of required modifications needed by this handler.
|
int |
getSupportedProcesses()
Get the list of callbacks implemented by this handler.
|
JilterStatus |
header(java.lang.String headerf,
java.lang.String headerv)
Handle a message header.
|
JilterStatus |
helo(java.lang.String helohost,
java.util.Properties properties)
Handle the HELO/EHLO command.
|
static void |
init() |
public MilterHandler(java.util.Collection<IMilterListenerFactory> mlfc)
public JilterStatus connect(java.lang.String hostname, java.net.InetAddress hostaddr, java.util.Properties properties)
JilterHandler
connect
in interface JilterHandler
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.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.public JilterStatus helo(java.lang.String helohost, java.util.Properties properties)
JilterHandler
helo
in interface JilterHandler
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.SMFIS_
return codes from JilterStatus
.public JilterStatus envfrom(java.lang.String[] argv, java.util.Properties properties)
JilterHandler
envrcpt
.envfrom
in interface JilterHandler
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.SMFIS_
return codes from JilterStatus
.public JilterStatus envrcpt(java.lang.String[] argv, java.util.Properties properties)
JilterHandler
envfrom
.envrcpt
in interface JilterHandler
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.SMFIS_
return codes from JilterStatus
.public JilterStatus header(java.lang.String headerf, java.lang.String headerv)
JilterHandler
envrcpt
and eoh
, once per message header.header
in interface JilterHandler
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.SMFIS_
return codes from JilterStatus
.public JilterStatus eoh()
JilterHandler
eoh
in interface JilterHandler
SMFIS_
return codes from JilterStatus
.public JilterStatus body(java.nio.ByteBuffer bodyp)
JilterHandler
body
in interface JilterHandler
bodyp
- This block of body data.SMFIS_
return codes from JilterStatus
.public JilterStatus eom(JilterEOMActions eomActions, java.util.Properties properties)
JilterHandler
body
for a
given message.eom
in interface JilterHandler
eomActions
- Interface for effecting message changes.properties
- Any properties (macros) received from the MTA.SMFIS_
return codes from JilterStatus
.public JilterStatus abort()
JilterHandler
eom
).abort
in interface JilterHandler
SMFIS_
return codes from JilterStatus
.public JilterStatus close()
JilterHandler
close
in interface JilterHandler
SMFIS_
return codes from JilterStatus
.public int getSupportedProcesses()
JilterHandler
getSupportedProcesses
in interface JilterHandler
PROCESS_
constants.public int getRequiredModifications()
JilterHandler
getRequiredModifications
in interface JilterHandler
SMFIF_
constants.public static void init()
Copyright © 2021. All Rights Reserved.