How to configure Email for voicemail

You must have SMP properly configured in order to receive voicemail to Email delivery. You can use system inbuilt SMTP or third party SMTP service. You can configure it using system admin module as well as in postfix. In this article I will show you how configure using postfix.

First make changes in main.cf
  • Login to your PBX using SSH
  • vim /etc/postfix/main.cf

At the bottom on page add these lines and save it.

relayhost = [mail.mailserver.com]:587
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_use_tls = yes
smtp_generic_maps = hash:/etc/postfix/generic

Next step is modify sasl_passwd file

vim /etc/postfix/sasl_passwd

[mail.demopbx.com]:587 smtpuser@demopbx.com:mypassword

Now add below lines at bottom of postfix generic

vim etc/postfix/generic

root emailfromaddress@demopbx.com 
root@localhost emailfromaddress@demopbx.com 
root@localhost.localdomain emailfromaddress@rdemopbx.com 
root@freepbx emailfromaddress@demopbx.com 
root@freepbx.localdomain emailfromaddress@demopbx.com 
asterisk emailfromaddress@demopbx.com 
asterisk@localhost emailfromaddress@demopbx.com 
asterisk@localhost.localdomain emailfromaddress@demopbx.com 
asterisk@freepbx emailfromaddress@demopbx.com 
asterisk@freepbx.localdomain emailfromaddress@demopbx.com
vm@asterisk emailfromaddress@demopbx.com

Final step is fix permissions on file and load new configurations in postfix

  • chmod 400 /etc/postfix/sasl_passwd
  • postmap hash:/etc/postfix/sasl_passwd
  • chown postfix /etc/postfix/sasl_passwd
  • /etc/init.d/postfix reload

Now your PBX is ready to send voicemails to your email address mentioned in extensions, You will also get module and system update notifications.

How to setup SMTP in Asterisk Free PBX