bonzo.errors – SMTP exceptions for response to the client

SMTP exceptions for response to the client.

exception bonzo.errors.BadArguments(syntax)[source]

Bases: bonzo.errors.SMTPError

Used to return a 501 status code.

Parameters:syntax (string) – Syntax returned to the client.
exception bonzo.errors.BadSequence(message)[source]

Bases: bonzo.errors.SMTPError

Used to return a 503 status code.

Parameters:message (string) – Message to be written to the stream and to response to the client.
exception bonzo.errors.InternalConfusion[source]

Bases: bonzo.errors.SMTPError

Used to return a 451 status code.

exception bonzo.errors.NotImplementedCommand(command)[source]

Bases: bonzo.errors.SMTPError

Used to return a 502 status code.

Parameters:command (string) – Command not implemented for the server.
exception bonzo.errors.SMTPError(status_code, message, log_message=None, *args)[source]

Bases: exceptions.Exception

An exception that will turn into an SMTP error response.

Parameters:
  • status_code (int) – SMTP status code. For a status codes list, see: http://www.greenend.org.uk/rjk/tech/smtpreplies.html.
  • message (string) – Message to be written to the stream in order to response to the client.
  • log_message (string) – Message to be written to the log for this error. May contain %s-style placeholders, which will be filled in with remaining positional parameters.
exception bonzo.errors.UnrecognisedCommand[source]

Bases: bonzo.errors.SMTPError

Used to return a 500 status code.