Provides central depot for incoming mail for use by applications.
repoze.postoffice provides a centralized depot for collecting incoming email for consumption by multiple applications. Incoming mail is sorted into queues according to rules with the expectation that each application will then consume its own queue. Each queue is a first-in-first-out (FIFO) queue, so messages are processed in the order received.
ZODB is used for storage and is also used to provide the client interface. repoze.postoffice clients create a ZODB connection and manipulate models. This makes consuming the message queue in the context of a transaction, relatively simple.
Please see docs/index.rst for the complete documentation.
- Introduce the ‘find_queue’ function as an alternative to ‘open_queue’ for applications that will manage their own database connection.
- Avoid throttling BCC’ed messages (those where X-Original-To is not present in To or CC), because they can’t be part of loops.
- Accept messages as non-duplicates which have the same Message-ID headers, but different X-Original-To headers. Rationale: on systems which add X-Original-To (postfix adds it by default), its presence indicates delivery to a separate user; we should allow it to be queued for attempted processing.
- Enable configuration of the headers considred by the to_hostname filter.
- Update the headers considered by in the to_hostname filter to include X-Original-To by default. This header is set by Postfix to match the envelope recipient; including it allows matching messages for which the domain is BCC’ed or delivered from a mailing list.
- Avoid erroring while logging messages with encoded header values E.g., some clients don’t escape non-ASCII in To: / From: / Subject: headers. See LP #1202770.
- Handle broken addresses in ToHostName filter more gracefully.
- Converted documentation to Sphinx.
- Moved repository to Github.
- Make regexp filters case sensitive.
- Only close databases we create ourselves in open_queue.
- Allow calling application to provide an already open database to open_queue. (LP #985546)
- Added graceful degeneration when provided with uknown character encoding in a MIME text part.
- Added a header, ‘X-Postoffice-Date’, to queued messages. It records the time each message was received (as seconds since the epoch.) It is set to the modified time of the maildir message file.
- Added better fault tolerance for insane date headers generated by spambots. (LP #697033)
- Body checks are now multiline regexp checks. (LP #787573)
- Fixed problem where the zodb_uri could be unicode, which eventually breaks the ZEO client for ZEO uris. zodb_uri is now converted to a UTF-8 string.
- Fixed problem with header filters not working properly with non-ASCII characters in headers. (LP #777455)
- Fixed bug in regular expression body filter which improperly parsed the ‘Content-Type’ header in order to extract the character set of a Mime part.
- Respect leading and trailing whitespace in rules files.
- When a message is rejected by a filter, a message is logged showing which filter triggered the rejection.
- Improved logging output now includes a timestamp.
- Worked around (probable) bug in stdlib email parser where a message part might have a charset set in the ‘Content-Type’ header, but message.get_charset() returns None.
- Added greater fault tolerance for malformed email addresses. (Shakes fist at spammers.)
- Added four new filter types based on regular expression matching: header_regexp, header_regexp_file, body_regexp, body_regexp_file. See README.txt for information on how to use these new filters.
- Added a new option to the global configuration: reject_filters. This allows you to set up filters at a global level for rejecting certain messages. See README.txt for more information.
- The ‘to_hostname’ filter now parses multiple email addresses and checks the ‘Cc’ header as well as the ‘To’ header. (LP #659243)
- If multiple incoming messages in a 24 hour period have the same Message-Id, they are presumed to be duplicates and all but the first are discarded. (LP #659243)
- Fixed another case where non-RFC 2047 compliant headers could cause an exception to be raised. (LP #637484)
- Added Queue.requeue_quarantined_messages() convenience method to API.
- Allow for multiple hosts in ‘to_hostname’ filter. (LP #614528)
- Added graceful degradation for non-RFC 2047 compliant headers, in order to avoid crashing when spambots send us malformed messages. (LP #637484)
- Added ‘X-Postoffice: Bounced’ header to outgoing bounce and quarantine messages. The presence of this header is checked when importing messages and any messages which contain it are discarded. This is to prevent possible ricochets of bounce messages back into the system. (LP #612587)
- Incoming messages with a ‘From’ header which matches exactly its ‘To’ header are now discarded as probable spam. (LP #612588)
- Fixed bug in processing body of bounce messages when non-ascii unicode characters are present.
- Fixed divide by zero error when calculating instantaneous message frequency.
- Fixed bug in repoze.postoffice.queue.open_queue where a ZEO connection would be left open if there was a KeyError on the queue name.
- Fixed bug in parsing headers with no values.
- Added ability to use arbitrary message headers as discriminator values in out of office loop detection.
- When messages exceed maximum message size, are throttled or are found to be an auto-response, they are no longer discarded. Instead these messages get an ‘X-Postoffice-Rejected’ header added where the value gives the reason for rejection. These messages are then consumable by clients in the normal way. It is up to the client to detect the ‘X-Postoffice-Rejected’ header and take appropriate action. This change was made to allow the client to determine what, if any, sort of bounce message should be generated if any of these conditions are true.
- Initial Release.