MoinMoin.mail package

Submodules

MoinMoin.mail.sendmail module

MoinMoin - email helper functions

MoinMoin.mail.sendmail.decodeSpamSafeEmail(address)[source]

Decode obfuscated email address to standard email address

Decode a spam-safe email address in address by applying the following rules:

Known all-uppercase words and their translation:
“DOT” -> ”.” “AT” -> “@” “DASH” -> “-“

Any unknown all-uppercase words or an uppercase letter simply get stripped. Use that to make it even harder for spam bots!

Blanks (spaces) simply get stripped.

Parameters:address – obfuscated email address string
Return type:string
Returns:decoded email address
MoinMoin.mail.sendmail.encodeAddress(address, charset)[source]

Encode email address to enable non ascii names

E.g. ‘“Jürgen Hermann” <jh@web.de>’. According to the RFC, the name part should be encoded, the address should not.

Parameters:
  • address (unicode) – email address, possibly using ‘“name” <address>’ format
  • charset (email.Charset.Charset instance) – specifying both the charset and the encoding, e.g quoted printable or base64.
Return type:

string

Returns:

encoded address

MoinMoin.mail.sendmail.encodeSpamSafeEmail(email_address, obfuscation_text='')[source]

Encodes a standard email address to an obfuscated address

Parameters:
  • email_address

    mail address to encode. Known characters and their all-uppercase words translation:

    "." -> " DOT "
    "@" -> " AT "
    "-" -> " DASH "
    
  • obfuscation_text – optional text to obfuscate the email. All characters in the string must be alphabetic and they will be added in uppercase.
MoinMoin.mail.sendmail.sendmail(subject, text, to=None, cc=None, bcc=None, mail_from=None, html=None)[source]

Create and send a text/plain message

Return a tuple of success or error indicator and message.

Parameters:
  • subject (unicode) – subject of email
  • text (unicode) – email body text
  • to (list) – recipients
  • cc (list) – recipients (CC)
  • bcc (list) – recipients (BCC)
  • mail_from (unicode) – override default mail_from
  • html (unicode) – html email body text
Return type:

tuple

Returns:

(is_ok, Description of error or OK message)

Module contents

MoinMoin - Package Initialization

Subpackage containing e-mail support code.