angelos.lib.api.mailbox

Facade mail API.

class angelos.lib.api.mailbox.MailboxAPI(facade: angelos.lib.facade.base.BaseFacade)

Bases: angelos.lib.api.api.ApiFacadeExtension

An interface class to be placed on the facade.

ATTRIBUTE = ('mailbox',)
PATH_CACHE = ('/cache/msg',)
PATH_DRAFT = ('/messages/drafts',)
PATH_INBOX = ('/messages/inbox',)
PATH_OUTBOX = ('/messages/outbox',)
PATH_READ = ('/messages/read',)
PATH_SENT = ('/messages/sent',)
PATH_TRASH = ('/messages/trash',)
empty_trash()

Returns:

get_draft(message_id: uuid.UUID) → Union[angelos.document.messages.Note, angelos.document.messages.Instant, angelos.document.messages.Mail, angelos.document.messages.Share, angelos.document.messages.Report]
Parameters

message_id

Returns:

get_info_draft(message_id: uuid.UUID) → Tuple[bool, uuid.UUID, str, str, uuid.UUID, int]
Parameters

message_id

Returns:

get_info_inbox(envelope_id: uuid.UUID) → Tuple[bool, uuid.UUID, str, datetime.datetime, bool, bool, bool]
Parameters

envelope_id

Returns:

get_info_outbox(envelope_id: uuid.UUID) → Tuple[bool, uuid.UUID, str, datetime.datetime]
Parameters

envelope_id

Returns:

get_info_read(message_id: uuid.UUID) → Tuple[bool, uuid.UUID, str, str, datetime.datetime, uuid.UUID, int]
Parameters

message_id

Returns:

get_info_sent(message_id: uuid.UUID) → Tuple[bool, uuid.UUID, str, str, datetime.datetime, uuid.UUID, int]
Parameters

message_id

Returns:

get_info_trash(message_id: uuid.UUID) → Tuple[bool, uuid.UUID, str, str, datetime.datetime, uuid.UUID, int]
Parameters

message_id

Returns:

get_read(message_id: uuid.UUID) → Union[angelos.document.messages.Note, angelos.document.messages.Instant, angelos.document.messages.Mail, angelos.document.messages.Share, angelos.document.messages.Report]
Parameters

message_id

Returns:

get_sent(message_id: uuid.UUID) → Union[angelos.document.messages.Note, angelos.document.messages.Instant, angelos.document.messages.Mail, angelos.document.messages.Share, angelos.document.messages.Report]
Parameters

message_id

Returns:

get_trash(message_id: uuid.UUID) → Union[angelos.document.messages.Note, angelos.document.messages.Instant, angelos.document.messages.Mail, angelos.document.messages.Share, angelos.document.messages.Report]
Parameters

message_id

Returns:

import_envelope(envelope: angelos.document.envelope.Envelope)

Imports an envelope to inbox.

Parameters

envelope

Returns:

load_drafts() → Set[uuid.UUID]

Load read folder from the messages store.

Returns:

load_envelope(envelope_id: uuid.UUID)angelos.document.envelope.Envelope

Load specific envelope from the inbox.

Parameters

envelope_id

Returns:

load_inbox() → Set[uuid.UUID]

Load envelopes from the inbox.

Returns:

load_message(message_id: uuid.UUID)angelos.document.messages.Mail

Load specific message from the read folder.

Parameters

message_id

Returns:

load_outbox() → Set[uuid.UUID]

Load letters from outbox folder.

Returns:

load_read() → Set[uuid.UUID]

Load read folder from the messages store.

Returns:

load_sent() → Set[uuid.UUID]

Load read folder from the messages store.

Returns:

load_trash() → Set[uuid.UUID]

Load read folder from the messages store.

Returns:

mail_to_inbox(envelopes: angelos.document.envelope.Envelope) -> (<class 'bool'>, typing.Set[angelos.document.envelope.Envelope], <class 'bool'>)

Import envelope to inbox. Check owner and then validate.

Parameters

envelopes

Returns:

move_trash(message_id: uuid.UUID)
Parameters

message_id

Returns:

open_envelope(envelope_id: uuid.UUID) → Union[angelos.document.messages.Note, angelos.document.messages.Instant, angelos.document.messages.Mail, angelos.document.messages.Share, angelos.document.messages.Report]

Open an envelope and verify its content according to policies.

Parameters

envelope_id (uuid.UUID) – The envelope filename within the inbox folder.

Returns (MessageT):

Verified message document

remove_draft(message_id: uuid.UUID)

Remove a mail from the draft folder.

Parameters

message_id (uuid.UUID) – The message ID of the draft.

Returns:

save_draft(draft: angelos.document.messages.Mail, subject: unicode, body: unicode, reply: uuid.UUID = None)

Save a message to draft folder for archiving.

Parameters
  • draft

  • subject

  • body

  • reply

Returns:

save_outbox(envelope: angelos.document.envelope.Envelope)

Save a message to outbox folder to be sent.

Parameters

envelope

Returns:

save_read(message: angelos.document.messages.Mail)

Save a message as read in the read message folder.

Parameters

message (Mail) – Message to be saved as read.

Returns:

save_sent(message: angelos.document.messages.Mail)

Save a message to sent folder for archiving.

Parameters

message

Returns:

send_mail(mail: angelos.document.messages.Mail, subject: unicode, body: unicode, recipient: uuid.UUID = None, reply: uuid.UUID = None)
Parameters
  • mail

  • subject

  • body

  • recipient

  • reply

Returns:

store_letter(envelope: angelos.document.envelope.Envelope, message: angelos.document.messages.Message)

Save a related envelope and message for later complaint.

The calling function is responsible for opening the envelope and applying the necessary policies.

Parameters

Returns: