atg.service.email.examiner
Class RegExEmailExaminer

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.service.email.examiner.EmailExaminerImpl
              extended by atg.service.email.examiner.RegExEmailExaminer
All Implemented Interfaces:
NameContextBindingListener, NameContextElement, NameResolver, AdminableService, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, atg.service.email.examiner.AdditionalHeadersEmailExaminer, EmailExaminer, java.util.EventListener

public class RegExEmailExaminer
extends atg.service.email.examiner.EmailExaminerImpl

This is a service that determines properties of a bounced message created by a MTA using regular expressions. The examiner looks for configurable string expressions inside the text of the bounced message to determine the various properties of the email.


Field Summary
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
           
 
Fields inherited from class atg.service.email.examiner.EmailExaminerImpl
mEmailTrackingTools, mExtractOriginalMessageIDFromMessageText, mScanningContentForAdditionalHeaders, X_ATG_HEADER_PREFIX
 
Fields inherited from class atg.nucleus.GenericService
SERVICE_INFO_KEY
 
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging
DEFAULT_LOG_TRACE_STATUS
 
Fields inherited from interface atg.nucleus.logging.ApplicationLogging
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
 
Constructor Summary
RegExEmailExaminer()
           
 
Method Summary
 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)
           
 
Methods inherited from class atg.service.email.examiner.EmailExaminerImpl
getAdditionalHeaderPrefixes, getAdditionalHeaders, getEmailTrackingTools, getMTAName, getOriginalMessageID, getSoftBounceEnhancedStatusCodes, getSoftBounceReplyCodes, getTrackingData, isExtractOriginalMessageIDFromMessageText, isScanningContentForAdditionalHeaders, isSoftBouncedEmail, setAdditionalHeaderPrefixes, setEmailTrackingTools, setExtractOriginalMessageIDFromMessageText, setMTAName, setScanningContentForAdditionalHeaders, setSoftBounceEnhancedStatusCodes, setSoftBounceReplyCodes
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, doStartService, doStopService, getAbsoluteName, getAdminServlet, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, 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, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version string


mMTAIdentifierHeaderValueRegExPattern

protected java.util.regex.Pattern mMTAIdentifierHeaderValueRegExPattern

mBouncedEmailAddressRegExPattern

protected java.util.regex.Pattern mBouncedEmailAddressRegExPattern

mBouncedReplyCodeRegExPattern

protected java.util.regex.Pattern mBouncedReplyCodeRegExPattern

mBouncedErrorMessageRegExPattern

protected java.util.regex.Pattern mBouncedErrorMessageRegExPattern

mBouncedEnhancedStatusCodeRegExPattern

protected java.util.regex.Pattern mBouncedEnhancedStatusCodeRegExPattern

mMonitoredBounceReplyCodes

protected java.lang.String[] mMonitoredBounceReplyCodes
A list of reply codes that indicate a message is bounced


mMTAIdentifierHeaderKey

protected java.lang.String mMTAIdentifierHeaderKey

mMTAIdentifierHeaderValueRegEx

protected java.lang.String mMTAIdentifierHeaderValueRegEx

mMTAIdentifierHeaderValueRegExGroupIndex

protected int mMTAIdentifierHeaderValueRegExGroupIndex

mBouncedEmailAddressRegEx

protected java.lang.String mBouncedEmailAddressRegEx

mBouncedEmailAddressRegExGroupIndex

protected int mBouncedEmailAddressRegExGroupIndex

mBouncedReplyCodeRegEx

protected java.lang.String mBouncedReplyCodeRegEx

mBouncedReplyCodeRegExGroupIndex

protected int mBouncedReplyCodeRegExGroupIndex

mBouncedErrorMessageRegEx

protected java.lang.String mBouncedErrorMessageRegEx

mBouncedErrorMessageRegExGroupIndex

protected int mBouncedErrorMessageRegExGroupIndex

mBouncedEnhancedStatusCodeRegEx

protected java.lang.String mBouncedEnhancedStatusCodeRegEx

mBouncedEnhancedStatusCodeRegExGroupIndex

