Class | IncomingEmailError | Indicates that something went wrong processing the mail. |
Function | get_main_body | Returns the first text part of the email. |
Function | guess_bugtask | Guess which bug task the person intended to edit. |
Function | reformat_wiki_text | Transform moin formatted raw text to readable text. |
Function | parse_commands | Extract indented commands from email body. |
Function | get_error_message | Returns the error message that's in the given filename. |
Function | get_person_or_team | Get the Person from the vocabulary. |
Function | ensure_not_weakly_authenticated | Make sure that the current principal is not weakly authenticated. |
Function | ensure_sane_signature_timestamp | Ensure the signature was generated recently but not in the future. |
Function | save_mail_to_librarian | Save the message to the librarian. |
Function | get_email_template | Returns the email template with the given file name. |
Function | get_contact_email_addresses | Return a set of email addresses to contact this Person. |
Return None if no bug task could be guessed.
All commands must be indented using either spaces or tabs. They must be listed in command_names -- if not, they are silently ignored.
The special command 'done' terminates processing. It takes no arguments. Any commands that follow it will be ignored. 'done' should not be listed in command_names.
While this syntax is the Launchpad standard, bug #29572 says it should be changed to only accept commands at the beginning and to not require indentation.
A list of (command, args) tuples is returned.
If the error message requires some parameters, those are given in interpolation_items.
The files are searched for in lib/lp/services/mail/errortemplates.
Person
from the vocabulary.Raises | EmailProcessingError if person not found. |
NB: While handling an email, the authentication state is stored partly in properties of the message object, and partly in the current security principal. As a consequence this function will only work correctly if the message has just been passed through authenticateEmail -- you can't give it an arbitrary message object.
If the timestamp is wrong, the message is rejected rather than just treated as untrusted, so that the user gets a chance to understand the problem. Therefore, this raises an error rather than returning a value.
Parameters | context | Short user-readable description of the place the problem occurred. |
Raises | IncomingEmailError | if the timestamp is stale or implausible, containing a message based on the context and template. |
It can be referenced from errors, and also accessed by code that needs to get back the exact original form.