public class RegExEmailExaminer
extends atg.service.email.examiner.EmailExaminerImpl
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string
|
protected java.lang.String |
mBouncedEmailAddressRegEx |
protected int |
mBouncedEmailAddressRegExGroupIndex |
protected java.util.regex.Pattern |
mBouncedEmailAddressRegExPattern |
protected java.lang.String |
mBouncedEnhancedStatusCodeRegEx |
protected int |
mBouncedEnhancedStatusCodeRegExGroupIndex |
protected java.util.regex.Pattern |
mBouncedEnhancedStatusCodeRegExPattern |
protected java.lang.String |
mBouncedErrorMessageRegEx |
protected int |
mBouncedErrorMessageRegExGroupIndex |
protected java.util.regex.Pattern |
mBouncedErrorMessageRegExPattern |
protected java.lang.String |
mBouncedReplyCodeRegEx |
protected int |
mBouncedReplyCodeRegExGroupIndex |
protected java.util.regex.Pattern |
mBouncedReplyCodeRegExPattern |
protected java.lang.String[] |
mMonitoredBounceReplyCodes
A list of reply codes that indicate a message is bounced
|
protected java.lang.String |
mMTAIdentifierHeaderKey |
protected java.lang.String |
mMTAIdentifierHeaderValueRegEx |
protected int |
mMTAIdentifierHeaderValueRegExGroupIndex |
protected java.util.regex.Pattern |
mMTAIdentifierHeaderValueRegExPattern |
mEmailTrackingTools, mExtractOriginalMessageIDFromMessageText, mScanningContentForAdditionalHeaders, X_ATG_HEADER_PREFIX
SERVICE_INFO_KEY
DEFAULT_LOG_TRACE_STATUS
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
Constructor and Description |
---|
RegExEmailExaminer() |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
examineEmail(javax.mail.Message pMessage)
This method examines the given message in some implementation
specific manner.
|
protected java.lang.String |
findMatch(java.util.regex.Pattern pPattern,
java.lang.String pSequence,
int pGroupIndex)
Returns the
java.util.regex.Mapper group match captured
during the match operation when evaluating the supplied
Pattern . |
java.lang.String |
getBouncedEmailAddress(javax.mail.Message pMessage)
This method gets the email address from a presumed bounced
email in the correct format for this MTA.
|
protected java.lang.String |
getBouncedEmailAddress(java.lang.String pContent)
This method gets any associated error message that is given
from a bounced email.
|
java.lang.String |
getBouncedEmailAddressRegEx()
A reg-ex used to extract the bounced email's intended
recipient's email address.
|
int |
getBouncedEmailAddressRegExGroupIndex()
Gets the
java.util.regex.Mapper group index of the
expression returned from the bouncedEmailAddressRegEx property to capture
during the match operation when evaluating the
getBouncedEmailAddress(Message) method. |
java.util.regex.Pattern |
getBouncedEmailAddressRegExPattern()
Returns the compiled RegEx pattern defined by
getBouncedEmailAddressRegEx() |
java.lang.String |
getBouncedEnhancedStatusCode(javax.mail.Message pMessage)
Gets the enhanced status code according to RFC 1893 that gives
more detail on the nature of the error.
|
protected java.lang.String |
getBouncedEnhancedStatusCode(java.lang.String pContent)
Gets the enhanced status code according to RFC 1893 that gives
more detail on the nature of the error.
|
java.lang.String |
getBouncedEnhancedStatusCodeRegEx()
A reg-ex used to extract the bounced email's enhanced
status code.
|
int |
getBouncedEnhancedStatusCodeRegExGroupIndex()
Gets the
java.util.regex.Mapper group index of the
expression returned from the bouncedEnhancedStatusCodeRegEx property to capture
during the match operation when evaluating the
getBouncedEnhancedStatusCode(Message) method. |
java.util.regex.Pattern |
getBouncedEnhancedStatusCodeRegExPattern()
Returns the compiled RegEx pattern defined by
getBouncedEnhancedStatusCodeRegEx() |
java.lang.String |
getBouncedErrorMessage(javax.mail.Message pMessage)
This method gets any associated error message that is given
from a bounced email.
|
protected java.lang.String |
getBouncedErrorMessage(java.lang.String pContent)
This method gets any associated error message that is given
from a bounced email.
|
java.lang.String |
getBouncedErrorMessageRegEx()
A reg-ex used to extract the bounced email's error
message.
|
int |
getBouncedErrorMessageRegExGroupIndex()
Gets the
java.util.regex.Mapper group index of the
expression returned from the bouncedErrorMessageRegEx property to capture
during the match operation when evaluating the
getBouncedErrorMessage(Message) method. |
java.util.regex.Pattern |
getBouncedErrorMessageRegExPattern()
Returns the compiled RegEx pattern defined by
getBouncedErrorMessageRegEx() |
java.lang.String |
getBouncedReplyCode(javax.mail.Message pMessage)
Gets the reply code (RFC 821) of the given bounced message.
|
protected java.lang.String |
getBouncedReplyCode(java.lang.String pContent)
Gets the reply code (RFC 821) of the given bounced message.
|
java.lang.String |
getBouncedReplyCodeRegEx()
A reg-ex used to extract the bounced email's reply
code.
|
int |
getBouncedReplyCodeRegExGroupIndex()
Gets the
java.util.regex.Mapper group index of the
expression returned from the bouncedReplyCodeRegEx property to capture
during the match operation when evaluating the
getBouncedReplyCode(Message) method. |
java.util.regex.Pattern |
getBouncedReplyCodeRegExPattern()
Returns the compiled RegEx pattern defined by
getBouncedReplyCodeRegEx() |
java.lang.String[] |
getMonitoredBounceReplyCodes()
Gets the MonitoredReplyCodes property
|
java.lang.String |
getMTAIdentifierHeaderKey()
The name of the header that can be used to identify the MTA
|
java.lang.String |
getMTAIdentifierHeaderValueRegEx()
A RegEx used to match against the value of the MTA Identifier header.
|
int |
getMTAIdentifierHeaderValueRegExGroupIndex()
Gets the
java.util.regex.Mapper group index of the
expression returned from the MTAIdentifierHeaderValueRegEx property to capture
during the match operation when evaluating the
#getMTAIdentifierHeaderValue(Message) method. |
java.util.regex.Pattern |
getMTAIdentifierHeaderValueRegExPattern()
Returns the compiled RegEx pattern defined by
getMTAIdentifierHeaderValueRegEx() |
boolean |
isBouncedEmail(javax.mail.Message pMessage)
Determines whether the passed in message was bounced by
the MTA this examiner is responsible for.
|
void |
setBouncedEmailAddressRegEx(java.lang.String pBouncedEmailAddressRegEx)
A reg-ex used to extract the bounced email's intended
recipient's email address.
|
void |
setBouncedEmailAddressRegExGroupIndex(int pBouncedEmailAddressRegExGroupIndex) |
void |
setBouncedEnhancedStatusCodeRegEx(java.lang.String pBouncedEnhancedStatusCodeRegEx)
A reg-ex used to extract the bounced email's enhanced
status code.
|
void |
setBouncedEnhancedStatusCodeRegExGroupIndex(int pBouncedEnhancedStatusCodeRegExGroupIndex) |
void |
setBouncedErrorMessageRegEx(java.lang.String pBouncedErrorMessageRegEx)
A reg-ex used to extract the bounced email's error
message
|
void |
setBouncedErrorMessageRegExGroupIndex(int pBouncedErrorMessageRegExGroupIndex) |
void |
setBouncedReplyCodeRegEx(java.lang.String pBouncedReplyCodeRegEx)
A reg-ex used to extract the bounced email's reply
code
|
void |
setBouncedReplyCodeRegExGroupIndex(int pBouncedReplyCodeRegExGroupIndex) |
void |
setMonitoredBounceReplyCodes(java.lang.String[] pMonitoredBounceReplyCodes)
Sets the MonitoredBounceReplyCodes property
|
void |
setMTAIdentifierHeaderKey(java.lang.String pMTAIdentifierHeaderKey)
The name of the header that can be used to identify the MTA
|
void |
setMTAIdentifierHeaderValueRegEx(java.lang.String pMTAIdentifierHeaderValueRegEx)
A RegEx used to match against the value of the MTA Identifier header.
|
void |
setMTAIdentifierHeaderValueRegExGroupIndex(int pMTAIdentifierHeaderValueRegExGroupIndex) |
getAdditionalHeaderPrefixes, getAdditionalHeaders, getConfiguredSoftBounceCodes, getEmailTrackingTools, getMTAName, getOriginalMessageID, getSoftBounceEnhancedStatusCodes, getSoftBounceReplyCodes, getTrackingData, isExtractOriginalMessageIDFromMessageText, isScanningContentForAdditionalHeaders, isSoftBouncedEmail, setAdditionalHeaderPrefixes, setEmailTrackingTools, setExtractOriginalMessageIDFromMessageText, setMTAName, setScanningContentForAdditionalHeaders, setSoftBounceEnhancedStatusCodes, setSoftBounceReplyCodes
addLogListener, createAdminServlet, doStartService, doStopService, getAbsoluteName, getAdminServlet, getAdminServletOutputStreamEncoding, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isAdminServletUseServletOutputStream, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, reResolveThis, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setAdminServletOutputStreamEncoding, setAdminServletUseServletOutputStream, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService, toString
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
public static java.lang.String CLASS_VERSION
protected java.util.regex.Pattern mMTAIdentifierHeaderValueRegExPattern
protected java.util.regex.Pattern mBouncedEmailAddressRegExPattern
protected java.util.regex.Pattern mBouncedReplyCodeRegExPattern
protected java.util.regex.Pattern mBouncedErrorMessageRegExPattern
protected java.util.regex.Pattern mBouncedEnhancedStatusCodeRegExPattern
protected java.lang.String[] mMonitoredBounceReplyCodes
protected java.lang.String mMTAIdentifierHeaderKey
protected java.lang.String mMTAIdentifierHeaderValueRegEx
protected int mMTAIdentifierHeaderValueRegExGroupIndex
protected java.lang.String mBouncedEmailAddressRegEx
protected int mBouncedEmailAddressRegExGroupIndex
protected java.lang.String mBouncedReplyCodeRegEx
protected int mBouncedReplyCodeRegExGroupIndex
protected java.lang.String mBouncedErrorMessageRegEx
protected int mBouncedErrorMessageRegExGroupIndex
protected java.lang.String mBouncedEnhancedStatusCodeRegEx
protected int mBouncedEnhancedStatusCodeRegExGroupIndex
public void setMonitoredBounceReplyCodes(java.lang.String[] pMonitoredBounceReplyCodes)
pMonitoredBounceReplyCodes
- an array of RFC 821 reply codes
that will indicate an email is bounced. The isBouncedEmail
method will only return true if the reply code set in the bounced
email matches one of the values of this propertypublic java.lang.String[] getMonitoredBounceReplyCodes()
isBouncedEmail
method will only return true if the reply code set in the bounced
email matches one of the values of this propertypublic java.lang.String getMTAIdentifierHeaderKey()
public void setMTAIdentifierHeaderKey(java.lang.String pMTAIdentifierHeaderKey)
pMTAIdentifierHeaderKey
- The name of the header.public java.lang.String getMTAIdentifierHeaderValueRegEx()
public void setMTAIdentifierHeaderValueRegEx(java.lang.String pMTAIdentifierHeaderValueRegEx)
pMTAIdentifierHeaderValueRegEx
- The RegEx string to use.public java.util.regex.Pattern getMTAIdentifierHeaderValueRegExPattern()
getMTAIdentifierHeaderValueRegEx()
public int getMTAIdentifierHeaderValueRegExGroupIndex()
java.util.regex.Mapper
group index of the
expression returned from the MTAIdentifierHeaderValueRegEx property to capture
during the match operation when evaluating the
#getMTAIdentifierHeaderValue(Message)
method.
A group index of 0
returns the entire match. Indexes
of groups contained in the pattern are one based, thus a group
index of 1
specifies the first match group contained
in the pattern.
Matcher.group(int)
public void setMTAIdentifierHeaderValueRegExGroupIndex(int pMTAIdentifierHeaderValueRegExGroupIndex)
public java.lang.String getBouncedEmailAddressRegEx()
public void setBouncedEmailAddressRegEx(java.lang.String pBouncedEmailAddressRegEx)
pBouncedEmailAddressRegEx
- The reg-ex.public java.util.regex.Pattern getBouncedEmailAddressRegExPattern()
getBouncedEmailAddressRegEx()
public int getBouncedEmailAddressRegExGroupIndex()
java.util.regex.Mapper
group index of the
expression returned from the bouncedEmailAddressRegEx property to capture
during the match operation when evaluating the
getBouncedEmailAddress(Message)
method.
A group index of 0
returns the entire match. Indexes
of groups contained in the pattern are one based, thus a group
index of 1
specifies the first match group contained
in the pattern.
Matcher.group(int)
public void setBouncedEmailAddressRegExGroupIndex(int pBouncedEmailAddressRegExGroupIndex)
public java.lang.String getBouncedReplyCodeRegEx()
public void setBouncedReplyCodeRegEx(java.lang.String pBouncedReplyCodeRegEx)
pBouncedReplyCodeRegEx
- The reg-ex.public java.util.regex.Pattern getBouncedReplyCodeRegExPattern()
getBouncedReplyCodeRegEx()
public int getBouncedReplyCodeRegExGroupIndex()
java.util.regex.Mapper
group index of the
expression returned from the bouncedReplyCodeRegEx property to capture
during the match operation when evaluating the
getBouncedReplyCode(Message)
method.
A group index of 0
returns the entire match. Indexes
of groups contained in the pattern are one based, thus a group
index of 1
specifies the first match group contained
in the pattern.
Matcher.group(int)
public void setBouncedReplyCodeRegExGroupIndex(int pBouncedReplyCodeRegExGroupIndex)
public java.lang.String getBouncedErrorMessageRegEx()
public void setBouncedErrorMessageRegEx(java.lang.String pBouncedErrorMessageRegEx)
pBouncedErrorMessageRegEx
- The reg-ex.public java.util.regex.Pattern getBouncedErrorMessageRegExPattern()
getBouncedErrorMessageRegEx()
public int getBouncedErrorMessageRegExGroupIndex()
java.util.regex.Mapper
group index of the
expression returned from the bouncedErrorMessageRegEx property to capture
during the match operation when evaluating the
getBouncedErrorMessage(Message)
method.
A group index of 0
returns the entire match. Indexes
of groups contained in the pattern are one based, thus a group
index of 1
specifies the first match group contained
in the pattern.
Matcher.group(int)
public void setBouncedErrorMessageRegExGroupIndex(int pBouncedErrorMessageRegExGroupIndex)
public java.lang.String getBouncedEnhancedStatusCodeRegEx()
public void setBouncedEnhancedStatusCodeRegEx(java.lang.String pBouncedEnhancedStatusCodeRegEx)
pBouncedEnhancedStatusCodeRegEx
- The reg-ex.public java.util.regex.Pattern getBouncedEnhancedStatusCodeRegExPattern()
getBouncedEnhancedStatusCodeRegEx()
public int getBouncedEnhancedStatusCodeRegExGroupIndex()
java.util.regex.Mapper
group index of the
expression returned from the bouncedEnhancedStatusCodeRegEx property to capture
during the match operation when evaluating the
getBouncedEnhancedStatusCode(Message)
method.
A group index of 0
returns the entire match. Indexes
of groups contained in the pattern are one based, thus a group
index of 1
specifies the first match group contained
in the pattern.
Matcher.group(int)
public void setBouncedEnhancedStatusCodeRegExGroupIndex(int pBouncedEnhancedStatusCodeRegExGroupIndex)
public boolean isBouncedEmail(javax.mail.Message pMessage) throws javax.mail.MessagingException, EmailException
pMessage
- the message to examinejavax.mail.MessagingException
- if a problem occurs while calling
methods on the pMessage
objectEmailException
- if a problem occurs during the parsing
of the content, of invalid arguments are specifiedpublic java.lang.String getBouncedEmailAddress(javax.mail.Message pMessage) throws javax.mail.MessagingException, EmailException
getBouncedEmailAddressRegEx()
reg-ex
pattern.
pMessage
- the message to examinejavax.mail.MessagingException
- if a problem occurs while calling
methods on the pMessage
objectEmailException
- if a problem occurs during the parsing
of the content, of invalid arguments are specifiedpublic java.lang.String getBouncedReplyCode(javax.mail.Message pMessage) throws javax.mail.MessagingException, EmailException
getBouncedReplyCodeRegEx()
reg-ex
pattern.
pMessage
- the bounced message to examinepMessage
i.e. the formatting is not what was
expected, or the message has not been determined as bouncedjavax.mail.MessagingException
- if a problem occurs while calling
methods on the pMessage
objectEmailException
- if a problem occurs during the parsing
of the content, of invalid arguments are specified
NOTE: An exception should NOT be thrown if the given message
is not in a format recognized by this examiner. In most cases,
a list of examiners will be called upon to see if any consider
the message as bounced in a given operation. Developers are expected
to return null in this case.public java.lang.String getBouncedErrorMessage(javax.mail.Message pMessage) throws javax.mail.MessagingException, EmailException
getBouncedErrorMessageRegEx()
reg-ex
pattern.
pMessage
- the message to examinejavax.mail.MessagingException
- if a problem occurs while calling
methods on the pMessage
objectEmailException
- if a problem occurs during the parsing
of the content, of invalid arguments are specifiedpublic java.lang.String getBouncedEnhancedStatusCode(javax.mail.Message pMessage) throws javax.mail.MessagingException, EmailException
getBouncedEnhancedStatusCodeRegEx()
reg-ex
pattern.
pMessage
- the message to examinejavax.mail.MessagingException
- if a problem occurs while calling
methods on the pMessage
objectEmailException
- if a problem occurs during the parsing
of the content, of invalid arguments are specifiedpublic java.lang.Object examineEmail(javax.mail.Message pMessage) throws javax.mail.MessagingException, EmailException
pMessage
- the message to examinejavax.mail.MessagingException
- if a problem occurs while calling
methods on the pMessage
objectEmailException
- if a problem occurs during the parsing
of the content, of invalid arguments are specifiedprotected java.lang.String getBouncedEmailAddress(java.lang.String pContent)
getBouncedEmailAddressRegEx()
reg-ex
pattern.
pContent
- the content to examineprotected java.lang.String getBouncedReplyCode(java.lang.String pContent)
getBouncedReplyCodeRegEx()
reg-ex
pattern.
pConte
- the bounced content to examinepMessage
i.e. the formatting is not what was
expected, or the message has not been determined as bouncedprotected java.lang.String getBouncedEnhancedStatusCode(java.lang.String pContent)
getBouncedEnhancedStatusCodeRegEx()
reg-ex
pattern.
pContent
- the content to examineprotected java.lang.String getBouncedErrorMessage(java.lang.String pContent)
getBouncedErrorMessageRegEx()
reg-ex
pattern.
pContent
- the content to examineprotected java.lang.String findMatch(java.util.regex.Pattern pPattern, java.lang.String pSequence, int pGroupIndex)
java.util.regex.Mapper
group match captured
during the match operation when evaluating the supplied
Pattern
. The reg-ex pattern group to
capture is specified using the pGroupIndex parameter. If the whole
match is to be returned, a pGroupIndex value of 0
should
be supplied, otherwise the groups are specified using one based index.
Thus, the first reg-ex pattern group is specified using a pGroupIndex
value of 1
.
pPattern
- A pattern to match withpSequence
- A character sequence to look for a match.pGroupIndex
-