Creating a backup of incoming mail

LuKreme kremels at kreme.com
Mon Sep 1 16:20:42 UTC 2014


On 01 Sep 2014, at 01:33 , Patrick De Zordo <patrick at spamreducer.eu> wrote:

> To backup all mail (incoming and outgoing), BCC all mails, you could do the following..
> 
> Add to your "/etc/postfix/main.cf" the following:
> ---8<-------------------------------------------------------------------------------------
> # Auto-Backup all mails
> transport_maps = hash:/etc/postfix/transport
> backuplmtp_destination_recipient_limit = 1
> lmtp_destination_recipient_limit = 1
> recipient_bcc_maps = pcre:/etc/postfix/backup_bcc.pcre
> sender_bcc_maps = pcre:/etc/postfix/backup_bcc.pcre
> ---8<-------------------------------------------------------------------------------------
> 
> Create a domain called "backup.local" in postfixadmin or whatever you use to edit your accounts..
> 
> Add every domain for which you like to activate incoming backup to " /etc/postfix/backup_bcc.pcre":
> ---8<-------------------------------------------------------------------------------------
> /^(.*)@spamreducer\.eu$/      spamreducer.eu at backup.local
> ---8<-------------------------------------------------------------------------------------
> 
> Add to your "/etc/postfix/master.cf" the following:
> ---8<-------------------------------------------------------------------------------------
> backuplmtp      unix  -       -       n       -       -       lmtp
> ---8<-------------------------------------------------------------------------------------
> 
> Add to your "/etc/postfix/transport" the following:
> ---8<-------------------------------------------------------------------------------------
> [backup.local] backuplmtp
> ---8<-------------------------------------------------------------------------------------
> 
> Don't forget to issue " postmap /etc/postfix/transport"..
> 
> For making folders based on "year/month" you have to use an appropriate sieve script.
> 
> Give me a feedback!

Wow, that is a whole lot more work that what I did with procmail which was practically one line in the /usr/locale/etc/procmailrc right at the top.

YER=`date %Y`
MON=`date %m`

:0c
/backup/mail/$YER/$MON/

I'll start with Sieve (though I still haven't used it) and see what that can do, but this at least I can do, if sieve proves too annoying to get going.

-- 
Granny Weatherwax didn't hold with looking at the future, but now she
could feel the future looking at her. She didn't like its expression at
all.



More information about the dovecot mailing list