Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Email configuration on dev server: At the moment I have postfix configured to route all emails sent to itself. So if you try to send and email to any address say it won't be delivered the that address, instead you would check the email locally at

This is the expected behaviour as we don't accidentally want to email thousands of users on our dev server.

We want to use git post-receive-email to notify the testers that a new commit have been deployed and is ready for testing. I have already set this part up but obviously is re-routed by postfix as explained above.

How can I create a type of whitelist email that will not conform to the rule above. Say if the to address is then it's sent to but if the email to address is anything else then it's routed to

The only special config I have is /etc/posfix/main.cnf and it contains

command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
myhostname =
mydomain =
myorigin = $mydomain
mydestination = localhost, localhost.localdomain, $myhostname, localhost.$mydomain, $mydomain
unknown_local_recipient_reject_code = 550
mynetworks_style = host
mynetworks =,
relay_domains = $mydestination
relayhost =
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
debug_peer_level = 2
debug_peer_list =, localhost
debugger_command =
     xxgdb $daemon_directory/$process_name $process_id & sleep 5
sendmail_path = /usr/sbin/sendmail.postfix
newaliases_path = /usr/bin/newaliases.postfix
mailq_path = /usr/bin/mailq.postfix
setgid_group = postdrop
html_directory = no
manpage_directory = /usr/share/man
sample_directory = /usr/share/doc/postfix-2.3.3/samples
readme_directory = /usr/share/doc/postfix-2.3.3/README_FILES
mailbox_size_limit = 0
always_bcc = archive@localhost
share|improve this question
You can use postfix alias maps and regexp , for example alias_maps = regexp:/etc/postfix/aliases /^$/ /^*$/ – Alan Kuras May 2 '13 at 8:16
How do you reroute your mails? – sebokopter May 2 '13 at 17:09
I have just updated question with more information – garethhallnz May 8 '13 at 2:54

A possible solution could be sender_dependent_default_transport_maps or sender_dependent_relayhost_maps. With more information about your configuration you would probably get more detailed help here.

share|improve this answer
I have just updated question with more information is that what you are after? – garethhallnz May 8 '13 at 2:56

Your Answer


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.