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 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?

share|improve this question

2 Answers 2

up vote 3 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.

share|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

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

share|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

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.