Need Help With Issues Using Postfix Generic Rewrite

(Urbnsr) #1

I have been following along with this Wiki: to send messages out into the real world. I still can’t get it to rewrite the FROM address. In my Postfix generic file I have different variations:


After editing generic, I run postmap /etc/postfix/generic and restart Postfix. After sending a test email from the CL using mail from the asterisk user, maillog indicates a failure and that the FROM address is: asterisk@freepbx.localdomain. I also have smtp_generic_maps = hash:/etc/postfix/generic at the end of my file.

If I edit generic to only have the line:


…then I can see in maillog that the FROM address is: This fails also since I don’t have an outside email account named “asterisk”, but indicates to me that the generic rewriting is working somewhat. I also have the same problem emailing incoming faxes even though I have the fax address rewrite in the generic file.

What the heck am I missing?

(Dave Burgess) #2

Are you escaping the @ signs? Seems to me PostFix is particular about that sometimes.

(Urbnsr) #3

I am not. I will try it. Although I don’t remember seeing anything about it on Postfix online docs, either.

(Dave Burgess) #4

There are two places where not escaping the @ can mess with you. I think PostFix is usually pretty good about it, but remember that we are running all of this through a system written in PHP, which is horrific when it comes to working with @ signs.

(Urbnsr) #5

I tried to escape the @ symbol, but no change in testing. The initial testing is from the command line using mail. And, to retest (with and without escaping the @ symbol, only having “@freepbx.localdomain” in the generic file and postfix attempts to rewrite it using the proper domain name: root@freepbx.localdomain becomes and asterisk@freepbx.localdomain becomes

(system) closed #6

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.