Function | canonicalise_line_endings | Canonicalise the line endings to 'rn'. |
Class | InvalidSignature | The signature failed to validate. |
Class | InactiveAccount | The account for the person sending this email is inactive. |
Function | authenticateEmail | Authenticates an email by verifying the PGP signature. |
Function | extract_addresses | Extract the domain the mail was sent to. |
Function | report_oops | Record an OOPS for the current exception and return the OOPS ID. |
Function | handleMail | Undocumented |
Function | handle_one_mail | Process one message. |
Function | _isDkimDomainTrusted | Undocumented |
Function | _verifyDkimOrigin | Find a From or Sender address for which there's a DKIM signature. |
Function | _getPrincipalByDkim | Determine the security principal from DKIM, if possible. |
Function | _gpgAuthenticateEmail | Check GPG signature. |
Function | _send_email_oops | Handle an error that generates an oops. |
Canonicalise the line endings to 'rn'.
>>> canonicalise_line_endings('\n\nfoo\nbar\rbaz\r\n') '\r\n\r\nfoo\r\nbar\r\nbaz\r\n'
>>> canonicalise_line_endings('\r\rfoo\r\nbar\rbaz\n') '\r\n\r\nfoo\r\nbar\r\nbaz\r\n'
>>> canonicalise_line_endings('\r\nfoo\r\nbar\nbaz\r') '\r\nfoo\r\nbar\r\nbaz\r\n'
Find a From or Sender address for which there's a DKIM signature. :returns: A string email address for the trusted sender, if there is one, otherwise None. :param signed_message: ISignedMessage
Determine the security principal from DKIM, if possible.
Returns | (None, None), or (principal, trusted_addr). |
The mail is expected to be an ISignedMessage.
If this completes, it will set the current security principal to be the message sender.
Parameters | signature_timestamp_checker | This callable is passed the message signature timestamp, and it can raise an exception if it dislikes it (for example as a replay attack.) This parameter is intended for use in tests. If None, ensure_sane_signature_timestamp is used. |
Parameters | principal | Claimed sender of the mail; to be checked against the actual signature. |
Returns | principal, either strongly or weakly authenticated. |
Mails sent to Launchpad should have an X-Launchpad-Original-To header. This is added by the MTA before it ends up the mailbox for Launchpad.