chapps.signals module

Signal handlers and custom exceptions

In order to shut down gracefully, we want to provide a signal handler when a service (handler) loop starts. Also, CHAPPS raises a few different custom exceptions, which are defined here.

class chapps.signals.SignalHandlerFactory[source]

Bases: object

A class for containing classmethods to create signal handlers

classmethod signal_handler(loop=None)[source]

Returns a signal-checking, exiting closure

Parameters

loopDeprecated

Return type

callable

Returns

a closure that looks for SIGTERM or SIGINT and raises SystemExit if it finds either one.

exception chapps.signals.CHAPPSException[source]

Bases: Exception

Parent class for CHAPPS exceptions

exception chapps.signals.CallableExhausted[source]

Bases: chapps.signals.CHAPPSException

A special exception for use during testing

exception chapps.signals.NotAnEmailAddressException[source]

Bases: chapps.signals.CHAPPSException

An email address contained no at-signs

exception chapps.signals.TooManyAtsException[source]

Bases: chapps.signals.CHAPPSException

An email address had too many at-signs in it

exception chapps.signals.ConfigurationError[source]

Bases: chapps.signals.CHAPPSException

There was an error in the setting of configuration elements

exception chapps.signals.OutboundPolicyException[source]

Bases: chapps.signals.CHAPPSException

Parent of exceptions which occur during outbound mail processing

exception chapps.signals.NullSenderException[source]

Bases: chapps.signals.OutboundPolicyException

No sender address exists in the current policy request

exception chapps.signals.AuthenticationFailureException[source]

Bases: chapps.signals.OutboundPolicyException

Lack of user-identifier being treated as authentication failure

exception chapps.signals.InboundPolicyException[source]

Bases: chapps.signals.CHAPPSException

Parent of exceptions arising during inbound email processing

exception chapps.signals.NoRecipientsException[source]

Bases: chapps.signals.InboundPolicyException

This is raised if the recipient field is somehow empty

exception chapps.signals.NoSuchDomainException[source]

Bases: chapps.signals.CHAPPSException

A domain operation was attempted against a nonexistent Domain

exception chapps.signals.HELOWLException[source]

Bases: chapps.signals.CHAPPSException

HELO Whitelisting exceptions

exception chapps.signals.AddressDoesNotMatchDNS[source]

Bases: chapps.signals.HELOWLException

A supplied IP address in the HELO Whitelist doesn’t match the A record

exception chapps.signals.NameDoesNotMatchPTR[source]

Bases: chapps.signals.HELOWLException

The IP address obtained for the HELO name has a PTR record which does not match the name supplied