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.

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 gareth@example.com it won't be delivered the that address, instead you would check the email locally at archive@hostname.com.

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 gareth@example.com then it's sent to gareth@example.com but if the email to address is anything else then it's routed to archive@hostname.com

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

command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
myhostname = hostname.com
mydomain = hostname.com
myorigin = $mydomain
mydestination = localhost, localhost.localdomain, $myhostname, localhost.$mydomain, $mydomain
unknown_local_recipient_reject_code = 550
mynetworks_style = host
mynetworks = 127.0.0.0/28, 10.92.40.39/24
relay_domains = $mydestination
relayhost = 127.0.0.1
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
debug_peer_level = 2
debug_peer_list = 127.0.0.1, localhost
debugger_command =
     PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
     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
1  
You can use postfix alias maps and regexp , for example alias_maps = regexp:/etc/postfix/aliases /^gareth@example.com$/ gareth@example.com /^*@example.com$/ archive@hostname.com –  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

1 Answer 1

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

 
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.