I am going through the motions of setting up FreePBX to send emails properly within our corporate email server, in
/etc/postfix/main.cf I’ve defined
relayhost = [mail.domain.tld]:587 and at the bottom of the file appended:
smtp_sasl_auth_enable = yes smtp_sasl_maps = hash:/etc/postfix/sasl_password smtp_sasl_security_options = smtp_tls_security_level = encrypt
note that the final line about tls security level was added by me after I encountered errors relating to the postfix client not sending starttls commands properly, and getting its authentication rejected by the mail server.
After allowing the server to settle for a little while, and deal with its backlog of mail sitting in the queue, I checked in my
/var/log/maillog file, and noticed many of the following:
Recipient address rejected: Policy rejection due to null sender (in reply to RCPT TO command))
which seemed to co-inside with not having a sender line in the error file at all, all the emails seem to be associated with being sent to “email@example.com”, oddly enough, considering I don’t recall defining anywhere that any type of mail should be being sent to firstname.lastname@example.org, however, that is the address used for SMTP authentication, and is the address all emails from FreePBX should be originating from.
Doing some further testing, I tried using the email a copy of voicemail function on my extension, I setup my email for the extension, and left myself a voicemail, in my maillog file, I saw the following:
from=<Asterisk-3-#######@hostname> to=<user.email@domain> ... Recipient address rejected: Sender is not same as SMTP authenticate username (in reply to RCPT TO command))
Note that I’ve omitted some lines from the above pieces for sake of convenient copy, but the concept is all there, its attempting to send from asterisk(numberSequence)@systemHostname, when it should be sending from email@example.com, I have additionally confirmed in the file
/etc/asterisk/voicemail.conf that the changes made in the webGUI to the email config are being reflected properly in this file.
Looking over my configuration, under
System Admin > Notifications Settings the following is true:
From Address = firstname.lastname@example.org Storage Notifications = email@example.com Intrusion Detection Notifications = firstname.lastname@example.org
Settings > Voicemail Admin > Setttings > Email Config the option
Server Email is set to
At this point, my goal is to have all mail from FreePBX come FROM email@example.com, I will note that the intrusion detection emails from fail2ban are being sent properly from firstname.lastname@example.org and being received by email@example.com as expected, and as configured, it seems to be that something else in my system is trying to send emails with no sender, to the address listed as should be sender, while voicemail tries to send from its own email address entirely outside of my postfix scope.
Suggestions on how I can rectify this?