From email address in voicemail.conf doesn't work

I’m not sure if it’s a bug or a feature. Anyway. I’m using Amazon SES for email relay. And they require verified sender address to be in “from” field.

On my server I have postfix configured as email client.

In voicemail.conf I have:

serveremail=verifiedsender@mydomain.net fromstring=Asterisk PBX

However, sendmail fails because Asterisk supplies “asteriskpbx@localhost.localdomain” as “From” adress. My Asterisk runs as asteriskpbx user, thats why. But what exactly this setting in config file accomplishes?

I did fix it, but via aliasing on postfix side. However, I don’t like this solution and rather have Asterisk supply proper sender value if possible…

Do you mean From: or envelope From. I suspect that Asterisk only sets the From: header, but the validation is on envelope From.

Hi katit!

I’m not sure, but this pages might help you!

Forcing the from address when postfix relays over smtp:
http://serverfault.com/questions/147921/forcing-the-from-address-when-postfix-relays-over-smtp
or
Postfix Address Rewriting:
postfix.org/ADDRESS_REWRITING_README.html

I think you need some sort of masquerading/address rewriting!

Virtually yours // Nypon

David,

Yes, it’s probably envelope.

Nypon,

I got it fixed on postfix side by replacing individual email senders with needed one. Your link provides more general solution with regex, I just created maps and mapped each email I want to rewrite.

So far I have only seen 1 package that can substitute “From:” properly - logrotate. Other 2 packages I setup email with (Asteriks and Fail2ban) have same issue of not substituting it.