Home | Comics | Gallery | (Amazon| ThinkGeek) wishlist | Donations | Impressum | The Book of Postfix | Postfix - Einrichtung, Betrieb und Wartung | Blog
# bcc addresses are in internal form (de-quoted).
if !/@bcc\.invalid$/
/^(.*)/ ${1}@bcc.invalid
endif
note: if/endif is only supported in Postfix 2.2 or later --
with Postfix 2.1 you'd have to use:
# bcc addresses are in internal form (de-quoted).
/^(.*@your\.domain)/ ${1}@bcc.invalid
In main.cf add:
recipient_bcc_maps = pcre:/etc/postfix/backup_bcc.pcreThen route the "@bcc.invalid" mail to a suitable transport (e.g. virtual). To do that, add in main.cf:
virtual_mailbox_domains = bcc.invalid virtual_mailbox_base = /home/bcc # mailbox base for our archive virtual_mailbox_maps = $default_database_type:/etc/postfix/vmbox # map all addresses in bcc.invalid to a single mailbox virtual_uid_maps = static:1000 virtual_gid_maps = static:1000 # uid:gid for our archiveIn /etc/postfix/vmbox you have:
backup@bcc.invalid Maildir/or, if you want to use an mbox instead of a Maildir, use:
backup@bcc.invalid mboxwith no traling slash!
# sometimes we clean /home/bcc
5 1 * * * /usr/bin/find /home/bcc/20??-??-?? -depth -type d -ctime +28 -exec rm -rf {} \;
# we rotate /home/bcc daily
59 23 * * * rotate_it
rotate_it being a little script:
#!/bin/sh mkdir /home/bcc/Maildir.new chown 1000:1000 /home/bcc/Maildir.new chmod 700 /home/bcc/Maildir.new mv /home/bcc/Maildir /home/bcc/`/bin/date -I` && mv /home/bcc/Maildir.new /home/bcc/Maildir
That's it.
This file was last modified 17. Jan 2007 by root