Jump to >

reviewboard.notifications.email.backend

E-mail backend for Review Board.

New in version 4.0.4.

class SMTPConnectionMixin(*args, **kwargs)[source]

Bases: object

Mixin for tracking last replies when sending e-mail over SMTP.

New in version 4.0.4.

rb_last_reply

The last reply object. This contains the status code and reply details string.

Type:tuple
__init__(*args, **kwargs)[source]

Initialize the mixin.

Parameters:
  • *args (tuple) – Positional arguments for the SMTP backend.
  • **kwargs (dict) – Keyword arguments for the SMTP backend.
data(*args, **kwargs)[source]

Send message data over SMTP.

This will use the backend to send the data, and then store the last reply for further processing by EmailBackend.

Parameters:
  • *args (tuple) – Positional arguments for the underlying method.
  • **kwargs (dict) – Keyword arguments for the underlying method.
Returns:

The reply object. See rb_last_reply.

Return type:

tuple

class SMTPConnection(*args, **kwargs)[source]

Bases: reviewboard.notifications.email.backend.SMTPConnectionMixin, smtplib.SMTP

SMTP connection with last-response tracking.

New in version 4.0.4.

class SMTPSSLConnection(*args, **kwargs)[source]

Bases: reviewboard.notifications.email.backend.SMTPConnectionMixin, smtplib.SMTP_SSL

SMTP SSL connection with last-response tracking.

New in version 4.0.4.

class EmailBackend(*args, **kwargs)[source]

Bases: django.core.mail.backends.smtp.EmailBackend

Standard Review Board e-mail backend.

This is a specialization of Django’s e-mail backend that has enhanced support for mail services, Amazon SES in particular.

Amazon SES does not allow for custom Message IDs, and will return a generated Message ID as part of a 205 Ok responses (which is not a standard part of the SMTP specifications). This backend has the ability to capture that Message ID and reassign it back to the message being sent for storage.

Otherwise, the backend works exactly like the standard Django e-mail backend.

New in version 4.0.4.

SES_HOST_RE = <_sre.SRE_Pattern object>[source]
__init__(*args, **kwargs)[source]

Initialize the e-mail backend.

Parameters:
  • *args (tuple) – Positional arguments for the backend class.
  • **kwargs (dict) – Keyword arguments for the backend class.
connection_class[source]

The SMTP connection class to use for communication.

This will be a version with last-response tracking enabled.

Type:
type
is_ses[source]

Whether e-mail is being sent via Amazon SES.

Type:
bool
ses_message_id_domain[source]

The Amazon SES domain to use for a Message ID.

This cannot be called if is_ses is not True.

Type:
unicode