protected int mBouncedEnhancedStatusCodeRegExGroupIndex
Constructor Detail

RegExEmailExaminer

public RegExEmailExaminer()
Method Detail

setMonitoredBounceReplyCodes

public void setMonitoredBounceReplyCodes(java.lang.String[] pMonitoredBounceReplyCodes)
Sets the MonitoredBounceReplyCodes property

Parameters:
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 property

getMonitoredBounceReplyCodes

public java.lang.String[] getMonitoredBounceReplyCodes()
Gets the MonitoredReplyCodes property

Returns:
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 property

getMTAIdentifierHeaderKey

public java.lang.String getMTAIdentifierHeaderKey()
The name of the header that can be used to identify the MTA

Returns:
The header to use when determining the MTA

setMTAIdentifierHeaderKey

public void setMTAIdentifierHeaderKey(java.lang.String pMTAIdentifierHeaderKey)
The name of the header that can be used to identify the MTA

Parameters:
pMTAIdentifierHeaderKey - The name of the header.

getMTAIdentifierHeaderValueRegEx

public java.lang.String getMTAIdentifierHeaderValueRegEx()
A RegEx used to match against the value of the MTA Identifier header. A match using this RegEx indicates that this Examiner is responsible for handling the given message.

Returns:
The RegEx string.

setMTAIdentifierHeaderValueRegEx

public void setMTAIdentifierHeaderValueRegEx(java.lang.String pMTAIdentifierHeaderValueRegEx)
A RegEx used to match against the value of the MTA Identifier header. A match using this RegEx indicates that this Examiner is responsible for handling the given message.

Parameters:
pMTAIdentifierHeaderValueRegEx - The RegEx string to use.

getMTAIdentifierHeaderValueRegExPattern

public java.util.regex.Pattern getMTAIdentifierHeaderValueRegExPattern()
Returns the compiled RegEx pattern defined by getMTAIdentifierHeaderValueRegEx()

Returns:
The pattern.

getMTAIdentifierHeaderValueRegExGroupIndex

public 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.

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.

Returns:
The group index
See Also:
Matcher.group(int)

setMTAIdentifierHeaderValueRegExGroupIndex

public void setMTAIdentifierHeaderValueRegExGroupIndex(int pMTAIdentifierHeaderValueRegExGroupIndex)

getBouncedEmailAddressRegEx

public java.lang.String getBouncedEmailAddressRegEx()
A reg-ex used to extract the bounced email's intended recipient's email address.

Returns:
The reg-ex

setBouncedEmailAddressRegEx

public void setBouncedEmailAddressRegEx(java.lang.String pBouncedEmailAddressRegEx)
A reg-ex used to extract the bounced email's intended recipient's email address.

Parameters:
pBouncedEmailAddressRegEx - The reg-ex.

getBouncedEmailAddressRegExPattern

public java.util.regex.Pattern getBouncedEmailAddressRegExPattern()
Returns the compiled RegEx pattern defined by getBouncedEmailAddressRegEx()

Returns:
The pattern.

getBouncedEmailAddressRegExGroupIndex

public 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.

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.

Returns:
The group index
See Also:
Matcher.group(int)

setBouncedEmailAddressRegExGroupIndex

public void setBouncedEmailAddressRegExGroupIndex(int pBouncedEmailAddressRegExGroupIndex)

getBouncedReplyCodeRegEx

public java.lang.String getBouncedReplyCodeRegEx()
A reg-ex used to extract the bounced email's reply code.

Returns:
The reg-ex

setBouncedReplyCodeRegEx

public void setBouncedReplyCodeRegEx(java.lang.String pBouncedReplyCodeRegEx)
A reg-ex used to extract the bounced email's reply code

Parameters:
pBouncedReplyCodeRegEx - The reg-ex.

getBouncedReplyCodeRegExPattern

public java.util.regex.Pattern getBouncedReplyCodeRegExPattern()
Returns the compiled RegEx pattern defined by getBouncedReplyCodeRegEx()

Returns:
The pattern.

getBouncedReplyCodeRegExGroupIndex

public 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.

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.

Returns:
The group index
See Also:
Matcher.group(int)

