FreePBX 2.8 not sending emails, but command line does send emails

I’m using AsteriskNOW 1.7.1 with FreePBX 2.8 (updated with the latest modules using module admin).

I’m trying to get e-mail notifications working from within FreePBX. I can send emails from the command line, but FreePBX doesn’t send e-mails out. I’ve read every guide I could find on the topic, including the PIAF guides, Trixbox guides, and everything I could find here, and can’t see what I else I can try.

So, far, I’ve done the following:

Removed sendmail and intalled Postfix

rpm -e --nodeps sendmail
yum install postfix
service postfix start

Edited by changing serveremail to an address @ a FQDN.
Edited hosts to add FQDN

Restarted the network and asterisk:
service network restart
amportal restart

I’m able to send myself a message from the command line using the following syntax:

echo “test” | mail -s testmessage [email protected]

Those messages come through just fine, and so I assume postfix and anything else I need is present. Also, it doesn’t appear that my ISP is blocking port 25.

However, when I set-up an extension in FreePBX with an e-mail address to forward voicemails, the e-mails are not sent. I’ve reviewed the asterisk logs, and they make no mention of any attempts to send e-mails. Also, if I tell FreePBX to attach the .wav files and to delete the messages upon sending, and then leave a test voicemail, the messages are deleted after I leave them, and so I infer that FreePBX belives that it is sending the messages.

Any thoughts?

See if /var/log/maillog has any clues for you.

Make sure the sending party’s email (your asterisk server) is a valid one.

Also, try changing the format of VMs to gsm, some may block wav attachments.

If all fails, try this.

  1. edit /etc/asterisk/voicemail.conf
  2. Look for mailcmd (probably will be commented out)
  3. mailcmd=/usr/sbin/sendmail -v -t -f [email protected] (or a postfix equivalent command to force a sender’s email).

Where is the same email domain of your mail server.

Don;t reload Freepbx via gui instead do a;
asterisk -rx “reload”

And of course, as mentioned by mrgoblin /var/log/… is your best chance of seeing the transactions, not in …/asterisk logs…

Thanks to both of you for responding.

It turns out that postfix isn’t starting on boot. If I do everything above, and type service postfix start, everything seems to work until I need to reboot.

I’ve tried

chkconfig postfix on

But, when I reboot, postfix is off again. I know there’s something simple that I’m missing here. How do I configure postfix to load at boot?

Okay, I’ve figured it out.

After I rebooted, the maillog file (without the .1 at the end) appeared again and indicated a problem with “localhost.” I went back and checked my hosts file and found that when I modified hosts to add, I inadvertently removed the pointer from to localhost. Added that back in, rebooted, and now postfix starts during boot. Yay!

Thanks again to everyone who contributed ideas.