I have configured postfix + dovecot as per this guide: http://neranjara.org/article/title/How_to_configure_PostFix_and_Dovecot_for_Virtual_Users_with_out_a_Database_ I used virtual users option. Everything works great.

Now I'd like to configure a specific email address to forward all emails to another address but to retain a copy of email in the original mailbox.

How do I achieve this?

link|improve this question
feedback

2 Answers

up vote 2 down vote accepted

You can use the option recipient_bcc_maps to have mails to some recipients cloned and sent via BCC to another email address.

link|improve this answer
This works, thank you. A follow-up question, though. I have this in my main.cf "virtual_mailbox_maps = hash:/etc/postfix/vmailbox" and then "@domain.com domain.com/catchall/" in my vmailbox. This catchall destination can't be forwarded using the recipient_bcc_maps method. Is there any way I got these forwarded too? – zespri Nov 1 '10 at 8:25
Sure, that's completely possible. Just write @example.com in the table referred in recipient_bcc_maps instead of a complete email address. Also see the documentation for recipient_bcc_maps. – joschi Nov 1 '10 at 8:56
But won't this forward all emails, not catch all only? – zespri Nov 1 '10 at 9:07
It will send a copy of all emails to *@example.com to the recipient you've configured. – joschi Nov 1 '10 at 9:25
Yeah, this is not exactly what I want. Let's assume I have bob@example.com, john@example.com and jim@example.com. I don't want their email to be forwarded. I only want to forward emails that end up in catchall@example.com, which is all email sent to the domain but that doesn't match any of existing addresses. I don't want to repeat all the existing addresses in recipient_bcc_map to avoid duplication of information. – zespri Nov 1 '10 at 9:34
feedback

Use the always_bcc setting in Postfix main.cf (see http://www.postfix.org/postconf.5.html).

Either use joschis version or create some type of alias.

Alias originalname@example.org => user1@example.org, user@example.org

link|improve this answer
This going to forward email for all email address isn't it? Or am I reading this wrong? I need to forward mail from one particular address only. – zespri Nov 1 '10 at 8:06
You're right, I skipped the word "specific". Modified my answer. – weeheavy Nov 1 '10 at 8:20
feedback

Your Answer

 
or
required, but never shown

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