setBouncedReplyCodeRegExGroupIndex

public void setBouncedReplyCodeRegExGroupIndex(int pBouncedReplyCodeRegExGroupIndex)

getBouncedErrorMessageRegEx

public java.lang.String getBouncedErrorMessageRegEx()
A reg-ex used to extract the bounced email's error message.

Returns:
The reg-ex

setBouncedErrorMessageRegEx

public void setBouncedErrorMessageRegEx(java.lang.String pBouncedErrorMessageRegEx)
A reg-ex used to extract the bounced email's error message

Parameters:
pBouncedErrorMessageRegEx - The reg-ex.

getBouncedErrorMessageRegExPattern

public java.util.regex.Pattern getBouncedErrorMessageRegExPattern()
Returns the compiled RegEx pattern defined by getBouncedErrorMessageRegEx()

Returns:
The pattern.

getBouncedErrorMessageRegExGroupIndex

public 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.

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.

Returns:
The group index
See Also:
Matcher.group(int)

setBouncedErrorMessageRegExGroupIndex

public void setBouncedErrorMessageRegExGroupIndex(int pBouncedErrorMessageRegExGroupIndex)

getBouncedEnhancedStatusCodeRegEx

public java.lang.String getBouncedEnhancedStatusCodeRegEx()
A reg-ex used to extract the bounced email's enhanced status code.

Returns:
The reg-ex

setBouncedEnhancedStatusCodeRegEx

public void setBouncedEnhancedStatusCodeRegEx(java.lang.String pBouncedEnhancedStatusCodeRegEx)
A reg-ex used to extract the bounced email's enhanced status code.

Parameters:
pBouncedEnhancedStatusCodeRegEx - The reg-ex.

getBouncedEnhancedStatusCodeRegExPattern

public java.util.regex.Pattern getBouncedEnhancedStatusCodeRegExPattern()
Returns the compiled RegEx pattern defined by getBouncedEnhancedStatusCodeRegEx()

Returns:
The pattern.

getBouncedEnhancedStatusCodeRegExGroupIndex

public 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.

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.

Returns:
The group index
See Also:
Matcher.group(int)

setBouncedEnhancedStatusCodeRegExGroupIndex

public void setBouncedEnhancedStatusCodeRegExGroupIndex(int pBouncedEnhancedStatusCodeRegExGroupIndex)

isBouncedEmail

public boolean isBouncedEmail(javax.mail.Message pMessage)
                       throws javax.mail.MessagingException,
                              EmailException
Determines whether the passed in message was bounced by the MTA this examiner is responsible for. This is determined by first checking for the MTA Identifier header. If the MTA Identifier header is present, and the intended recipient can be parsed from the message body, then this method will return true.

Parameters:
pMessage - the message to examine
Returns:
true if the message is in the correct format for this MTA and is bounced. False if the message is in the correct format for this MTA and is not bounced, or is not in the correct format for this MTA.
Throws:
javax.mail.MessagingException - if a problem occurs while calling methods on the pMessage object
EmailException - if a problem occurs during the parsing of the content, of invalid arguments are specified

getBouncedEmailAddress

public java.lang.String getBouncedEmailAddress(javax.mail.Message pMessage)
                                        throws javax.mail.MessagingException,
                                               EmailException
This method gets the email address from a presumed bounced email in the correct format for this MTA. This implementation looks for the address in a specific location in the email's content based on the getBouncedEmailAddressRegEx() reg-ex pattern.

Parameters:
pMessage - the message to examine
Returns:
the email address of the intended recipient, or null if the message is not bounced, or is not in the correct format for this MTA
Throws:
javax.mail.MessagingException - if a problem occurs while calling methods on the pMessage object
EmailException - if a problem occurs during the parsing of the content, of invalid arguments are specified

getBouncedReplyCode

public java.lang.String getBouncedReplyCode(javax.mail.Message pMessage)
                                     throws javax.mail.MessagingException,
                                            EmailException
Gets the reply code (RFC 821) of the given bounced message. This implementation looks for the address in a specific location in the email's content based on the getBouncedReplyCodeRegEx() reg-ex pattern.

