Asterisk - Send voicemail to email as client SMTP address

I'm able to setup Elastix (Asterisk) to send email voicemail attachments without any issue. But I'm trying to email them to a particular external address and it seems to be rejecting the emails as they are coming from [email protected]

I have an SMTP address I can validate through ([email protected]) but I cannot seem to find a way to make Elastix send emails as a client.

Is there a way to do this?


Solution 1:

You can force your mail server to rewrite the sender address. On postfix, this can be done this way:

  1. Add your domain as mydomain on postfix main.cf and enable generic maps in postfix main.cf:

postconf -e 'mydomain = example.com'

postconf -e 'smtp_generic_maps = hash:/etc/postfix/generic'

  1. Put the rewrite rule in /etc/postfix/generic:

    [email protected] [email protected]

  2. Run postmap: postmap /etc/postfix/generic

  3. Reload postfix: postfix reload