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

Can I set up a virtual domain on one box so that a few specific email addresses get forwarded to gmail, and everything else (using a wildcard) goes to another system I control? For example, can I put in /etc/postfix/virtual

me@xcski.com me@gmail.com
my_wife@xcski.com m_wife@gmail.com
*@xcski.com *@home.xcski.com
share|improve this question

2 Answers 2

up vote 4 down vote accepted

You can do this for a wildcard:

@xcski.com @home.xcski.com

(ie. what you had without the asterisks). From the VIRTUAL(5) documentation:

# RESULT ADDRESS REWRITING
#        The lookup result is subject to address rewriting:
#        
#        o      When  the  result  has  the  form @otherdomain, the
#               result becomes the same user in otherdomain.   This
#               works only for the first address in a multi-address
#               lookup result.
share|improve this answer
    
The problem with the catch-all approach is that it'll unfortunately also forward all the emails that are sent to random usernames at that specific domain. IME 99% of those emails are spam... –  Timo Geusch May 7 '09 at 16:38

Yes, but wildcard rewriting defeats address validation. The usual disclaimers about catchall addresses apply in that case.

The usual advice, if you have a list of known/valid addresses, is to let the computer do the work for you and generate /etc/postfix/virtual from your database of known addresses (or use a database maptype). Make(1) is your friend.

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.