public abstract class AbstractRedirect
extends org.apache.mailet.base.GenericMailet
Abstract mailet providing configurable redirection services.
This mailet can be subclassed to make authoring redirection mailets simple.
By extending it and overriding one or more of these methods new behaviour can
be quickly created without the author having to address any other issue than
the relevant one:
For each of the methods above (generically called "getX()" methods in this
class and its subclasses), there is an associated "getX(Mail)" method and
most times a "setX(Mail, Tx, Mail)" method.
The roles are the following:
Here follows the typical pattern of those methods:
...
Tx x;
...
protected boolean getX(Mail originalMail) throws MessagingException {
boolean x = (isStatic()) ? this.x : getX();
...
return x;
}
...
public void init() throws MessagingException {
...
isStatic = (getInitParameter("static") == null) ? false : new Boolean(getInitParameter("static")).booleanValue();
if(isStatic()) {
...
X = getX();
...
}
...
public void service(Mail originalMail) throws MessagingException {
...
setX(newMail, getX(originalMail), originalMail);
...
}
...
The isStatic variable and method is used to allow for the situations
(deprecated since version 2.2, but possibly used by previoulsy written
extensions to Redirect
) in which the getX() methods are non static:
in this case isStatic()
must return false.
Finally, a "getX()" method may return a "special address" (see
AbstractRedirect.SpecialAddress
), that later will be resolved ("late bound") by a
"getX(Mail)" or "setX(Mail, Tx, Mail)": it is a dynamic value that does not
require isStatic
to be false.
Supports by default the passThrough
init parameter (false if
missing). Subclasses can override this behaviour overriding
getPassThrough()
.
Modifier and Type | Class and Description |
---|---|
protected static class |
AbstractRedirect.SpecialAddress
Class containing "special addresses" constants.
|
Modifier and Type | Field and Description |
---|---|
protected static int |
ALL |
protected static int |
BODY |
protected DNSService |
dns |
protected static int |
HEADS |
protected boolean |
isDebug
Controls certain log messages.
|
protected boolean |
isStatic
Holds the value of the
static init parameter. |
protected static int |
MESSAGE |
protected static int |
NONE |
protected static int |
UNALTERED |
Constructor and Description |
---|
AbstractRedirect() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
attachError()
Gets the
attachError property. |
protected boolean |
attachError(org.apache.mailet.Mail originalMail)
Gets the
attachError property, built dynamically using the
original Mail object. |
protected void |
buildAlteredMessage(org.apache.mailet.Mail newMail,
org.apache.mailet.Mail originalMail)
Builds the message of the newMail in case it has to be altered.
|
static void |
changeSubject(javax.mail.internet.MimeMessage message,
String newValue)
It changes the subject of the supplied message to to supplied value but
it also tries to preserve the original charset information.
This method was needed to avoid sending the subject using a charset (usually the default charset on the server) which doesn't contain the characters in the subject, resulting in the loss of these characters. |
protected String[] |
getAllowedInitParameters()
Gets the expected init parameters.
|
protected int |
getAttachmentType()
Gets the
attachment property. |
protected int |
getAttachmentType(org.apache.mailet.Mail originalMail)
Gets the
attachment property, built dynamically using the
original Mail object. |
protected boolean |
getFakeDomainCheck()
Gets the
fakeDomainCheck property. |
protected boolean |
getFakeDomainCheck(org.apache.mailet.Mail originalMail)
Gets the
fakeDomainCheck property, built dynamically using
the original Mail object. |
protected int |
getInLineType()
Gets the
inline property. |
protected int |
getInLineType(org.apache.mailet.Mail originalMail)
Gets the
inline property, built dynamically using the
original Mail object. |
protected String |
getMessage()
Gets the
message property. |
protected String |
getMessage(org.apache.mailet.Mail originalMail)
Gets the
message property, built dynamically using the
original Mail object. |
protected String |
getMessageHeaders(javax.mail.internet.MimeMessage message)
Utility method for obtaining a string representation of a Message's
headers
|
protected boolean |
getPassThrough()
Gets the
passThrough property. |
protected boolean |
getPassThrough(org.apache.mailet.Mail originalMail)
Gets the
passThrough property, built dynamically using the
original Mail object. |
protected Collection |
getRecipients()
Gets the
recipients property. |
protected Collection |
getRecipients(org.apache.mailet.Mail originalMail)
Gets the
recipients property, built dynamically using the
original Mail object. |
protected org.apache.mailet.MailAddress |
getReplyTo()
Gets the
replyto property. |
protected org.apache.mailet.MailAddress |
getReplyTo(org.apache.mailet.Mail originalMail)
Gets the
replyTo property, built dynamically using the
original Mail object. |
protected org.apache.mailet.MailAddress |
getReversePath()
Gets the
reversePath property. |
protected org.apache.mailet.MailAddress |
getReversePath(org.apache.mailet.Mail originalMail)
Gets the
reversePath property, built dynamically using the
original Mail object. |
protected org.apache.mailet.MailAddress |
getSender()
Gets the
sender property. |
protected org.apache.mailet.MailAddress |
getSender(org.apache.mailet.Mail originalMail)
Gets the
sender property, built dynamically using the
original Mail object. |
protected org.apache.mailet.MailAddress |
getSpecialAddress(String addressString,
String[] allowedSpecials)
Returns the
AbstractRedirect.SpecialAddress that corresponds to an init parameter
value. |
protected String |
getSubject()
Gets the
subject property. |
protected String |
getSubject(org.apache.mailet.Mail originalMail)
Gets the
subject property, built dynamically using the
original Mail object. |
protected String |
getSubjectPrefix()
Gets the
prefix property. |
protected String |
getSubjectPrefix(org.apache.mailet.Mail originalMail)
Gets the
subjectPrefix property, built dynamically using the
original Mail object. |
protected javax.mail.internet.InternetAddress[] |
getTo()
Gets the
to property. |
protected javax.mail.internet.InternetAddress[] |
getTo(org.apache.mailet.Mail originalMail)
Gets the
to property, built dynamically using the original
Mail object. |
protected int |
getTypeCode(String param)
A private method to convert types from string to int.
|
void |
init()
Mailet initialization routine.
|
protected boolean |
isReply()
Gets the
isReply property. |
protected boolean |
isReply(org.apache.mailet.Mail originalMail)
Gets the
isReply property, built dynamically using the
original Mail object. |
protected boolean |
isStatic()
Gets the
static property. |
protected Collection |
replaceInternetAddresses(org.apache.mailet.Mail mail,
Collection list)
Returns a new Collection built over list replacing special
addresses with real
InternetAddress -es.Manages SpecialAddress.SENDER ,
SpecialAddress.REVERSE_PATH ,
SpecialAddress.FROM , SpecialAddress.REPLY_TO ,
SpecialAddress.RECIPIENTS , SpecialAddress.TO ,
SpecialAddress.NULL and
SpecialAddress.UNALTERED .SpecialAddress.RECIPIENTS is made equivalent to
SpecialAddress.TO .SpecialAddress.FROM uses the From header if available,
otherwise the Sender header if available, otherwise the return-path.SpecialAddress.REPLY_TO uses the ReplyTo header if
available, otherwise the From header if available, otherwise the Sender
header if available, otherwise the return-path.SpecialAddress.UNALTERED is ignored.Any other address is not replaced. |
protected Collection |
replaceMailAddresses(org.apache.mailet.Mail mail,
Collection list)
Returns a new Collection built over list replacing special
addresses with real
MailAddress -es.Manages SpecialAddress.SENDER ,
SpecialAddress.REVERSE_PATH ,
SpecialAddress.FROM , SpecialAddress.REPLY_TO ,
SpecialAddress.RECIPIENTS , SpecialAddress.TO ,
SpecialAddress.NULL and
SpecialAddress.UNALTERED .SpecialAddress.FROM is made equivalent to
SpecialAddress.SENDER ; SpecialAddress.TO is
made equivalent to SpecialAddress.RECIPIENTS .SpecialAddress.REPLY_TO uses the ReplyTo header if
available, otherwise the From header if available, otherwise the Sender
header if available, otherwise the return-path.SpecialAddress.NULL and
SpecialAddress.UNALTERED are ignored.Any other address is not replaced. |
protected boolean |
senderDomainIsValid(org.apache.mailet.Mail mail)
Checks if a sender domain of mail is valid.
|
void |
service(org.apache.mailet.Mail originalMail)
Service does the hard work,and redirects the originalMail in the form
specified.
|
void |
setDNSService(DNSService dns) |
protected void |
setIsReply(org.apache.mailet.Mail newMail,
boolean isReply,
org.apache.mailet.Mail originalMail)
Sets the "In-Reply-To:" header of newMail to the "Message-Id:" of
originalMail, if isReply is true.
|
protected void |
setRecipients(org.apache.mailet.Mail newMail,
Collection recipients,
org.apache.mailet.Mail originalMail)
Sets the recipients of newMail to recipients.
|
protected void |
setReplyTo(org.apache.mailet.Mail newMail,
org.apache.mailet.MailAddress replyTo,
org.apache.mailet.Mail originalMail)
Sets the "Reply-To:" header of newMail to replyTo.
|
protected void |
setReversePath(MailImpl newMail,
org.apache.mailet.MailAddress reversePath,
org.apache.mailet.Mail originalMail)
Sets the "reverse-path" of newMail to reversePath.
|
protected void |
setSender(org.apache.mailet.Mail newMail,
org.apache.mailet.MailAddress sender,
org.apache.mailet.Mail originalMail)
Sets the "From:" header of newMail to sender.
|
protected void |
setSubjectPrefix(org.apache.mailet.Mail newMail,
String subjectPrefix,
org.apache.mailet.Mail originalMail)
Builds the subject of newMail appending the subject of
originalMail to subjectPrefix.
|
protected void |
setTo(org.apache.mailet.Mail newMail,
javax.mail.internet.InternetAddress[] to,
org.apache.mailet.Mail originalMail)
Sets the "To:" header of newMail to to.
|
protected boolean isDebug
protected boolean isStatic
static
init parameter.protected static final int UNALTERED
protected static final int HEADS
protected static final int BODY
protected static final int ALL
protected static final int NONE
protected static final int MESSAGE
protected DNSService dns
protected String[] getAllowedInitParameters()
public void setDNSService(DNSService dns)
protected boolean isStatic()
Gets the static
property.
Return true to reduce calls to getTo, getSender, getRecipients, getReplyTo, getReversePath amd getMessage where these values don't change (eg hard coded, or got at startup from the mailet config); return false where any of these methods generate their results dynamically eg in response to the message being processed, or by reference to a repository of users.
It is now (from version 2.2) somehow obsolete, as should be always true
because the "good practice" is to use "getX()" methods statically, and
use instead "getX(Mail)" methods for dynamic situations. A false value is
now meaningful only for subclasses of Redirect
older than version
2.2 that were relying on this.
Is a "getX()" method.
protected boolean getPassThrough() throws javax.mail.MessagingException
passThrough
property. Return true to allow the
original message to continue through the processor, false to GHOST it. Is
a "getX()" method.passThrough
init parameter, or false if missingjavax.mail.MessagingException
protected boolean getPassThrough(org.apache.mailet.Mail originalMail) throws javax.mail.MessagingException
passThrough
property, built dynamically using the
original Mail object. Is a "getX(Mail)" method.getPassThrough()
javax.mail.MessagingException
protected boolean getFakeDomainCheck() throws javax.mail.MessagingException
fakeDomainCheck
property. Return true to check if
the sender domain is valid. Is a "getX()" method.fakeDomainCheck
init parameter, or true if
missingjavax.mail.MessagingException
protected boolean getFakeDomainCheck(org.apache.mailet.Mail originalMail) throws javax.mail.MessagingException
fakeDomainCheck
property, built dynamically using
the original Mail object. Is a "getX(Mail)" method.getFakeDomainCheck()
javax.mail.MessagingException
protected int getInLineType() throws javax.mail.MessagingException
inline
property. May return one of the following
values to indicate how to append the original message to build the new
message:
UNALTERED
: original message is the new message bodyBODY
: original message body is appended to the new
messageHEADS
: original message headers are appended to the new
messageALL
: original is appended with all headersNONE
: original is not appendedinline
init parameter, or UNALTERED
if missingjavax.mail.MessagingException
protected int getInLineType(org.apache.mailet.Mail originalMail) throws javax.mail.MessagingException
inline
property, built dynamically using the
original Mail object. Is a "getX(Mail)" method.getInLineType()
javax.mail.MessagingException
protected int getAttachmentType() throws javax.mail.MessagingException
attachment
property. May return one of the
following values to indicate how to attach the original message to the
new message:
BODY
: original message body is attached as plain text
to the new messageHEADS
: original message headers are attached as plain
text to the new messageALL
: original is attached as plain text with all
headersMESSAGE
: original message is attached as type
message/rfc822, a complete mail message.NONE
: original is not attachedattachment
init parameter, or NONE
if missingjavax.mail.MessagingException
protected int getAttachmentType(org.apache.mailet.Mail originalMail) throws javax.mail.MessagingException
attachment
property, built dynamically using the
original Mail object. Is a "getX(Mail)" method.getAttachmentType()
javax.mail.MessagingException
protected String getMessage() throws javax.mail.MessagingException
message
property. Returns a message to which the
original message can be attached/appended to build the new message. Is a
"getX()" method.message
init parameter or an empty string if
missingjavax.mail.MessagingException
protected String getMessage(org.apache.mailet.Mail originalMail) throws javax.mail.MessagingException
message
property, built dynamically using the
original Mail object. Is a "getX(Mail)" method.getMessage()
javax.mail.MessagingException
protected Collection getRecipients() throws javax.mail.MessagingException
recipients
property. Returns the collection of
recipients of the new message, or null if no change is requested. Is a
"getX()" method.recipients
init parameter or the postmaster
address or SpecialAddress.SENDER
or
SpecialAddress.FROM
or
SpecialAddress.REPLY_TO
or
SpecialAddress.REVERSE_PATH
or
SpecialAddress.UNALTERED
or
SpecialAddress.RECIPIENTS
or null
if
missingjavax.mail.MessagingException
protected Collection getRecipients(org.apache.mailet.Mail originalMail) throws javax.mail.MessagingException
recipients
property, built dynamically using the
original Mail object. Is a "getX(Mail)" method.replaceMailAddresses(org.apache.mailet.Mail, java.util.Collection)
on getRecipients()
,javax.mail.MessagingException
protected void setRecipients(org.apache.mailet.Mail newMail, Collection recipients, org.apache.mailet.Mail originalMail) throws javax.mail.MessagingException
javax.mail.MessagingException
protected javax.mail.internet.InternetAddress[] getTo() throws javax.mail.MessagingException
to
property. Returns the "To:" recipients of the
new message. or null if no change is requested. Is a "getX()" method.to
init parameter or the postmaster address or
SpecialAddress.SENDER
or
SpecialAddress.REVERSE_PATH
or
SpecialAddress.FROM
or
SpecialAddress.REPLY_TO
or
SpecialAddress.UNALTERED
or
SpecialAddress.TO
or null
if missingjavax.mail.MessagingException
protected javax.mail.internet.InternetAddress[] getTo(org.apache.mailet.Mail originalMail) throws javax.mail.MessagingException
to
property, built dynamically using the original
Mail object. Its outcome will be the the value the TO: header will
be set to, that could be different from the real recipient (see
Mail.getRecipients()
). Is a "getX(Mail)" method.replaceInternetAddresses(org.apache.mailet.Mail, java.util.Collection)
on getRecipients()
,javax.mail.MessagingException
protected void setTo(org.apache.mailet.Mail newMail, javax.mail.internet.InternetAddress[] to, org.apache.mailet.Mail originalMail) throws javax.mail.MessagingException
javax.mail.MessagingException
protected org.apache.mailet.MailAddress getReplyTo() throws javax.mail.MessagingException
replyto
property. Returns the Reply-To address of
the new message, or null if no change is requested. Is a "getX()" method.replyto
init parameter or the postmaster address
or SpecialAddress.SENDER
or
SpecialAddress.UNALTERED
or
SpecialAddress.NULL
or null
if missingjavax.mail.MessagingException
protected org.apache.mailet.MailAddress getReplyTo(org.apache.mailet.Mail originalMail) throws javax.mail.MessagingException
replyTo
property, built dynamically using the
original Mail object. Is a "getX(Mail)" method.getReplyTo()
replacing
SpecialAddress.UNALTERED
if applicable with null and
SpecialAddress.SENDER
with the original mail senderjavax.mail.MessagingException
protected void setReplyTo(org.apache.mailet.Mail newMail, org.apache.mailet.MailAddress replyTo, org.apache.mailet.Mail originalMail) throws javax.mail.MessagingException
Sets the "Reply-To:" header of newMail to replyTo.
If the requested value isSpecialAddress.NULL
will remove
the "Reply-To:" header. If the requested value is null does nothing.
Is a "setX(Mail, Tx, Mail)" method.javax.mail.MessagingException
protected org.apache.mailet.MailAddress getReversePath() throws javax.mail.MessagingException
reversePath
property. Returns the reverse-path of
the new message, or null if no change is requested. Is a "getX()" method.reversePath
init parameter or the postmaster
address or SpecialAddress.SENDER
or
SpecialAddress.NULL
or
SpecialAddress.UNALTERED
or null
if
missingjavax.mail.MessagingException
protected org.apache.mailet.MailAddress getReversePath(org.apache.mailet.Mail originalMail) throws javax.mail.MessagingException
reversePath
property, built dynamically using the
original Mail object. Is a "getX(Mail)" method.getReversePath()
, replacing
SpecialAddress.SENDER
if applicable with null,
replacing SpecialAddress.UNALTERED
and
SpecialAddress.REVERSE_PATH
if applicable with null,
but not replacing SpecialAddress.NULL
that will be
handled by setReversePath(org.apache.james.core.MailImpl, org.apache.mailet.MailAddress, org.apache.mailet.Mail)
javax.mail.MessagingException
protected void setReversePath(MailImpl newMail, org.apache.mailet.MailAddress reversePath, org.apache.mailet.Mail originalMail) throws javax.mail.MessagingException
SpecialAddress.NULL
sets it to "<>". If
the requested value is null does nothing. Is a "setX(Mail, Tx, Mail)"
method.javax.mail.MessagingException
protected org.apache.mailet.MailAddress getSender() throws javax.mail.MessagingException
sender
property. Returns the new sender as a
MailAddress, or null if no change is requested. Is a "getX()" method.sender
init parameter or the postmaster address
or SpecialAddress.SENDER
or
SpecialAddress.UNALTERED
or null
if
missingjavax.mail.MessagingException
protected org.apache.mailet.MailAddress getSender(org.apache.mailet.Mail originalMail) throws javax.mail.MessagingException
sender
property, built dynamically using the
original Mail object. Is a "getX(Mail)" method.getSender()
replacing
SpecialAddress.UNALTERED
and
SpecialAddress.SENDER
if applicable with nulljavax.mail.MessagingException
protected void setSender(org.apache.mailet.Mail newMail, org.apache.mailet.MailAddress sender, org.apache.mailet.Mail originalMail) throws javax.mail.MessagingException
javax.mail.MessagingException
protected String getSubject() throws javax.mail.MessagingException
subject
property. Returns a string for the new
message subject. Is a "getX()" method.subject
init parameter or null if missingjavax.mail.MessagingException
protected String getSubject(org.apache.mailet.Mail originalMail) throws javax.mail.MessagingException
subject
property, built dynamically using the
original Mail object. Is a "getX(Mail)" method.getSubject()
javax.mail.MessagingException
protected String getSubjectPrefix() throws javax.mail.MessagingException
prefix
property. Returns a prefix for the new
message subject. Is a "getX()" method.prefix
init parameter or an empty string if
missingjavax.mail.MessagingException
protected String getSubjectPrefix(org.apache.mailet.Mail originalMail) throws javax.mail.MessagingException
subjectPrefix
property, built dynamically using the
original Mail object. Is a "getX(Mail)" method.getSubjectPrefix()
javax.mail.MessagingException
protected void setSubjectPrefix(org.apache.mailet.Mail newMail, String subjectPrefix, org.apache.mailet.Mail originalMail) throws javax.mail.MessagingException
javax.mail.MessagingException
protected boolean attachError() throws javax.mail.MessagingException
attachError
property. Returns a boolean indicating
whether to append a description of any error to the main body part of the
new message, if getInlineType does not return "UNALTERED". Is a "getX()"
method.attachError
init parameter; false if missingjavax.mail.MessagingException
protected boolean attachError(org.apache.mailet.Mail originalMail) throws javax.mail.MessagingException
attachError
property, built dynamically using the
original Mail object. Is a "getX(Mail)" method.attachError()
javax.mail.MessagingException
protected boolean isReply() throws javax.mail.MessagingException
isReply
property. Returns a boolean indicating
whether the new message must be considered a reply to the original
message, setting the IN_REPLY_TO header of the new message to the id of
the original message. Is a "getX()" method.isReply
init parameter; false if missingjavax.mail.MessagingException
protected boolean isReply(org.apache.mailet.Mail originalMail) throws javax.mail.MessagingException
isReply
property, built dynamically using the
original Mail object. Is a "getX(Mail)" method.isReply()
javax.mail.MessagingException
protected void setIsReply(org.apache.mailet.Mail newMail, boolean isReply, org.apache.mailet.Mail originalMail) throws javax.mail.MessagingException
javax.mail.MessagingException
public void init() throws javax.mail.MessagingException
isStatic()
returns true.init
in class org.apache.mailet.base.GenericMailet
javax.mail.MessagingException
public void service(org.apache.mailet.Mail originalMail) throws javax.mail.MessagingException
service
in interface org.apache.mailet.Mailet
service
in class org.apache.mailet.base.GenericMailet
originalMail
- the mail to process and redirectjavax.mail.MessagingException
- if a problem arises formulating the redirected mailprotected int getTypeCode(String param)
param
- the string typeprotected String getMessageHeaders(javax.mail.internet.MimeMessage message) throws javax.mail.MessagingException
javax.mail.MessagingException
protected void buildAlteredMessage(org.apache.mailet.Mail newMail, org.apache.mailet.Mail originalMail) throws javax.mail.MessagingException
originalMail
- the original Mail objectnewMail
- the Mail object to buildjavax.mail.MessagingException
protected final org.apache.mailet.MailAddress getSpecialAddress(String addressString, String[] allowedSpecials) throws javax.mail.MessagingException
AbstractRedirect.SpecialAddress
that corresponds to an init parameter
value. The init parameter value is checked against a String[] of allowed
values. The checks are case insensitive.addressString
- the string to check if is a special addressallowedSpecials
- a String[] with the allowed special addressesjavax.mail.MessagingException
- if is a special address not in the allowedSpecials arrayprotected final boolean senderDomainIsValid(org.apache.mailet.Mail mail) throws javax.mail.MessagingException
Checks if a sender domain of mail is valid.
If we do not do this check, and someone uses a redirection mailet in a
processor initiated by SenderInFakeDomain, then a fake sender domain will
cause an infinite loop (the forwarded e-mail still appears to come from a
fake domain).
Although this can be viewed as a configuration error, the consequences of
such a mis-configuration are severe enough to warrant protecting against
the infinite loop.
This check can be skipped if getFakeDomainCheck(Mail)
returns
true.
mail
- the mail object to checkMailetContext.getMailServers(java.lang.String)
returns
true for the sender host partjavax.mail.MessagingException
public static void changeSubject(javax.mail.internet.MimeMessage message, String newValue) throws javax.mail.MessagingException
message
- the message of which subject is changednewValue
- the new (unencoded) value of the subject. It must not be null.javax.mail.MessagingException
- - according to the JavaMail doc most likely this is never
thrownprotected Collection replaceMailAddresses(org.apache.mailet.Mail mail, Collection list)
MailAddress
-es.SpecialAddress.SENDER
,
SpecialAddress.REVERSE_PATH
,
SpecialAddress.FROM
, SpecialAddress.REPLY_TO
,
SpecialAddress.RECIPIENTS
, SpecialAddress.TO
,
SpecialAddress.NULL
and
SpecialAddress.UNALTERED
.SpecialAddress.FROM
is made equivalent to
SpecialAddress.SENDER
; SpecialAddress.TO
is
made equivalent to SpecialAddress.RECIPIENTS
.SpecialAddress.REPLY_TO
uses the ReplyTo header if
available, otherwise the From header if available, otherwise the Sender
header if available, otherwise the return-path.SpecialAddress.NULL
and
SpecialAddress.UNALTERED
are ignored.protected Collection replaceInternetAddresses(org.apache.mailet.Mail mail, Collection list) throws javax.mail.MessagingException
InternetAddress
-es.SpecialAddress.SENDER
,
SpecialAddress.REVERSE_PATH
,
SpecialAddress.FROM
, SpecialAddress.REPLY_TO
,
SpecialAddress.RECIPIENTS
, SpecialAddress.TO
,
SpecialAddress.NULL
and
SpecialAddress.UNALTERED
.SpecialAddress.RECIPIENTS
is made equivalent to
SpecialAddress.TO
.SpecialAddress.FROM
uses the From header if available,
otherwise the Sender header if available, otherwise the return-path.SpecialAddress.REPLY_TO
uses the ReplyTo header if
available, otherwise the From header if available, otherwise the Sender
header if available, otherwise the return-path.SpecialAddress.UNALTERED
is ignored.javax.mail.MessagingException
Copyright © 2002-2012 The Apache Software Foundation. All Rights Reserved.