public class RemoteDelivery extends org.apache.mailet.base.GenericMailet implements Runnable
The RemoteDelivery mailet delivers messages to a remote SMTP server able to deliver or forward messages to their final destination.
The remote SMTP server through which each mail is delivered is resolved using MX lookup for each message destination
unless the <gateway/>
parameter is set. The <gateway/>
parameter enables the
definition of one or more gateway servers through which all messages are sent.
If an attempt to deliver a message fails, a redelivery attempt is scheduled according to the scheme defined
by the <delayTime/>
parameter, retrying up to the limit defined
by the <maxRetries/>
parameter. When the retry limit is exceeded, delivery failure is processed
according to the setting of the <bounceProcessor/>
parameter.
These are the parameters that control the operation of the RemoteDelivery mailet:
[attempts\*]delay [unit]
where:
<delayTime>1 * 6 hour</delayTime>
<delayTime/>
specified.
host[:port]
where:
<gatewayPort/>
parameter if set, else the default port for the specified connection type.<gateway/>
parameter. Default is the default port for the specified connection type.gatewayUsername
) is set - a String representing the password to be used
to authenticate the user using the AUTH command.
localhost
.mail.
described in the Javadoc for package
com.sun.mail.smtp
can be set with a parameter of the corresponding name. For example the parameter
<mail.smtp.ssl.enable>true</mail.smtp.ssl.enable>
is equivalent to the Java code
props.put("mail.smtp.ssl.enable", "true");
. Properties set by this facility override settings made
within the mailet code.Constructor and Description |
---|
RemoteDelivery() |
Modifier and Type | Method and Description |
---|---|
void |
destroy()
Stops all the worker threads that are waiting for messages.
|
protected String |
getErrorMsg(javax.mail.MessagingException me)
Utility method for getting the error message from the (nested) exception.
|
protected String |
getHeloName() |
String |
getMailetInfo() |
void |
init()
Initializes all arguments based on configuration values specified in the
James configuration file.
|
protected javax.mail.Session |
obtainSession(Properties props)
Returns the javamail Session object.
|
void |
run()
Handles checking the outgoing spool for new mail and delivering them if
there are any
|
void |
service(org.apache.mailet.Mail mail)
For this message, we take the list of recipients, organize these into
distinct servers, and duplicate the message for each of these servers,
and then call the deliver (messagecontainer) method for each
server-specific messagecontainer ...
|
void |
setDNSService(DNSService dnsService) |
void |
setDomainList(DomainList domainList) |
void |
setMailQueueFactory(MailQueueFactory queueFactory) |
public void setMailQueueFactory(MailQueueFactory queueFactory)
public void setDNSService(DNSService dnsService)
public void setDomainList(DomainList domainList)
public void init() throws javax.mail.MessagingException
init
in class org.apache.mailet.base.GenericMailet
javax.mail.MessagingException
- on failure to initialize attributes.public String getMailetInfo()
getMailetInfo
in interface org.apache.mailet.Mailet
getMailetInfo
in class org.apache.mailet.base.GenericMailet
public void service(org.apache.mailet.Mail mail) throws javax.mail.MessagingException
service
in interface org.apache.mailet.Mailet
service
in class org.apache.mailet.base.GenericMailet
mail
- org.apache.mailet.Mailjavax.mail.MessagingException
public void destroy()
destroy
in interface org.apache.mailet.Mailet
destroy
in class org.apache.mailet.base.GenericMailet
public void run()
protected String getErrorMsg(javax.mail.MessagingException me)
me
- MessagingExceptionprotected javax.mail.Session obtainSession(Properties props)
props
- protected String getHeloName()
Copyright © 2002-2012 The Apache Software Foundation. All Rights Reserved.