Parameters:
pMessage - the bounced message to examine
Returns:
the reply code of the bounced email, indicating why it was bounced, or null if the message cannot be determined from the give pMessage i.e. the formatting is not what was expected, or the message has not been determined as bounced
Throws:
javax.mail.MessagingException - if a problem occurs while calling methods on the pMessage object
EmailException - 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.

getBouncedErrorMessage

public java.lang.String getBouncedErrorMessage(javax.mail.Message pMessage)
                                        throws javax.mail.MessagingException,
                                               EmailException
This method gets any associated error message that is given from a bounced email. This implementation looks for the address in a specific location in the email's content based on the getBouncedErrorMessageRegEx() reg-ex pattern.

Parameters:
pMessage - the message to examine
Returns:
the error message that indicates why the email was bounced or null if the email is not in the correct format for this MTA, or if there is no error message to get
Throws:
javax.mail.MessagingException - if a problem occurs while calling methods on the pMessage object
EmailException - if a problem occurs during the parsing of the content, of invalid arguments are specified

getBouncedEnhancedStatusCode

public java.lang.String getBouncedEnhancedStatusCode(javax.mail.Message pMessage)
                                              throws javax.mail.MessagingException,
                                                     EmailException
Gets the enhanced status code according to RFC 1893 that gives more detail on the nature of the error. This implementation looks for the address in a specific location in the email's content based on the getBouncedEnhancedStatusCodeRegEx() reg-ex pattern.

Parameters:
pMessage - the message to examine
Returns:
an enhanced status code of the bounced email, indicating why it was bounced, or null if the given message is not in the correct format for this MTA
Throws:
javax.mail.MessagingException - if a problem occurs while calling methods on the pMessage object
EmailException - if a problem occurs during the parsing of the content, of invalid arguments are specified

examineEmail

public java.lang.Object examineEmail(javax.mail.Message pMessage)
                              throws javax.mail.MessagingException,
                                     EmailException
This method examines the given message in some implementation specific manner. This implementation is a no-op

Parameters:
pMessage - the message to examine
Returns:
null
Throws:
javax.mail.MessagingException - if a problem occurs while calling methods on the pMessage object
EmailException - if a problem occurs during the parsing of the content, of invalid arguments are specified

getBouncedEmailAddress

protected java.lang.String getBouncedEmailAddress(java.lang.String pContent)
This method gets any associated error message that is given from a bounced email. This implementation looks for the address in a specific location in the email's content based on the getBouncedEmailAddressRegEx() reg-ex pattern.

Parameters:
pContent - the content to examine
Returns:
the error message that indicates why the email was bounced or null if the email is not in the correct format for this MTA, or if there is no error message to get

getBouncedReplyCode

protected java.lang.String getBouncedReplyCode(java.lang.String pContent)
Gets the reply code (RFC 821) of the given bounced message. This implementation looks for the address in a specific location in the email's content based on the getBouncedReplyCodeRegEx() reg-ex pattern.

Parameters:
pConte - the bounced content to examine
Returns:
the reply code of the bounced email, indicating why it was bounced, or null if the message cannot be determined from the give pMessage i.e. the formatting is not what was expected, or the message has not been determined as bounced

getBouncedEnhancedStatusCode

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. This implementation looks for the address in a specific location in the email's content based on the getBouncedEnhancedStatusCodeRegEx() reg-ex pattern.

Parameters:
pContent - the content to examine
Returns:
an enhanced status code of the bounced email, indicating why it was bounced, or null if the given message is not in the correct format for this MTA

getBouncedErrorMessage

protected java.lang.String getBouncedErrorMessage(java.lang.String pContent)
This method gets any associated error message that is given from a bounced email. This implementation looks for the address in a specific location in the email's content based on the getBouncedErrorMessageRegEx() reg-ex pattern.

Parameters:
pContent - the content to examine
Returns:
the error message that indicates why the email was bounced or null if the email is not in the correct format for this MTA, or if there is no error message to get

findMatch

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. 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.

Parameters:
pPattern - A pattern to match with
pSequence - A character sequence to look for a match.
pGroupIndex -