2

I have to copy a mail account's incoming and sent mails to another mail account on the same server as well. How can I do this?

The server is a debian wheezy running dovecot, roundcube and postfix. As I said the email isn't just an alias but an existing mailbox. The copying of the incoming mails can easily done with a sieve file in the user's profile:

01_forward.sieve

require ["fileinto"];
fileinto "Inbox";
redirect "[email protected]";

But as for getting a copy of every sent letters forwarded to [email protected] as well. I have no idea how to solve this.

2
  • are you using procmail? if not, you could use it to create a filter on all incoming and outgoing mail
    – RapidWebs
    Oct 10, 2014 at 15:09
  • This will be a postfix setting. Look at the virtual and aliases functions, you should be able to achieve what you desire.
    – Gene
    Oct 10, 2014 at 15:38

1 Answer 1

2

Postfix should be enough to this scenario. Check the sender_bcc_maps and recipient_bcc_maps feature. As documented, two parameters defines an mapping where copies of particular mail account handled by postfix are sent to.

Assuming that your mail account is [email protected] and you want to copy it to [email protected].

sender_bcc_maps = hash:/etc/postfix/special_user
recipient_bcc_maps = hash:/etc/postfix/special_user

In /etc/postfix/special_user add this line

[email protected]    [email protected]

Don't forget to postmap the map file and run postfix reload

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .