FreePBX – Voicemails aren’t sending to Emails

We encountered a problem on our Asterisk/FreePBX system where voicemail emails weren’t being delivered.

After digging around in the logs, I found errors resembling this: ( /var/log/maillog )

Apr 25 13:03:35 localhost postfix/smtp[27048]: 8788E1A0B8C0: to=,[]:587, delay=1.4, delays=0.03/0.02/1.4/0, dsn=5.7.1, status=bounced (SASL authentication failed; server[] said: 535-5.7.1 Username and Password not accepted. Learn more at?535 5.7.1 - gsmtp)

I was unsure why this was happening, nothing changed on our end.

It seemed google had an open relay, and either by default, or previous administrator, an outdated FreePBX system I was working on was configured to use as a relay for all email. It looks like google shut down this open relay, so a user+password was required. where previously it wasn’t.

After searching the postfix configs, I came across and found the line that said “relayhost =” and commented it out with a hash (#).

A quick # service postfix restart and emails were coming through again.

I wrote a quick script to send off all of the mails that were already there.

email.php – script to email old voicemails to an email address.
Copy this file to /var/spool/asterisk/voicemail/device/{EXTN}/INBOX folder, modify the config variables and run.

View this file in browser: FreePBX Voicemail to Email Sender
Update! This file is now working, sincere apologize to anyone who previously tried to access this file 🙁

Tagged with: , ,
Posted in Troubleshooting

Leave a Reply

Your email address will not be published. Required fields are marked *