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

2 Answers
2

(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.

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 GeuschMay 7 '09 at 16:38

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.