Elastix Voicemail to Email not working
I was trying to configure my Elastix voicemail to send voicemail on Email. but the email was not being delivered to the my email address. I had configured properly my remote SMTP under mail configuration. I was able to send email from my elastix mail system and emails was being delivered to my email address.
But Voice mail was not being delivered to users email address.
I started troubleshooting I checked the log
tail -f /var/log/maillog
I found below error message
Apr 16 01:29:26 localhost postfix/qmgr[1820]: 6B600C90A91: from=<asterisk@pockw.localdomain>, size=813, nrcpt=1 (queue active)
Apr 16 01:29:49 localhost postfix/smtp[1937]: 6B600C90A91: to=<gkhanin@outlook.com>, relay=gkhan.in[173.254.220.66]:25, delay=23, delays=0.02/0.01/22/0.33, dsn=5.0.0, status=bounced (host gkhan.in[173.254.220.66] said: 550-Verification failed for <asterisk@pockw.localdomain> 550-The mail server could not deliver mail to asterisk@pockw.localdomain. The account or domain may not exist, they may be blacklisted, or missing the proper dns entries. 550 Sender verify failed (in reply to RCPT TO command))
Apr 16 01:29:49 localhost postfix/cleanup[1934]: 7537CC90A92: message-id=<20160415222949.7537CC90A92@pockw.localdomain>
Apr 16 01:29:49 localhost postfix/qmgr[1820]: 7537CC90A92: from=<>, size=3184, nrcpt=1 (queue active)
Apr 16 01:29:49 localhost postfix/bounce[1939]: 6B600C90A91: sender non-delivery notification: 7537CC90A92
The problem was asterisk@pockw.localdomain which was sending voicemail to email it was not a proper email address and it was not being resolved by the DNS server as pockw.localdomain was my server host name .
I found below article
http://community.freepbx.org/t/change-from-email-for-voicemails/15735/3
As it says
in freepbx gui set serveremail in voicemail admin > settings to noreply@mydomainname.com
Above point I did not find in freepbx setting so I left that. and followed the next point.
edited /etc/postfix/main.cf
a. uncommented mydomain paramater in INTERNET HOST AND DOMAIN NAMES section
b. set mydomain = mydomainname.com
service postfix restart
accounts set to email voicemails as attachments are now receiving emails from noreply@mydomainname.com
Is it a bug that the postfix setting has to be manually changed?
Thats work for me it just changed the sender email address from asterisk@pockw.localdomain to asterisk@pockw.gkhan.in but still mail was not being delivered.
Now I was getting below messge.
Apr 16 02:18:24 localhost postfix/cleanup[2354]: 143F1C90A91: message-id=<Asterisk-6-1160313698-111-2974@pockw>
Apr 16 02:18:24 localhost postfix/qmgr[2228]: 143F1C90A91: from=<asterisk@pockw.gkhan.in>, size=55680, nrcpt=1 (queue active)
Apr 16 02:18:46 localhost postfix/smtp[2357]: 143F1C90A91: to=<gkhanin@outlook.com>, relay=gkhan.in[173.254.220.66]:25, delay=23, delays=0.03/0.01/22/0.35, dsn=5.0.0, status=bounced (host gkhan.in[173.254.220.66] said: 550-Verification failed for <asterisk@pockw.gkhan.in> 550-No Such User Here 550 Sender verify failed (in reply to RCPT TO command))
Apr 16 02:18:47 localhost postfix/cleanup[2354]: 37D98C90A92: message-id=<20160415231847.37D98C90A92@pockw.gkhan.in>
Apr 16 02:18:47 localhost postfix/qmgr[2228]: 37D98C90A92: from=<>, size=2515, nrcpt=1 (queue active)
Apr 16 02:18:47 localhost postfix/bounce[2359]: 143F1C90A91: sender non-delivery notification: 37D98C90A92
Apr
To resolve the issue I did the following .
I created a sub domain pockw.gkhan.in and created a mx record pointed to gkhan.in mx record and created a email id user under pockw.gkhan.in as asterisk@pockw.gkhan.in .
Note :- All above i did it on my Domain Cpanel .
Now the mails was being delivered successfully.
Apr 16 20:34:56 localhost postfix/cleanup[7935]: 66C17C90A91: message-id=<Asterisk-9-1233714121-111-2974@pockw>
Apr 16 20:34:56 localhost postfix/qmgr[2228]: 66C17C90A91: from=<asterisk@pockw.gkhan.in>, size=72822, nrcpt=1 (queue active)
Apr 16 20:35:21 localhost postfix/smtp[7938]: 66C17C90A91: to=<gkhanin@outlook.com>, relay=gkhan.in[173.254.220.66]:25, delay=25, delays=0.03/0.01/23/2.1, dsn=2.0.0, status=sent (250 OK id=1arU7o-0003I6-4t)
Apr 16 20:35:21 localhost postfix/qmgr[2228]: 66C17C90A91: removed
Now It was working fine and voicemail was being delivered to users email address.
I got good solution from below link on comment of Billsion . postfix-masquerade.
http://community.freepbx.org/t/solved-asterisk-does-not-respect-email-from-settings/9513
you can masquerade the sender email address to the real one which you want .which will accepted by the you SMTP server .
http://www.cyberciti.biz/tips/howto-postfix-masquerade-change-email-mail-address.html
Postfix MTA offers smtp_generic_maps parameter. You can specify lookup tables that replace local mail addresses by valid Internet addresses when mail leaves the machine via SMTP.
Open your main.cf file
# vi /etc/postfix/main.cf
Append following parameter
smtp_generic_maps = hash:/etc/postfix/generic
Save and close the file. Open /etc/postfix/generic file:
# vi /etc/postfix/generic
Make sure tom-01@server01.hosting.com change to tom@domain.com
tom-01@server01.hosting.com tom@domain.com
Save and close the file. Create or update generic postfix table:
# postmap /etc/postfix/generic
Restart postfix:
# /etc/init.d/postfix restart
When mail is sent to a remote host via SMTP this replaces tom-01@server01.hosting.com by tom@domain.com mail address. You can use this trick to replace address with your ISP address if you are connected via local SMTP.
I check with my PBX its working fine.