Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

i wanto to implement the following scenario:

we use a postfix mailserver. to archive all old and new mails, i want to setup a second postfix on our fileserver and create a single mailbox "archive". then every mail gets forwarded as bcc to this mailbox automatically. now, i want to create different folders in a maildir structure and let the server move each mail to the right subfolder of the mailbox based on its sender or receiver.

e.g. when we get a mail to one of our employees named "John Doe" at john.doe@foo.bar, the mail should be moved to "Inbox/John Doe Incoming". the same applies when john doe sends a mail, folder would be "Inbox/John Doe Outgoing".

how can i implement this filter behaviour. i heard of Procmail and Maildrop. Which of the two would you prefer? Which is more easy to configure? Any out-of-box solutions here?

thanks in advance!

share|improve this question

1 Answer 1

up vote 2 down vote accepted

Why not use sender_bcc_maps and recipient_bcc_maps to copy mail to a dedicated archive domain - say, archive.foo.bar - delivered via transport(5) to an MDA that stores archived mail in dedicated mailboxes?

No second instance needed, and clean solution all-round.

You can use a regex or PCRE map type to map al senders or recipients to mailboxes in the archive domain, e.g.:

/etc/postfix/sender-archive-pcre: /^(.*)@foo\.bar$/ $1-outbound@archive.foo.bar

/etc/postfix/recipient-archive-pcre: /^(.*)@foo\.bar$/ $1-inbound@archive.foo.bar

And in transport(5): @archive.foo.bar unix:your-archive-mda

As for which delivery agent to use: I very strongly suggest you use dovecot 2.x, either the deliver mda or the LMTP server; both have full sieve filter support with the pigeonhole plugin.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.