Tell me more ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a server that hosts a java application that is allowed to send out emails. During testing I want postfix to send all outgoing email to test-javaapp@my-company.com, however email that sent to sysadmin@my-company.com needs to be left alone.

Basicly:

  • sysadmin@my-company.com --> sysadmin@my-company.com
  • *@* --> test-javaapp@my-company.com
share|improve this question

2 Answers

up vote 1 down vote accepted

You can use canonical maps as specified in Postfix documentation here and here.

share|improve this answer

You can use generic maps as described in the Postfix documentation here. If you need other address rewriting rules this document also provides the necessary steps.

share|improve this answer
Can you give an example on what to write in /etc/postfix/generic to acieve my goal? Specificly I would like to know how to handle wildcards. – Nifle Sep 19 '11 at 14:15
I see nothing in the documentation about wildcards, that's why I asked. And if you don't want to help, that's fine but I see NO reason for you to be rude. I hope you had fun on my behalf and I also hope this isn't how people asking questions are generally treated here on serverfault. – Nifle Sep 19 '11 at 15:41
@Nifle What about the third line? @localdomain.local hisaccount+local@hisisp.example – mailq Sep 19 '11 at 16:06
I must be stupid. I can't see how @localdomain.local would match for example foo.bar@foobar.com and dick.tracy@comicbook.old. – Nifle Sep 19 '11 at 16:10
That's right. It matches *@localdomain.local. If you want to match *@*.* then this is not possible. Postfix is a RFC compliant server. – mailq Sep 19 '11 at 16:15
show 1 more comment

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.