l.s.m.i.m.IMessageSet(Interface) : interface documentation

Part of lp.services.messages.interfaces.message View In Hierarchy

Set of IMessage
Method get Return a list of IMessage's with the given rfc822msgid.
Method fromText Construct a Message from a text string and return it.
Method fromEmail Construct a Message from an email message and return it.
def get(rfc822msgid):
Return a list of IMessage's with the given rfc822msgid.

If no such messages exist, raise NotFoundError.

def fromText(subject, content, owner=None, datecreated=None, rfc822msgid=None):
Construct a Message from a text string and return it.
def fromEmail(email_message, owner=None, filealias=None, parsed_message=None, fallback_parent=None, date_created=None, restricted=False):

Construct a Message from an email message and return it.

Callers may want to explicitly handle the following exceptions:
  • UnknownSender
  • MissingSubject
  • DuplicateMessageId
  • InvalidEmailMessage
Parametersemail_messageThe original email as a string.
ownerSpecifies the owner of the new Message. The default is calculated using the From: or Reply-To: headers, and will raise a UnknownSender error if they cannot be found.
filealiasThe LibraryFileAlias of the raw email if it has already been uploaded to the Librarian.
parsed_messageAn email.message.Message instance. If given, it is used internally instead of building one from the raw email_message. This is purely an optimization step, significant in many places because the emails we are handling may contain huge attachments and we should avoid reparsing them if possible.
fallback_parentThe parent message if it could not be identified.
date_createdForce a created date for the message. If specified, the value in the Date field in the passed message will be ignored.
restrictedIf set, the LibraryFileAlias will be uploaded to the restricted librarian.
API Documentation for Launchpad, generated by pydoctor at 2022-06-16 00:00:12.