angelos.facade.api.mailbox

Facade mail API.

class angelos.facade.api.mailbox.MailboxAPI(facade: angelos.facade.facade.Facade)

Bases: angelos.facade.facade.ApiFacadeExtension

An interface class to be placed on the facade.

ATTRIBUTE = ('mailbox',)
PATH_CACHE = (PurePosixPath('/cache/msg'),)
PATH_DRAFT = (PurePosixPath('/messages/drafts'),)
PATH_INBOX = (PurePosixPath('/messages/inbox'),)
PATH_OUTBOX = (PurePosixPath('/messages/outbox'),)
PATH_READ = (PurePosixPath('/messages/read'),)
PATH_SENT = (PurePosixPath('/messages/sent'),)
PATH_TRASH = (PurePosixPath('/messages/trash'),)
SUFFIX_CHACHED = '.cmsg'
SUFFIX_ENVELOPE = '.env'
SUFFIX_MAIL = '.msg'
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.

load_drafts() → Set[uuid.UUID]

Load read folder from the messages store.

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

Load specific envelope from the inbox.

load_inbox() → Set[uuid.UUID]

Load envelopes from the inbox.

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

Load specific message from the read folder.

load_outbox() → Set[uuid.UUID]

Load letters from outbox folder.

load_read() → Set[uuid.UUID]

Load read folder from the messages store.

load_sent() → Set[uuid.UUID]

Load read folder from the messages store.

load_trash() → Set[uuid.UUID]

Load read folder from the messages store.

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.

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.

remove_draft(message_id: uuid.UUID)

Remove a mail from the draft folder.

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

Save a message to draft folder for archiving.

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

Save a message to outbox folder to be sent.

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

Save a message as read in the read message folder.

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

Save a message to sent folder for archiving.

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.