Mar 04
作者: 肖建彬 | 可以转载, 转载时务必以超链接形式标明文章原始出处和作者信息及版权声明
网址:http://www.xiaojb.com/archives/mailtech/postfix_archive.shtml

Wietse Venema wrote:

This is a preliminary mail archive design that could be implemented
with little code. It fixes the following limitations of the always_bcc
and sender/recipient_bcc_maps features:

- No bounce is sent to the sender. The archive copy has a completely
different sender address.

- The archive copy contains a complete copy of the message envelope
(sender and recipient) addresses.

Preliminary design:

- As mail is received by Postfix, the cleanup server adds a "must
archive" record to the Postfix queue file when archival is requested
via main.cf, master.cf, or as an action in access(5) or
header/body_checks(5) tables:

 main.cf:
     archive = username@example.com

 access, header/body_checks:
     pattern   ARCHIVE username@example.com

 master.cf:
     smtpd ... -o archive=username@example.com

- In the queue manager, before deleting the queue file, check if
the message has a "must archive" record. If so, send the queue name,
queue ID, and archive recipient address to the archive daemon.  The
archive daemon does its job in the background and notifies the queue
manager when it is done. The queue manager deletes the queue file
only when the archive daemon reports success.

- The archive daemon creates a new "archive copy" message in the
form of a bounce-like MIME message. This archive copy has a section
with the sender and recipient addresses, and a segment with the
original message as a message/rfc822 attachment.  The sender of
this archive copy is the null sender; perhaps it is useful to
specify an alternate sender address instead.

- Postfix then delivers the archive copy in the usual manner, just
like it delivers other mail. Paranoid sites might route mail for the
archive recipient via a special delivery agent that does not bounce
on failure, with "-o soft_bounce=yes".

Refinements:

- It would be nice if the archive copy can distinguish between
"delivered" and "failed" deliveries. This would require that Postfix
uses a new "this recipient is bounced" record type, in addition
to the already existing "this recipient is done" record type.

- With after-queue content filtering, Postfix should deliver only
one archive copy: either the archive copy should be made before
the content filter, or after the content filter.

- Just like header/body_checks, no archival should happen when mail
is forwarded within Postfix.

       Wietse

备份邮件更灵活了~

Comments are closed.