
mbhangui at gmail
Jun 29, 2010, 1:09 AM
Post #1 of 1
(356 views)
Permalink
|
|
Rule based archival for netqmail
|
|
Recently someone asked me to develop an archival scheme for IndiMail at http://www.indimail.org as part of implementing compliance to standards like SOX, etc. This scheme allows unique archival destination email address for each recipient or sender. You can also use another domain for the archival and hence have the archival emails going to a totally different server. It was easy for me to change the code for netqmail and make it available at http://sourceforge.net/projects/indimail/files/netqmail-addons/mailarchive The patch modifies qmail-queue and the man page for qmail-queue DESCRIPTION ============ if the control file mailarchive exists, its content can be used for rule based archival. type:regexp:dest_mailbox where type is F or T. If type is F, rule is appled on the sender. If type is T, the rule is applied on the recipient. type can be omitted to match all recipients. regexp is an expression to match the address (sender or recipient as specfied by type) and dest_mailbox is a valid email address. regexp can be omitted to match any address. A % in dest_mailbox followed by u, d or e gets replaced as below %u - user component in address without the ’@’ sign %d - domain component in address %e - email address e.g. T:user1 [at] example:%u [at] indimail will add user1 [at] indimail to qmail-queue's recipient list when a mail is addressed to user1 [at] example As stated above, the address used for matching regexp is the sender in case type is F. For bounces, you can use <> to match a null sender. e.g. F:<>:bounce_archive [at] example When a rule matches a sender or any one of the recipients, the dest_mailbox address after expansion will be added to the existing recipient list. When a rule matches multiple recipients, only one email address will be added to recipient list to avoid duplicates. The below will make a copy all mails for domain yourdomain to archyourdomain ::%u [at] arc%d DISCLAIMER. I offer no warranty for the code. If you find bugs, report it to me and I shall be happy to fix it. Note: The code is also part of a gigantic patch to qmail (which is essentially the MTA component of IndiMail platform) https://sourceforge.net/projects/indimail/files/Patches/qmail-1.03.patch.gz/download -- Regards Manvendra - http://www.indimail.org
|