Method Summary |
|
final protected boolean | fromAddressSameAsReverse(Mail mail) Utility method that checks if there is at least one address in the "From:" header
same as the reverse-path.
Parameters: mail - The mail to check. |
abstract protected String[] | getAllowedInitParameters() Gets the expected init parameters. |
public String | getExplanationText() Getter for property explanationText. |
protected KeyHolder | getKeyHolder() Getter for property keyHolder. |
final protected String | getMessageHeaders(MimeMessage message) Utility method for obtaining a string representation of the Message's headers
Parameters: message - The message to extract the headers from. |
final protected String | getReplacedExplanationText(String explanationText, String signerName, String signerAddress, String reversePath, String headers) Prepares the explanation text making substitutions in the explanationText template string.
Utility method that searches for all occurrences of some pattern strings
and substitute them with the appropriate params.
Parameters: explanationText - The template string for the explanation text. Parameters: signerName - The string that will replace the [signerName] pattern. Parameters: signerAddress - The string that will replace the [signerAddress] pattern. Parameters: reversePath - The string that will replace the [reversePath] pattern. Parameters: headers - The string that will replace the [headers] pattern. |
public String | getSignerName() Getter for property signerName. |
abstract protected MimeBodyPart | getWrapperBodyPart(Mail mail) Creates the
javax.mail.internet.MimeBodyPart that will be signed.
For example, may attach a text file explaining the meaning of the signature,
or an XML file containing information that can be checked by other MTAs.
Parameters: mail - The mail to massage. |
public void | init() Mailet initialization routine. |
protected void | initDebug() Initializer for property debug. |
protected void | initExplanationText() Initializer for property explanationText. |
protected void | initKeyHolder() Initializer for property keyHolder. |
protected void | initPostmasterSigns() Initializer for property postmasterSigns. |
protected void | initRebuildFrom() Initializer for property rebuildFrom. |
protected void | initSignerName() Initializer for property signerName. |
public boolean | isDebug() Getter for property debug. |
protected boolean | isOkToSign(Mail mail) Checks if the mail can be signed.
Rules:
- The reverse-path != null (it is not a bounce).
- The sender user must have been SMTP authenticated.
- Either:
- The reverse-path is the postmaster address and
SMIMEAbstractSign.isPostmasterSigns returns true
- or the reverse-path == the authenticated user
and there is at least one "From:" address == reverse-path.
.
- The message has not already been signed (mimeType != multipart/signed
and != application/pkcs7-mime).
Parameters: mail - The mail object to check. |
public boolean | isPostmasterSigns() Getter for property postmasterSigns. |
public boolean | isRebuildFrom() Getter for property rebuildFrom.
If true will modify the "From:" header.
The modification is as follows:
assuming that the signer mail address in the signer certificate is trusted-server@xxx.com>
and that From: "John Smith"
we will get From: "John Smith" " <trusted-server@xxx.com>.
If the "ReplyTo:" header is missing or empty it will be set to the original "From:" header.
Such modification is necessary to achieve a correct behaviour
with some mail clients (e.g. |
public void | service(Mail mail) |
public void | setDebug(boolean debug) Setter for property debug. |
public void | setExplanationText(String explanationText) Setter for property explanationText. |
protected void | setKeyHolder(KeyHolder keyHolder) Setter for property keyHolder. |
public void | setPostmasterSigns(boolean postmasterSigns) Setter for property postmasterSigns. |
public void | setRebuildFrom(boolean rebuildFrom) Setter for property rebuildFrom. |
public void | setSignerName(String signerName) Setter for property signerName. |