HOWTO: Voicemail to email with Postfix and SBC / ATT as your ISP
I have SBCGlobal as my ISP and have had a heck of a time getting voicemail to email on my Trixbox (2.2.4) to work. And even after I did, it stopped working a few months ago after SBC/ATT seemed to ramp up their restrictions/security. So I'm going to share what I've done to get it working.
First off, if you haven't already done so, you need to install Postfix so that Trixbox uses this instead. Kerry Garrison has written a wiki page for this:
http://www.trixbox.org/wiki/replacing-sendmail-postfix
Note: Make sure you follow the instructions for the entire wiki page because if SBC/ATT is your ISP, then you NEED to use SMTP Authentication.
The next thing you should do is install webmin if you don't have it already - it makes configuring postfix (and other components of your server) a little easier - at least it did for me. So if you don't have it, just issue the following command via the command line:
yum -y install webmin
Or I believe you can install it via the package manager.
Next you can point your browser to: http://ipaddressofyourtrixbox:10000 and log in as root, and the password you've set up for it (it being root). Once logged in, click on the 'Servers' link on the left, then on 'Postfix Mail Server' which should appear in the list under 'Servers'. Now on the main part of the page, choose 'General Options'. Here, you want to make a few changes:
What domain to use in outbound mail: choose the 3rd radio option/button, and enter sbcglobal.net into the text field.
Send outgoing mail via host: choose the 2nd radio option/button, and enter [smtp.sbc.mail.yahoo4.akadns.net] into the text field...if it isn't already in there.
Internet hostname of this mail system: choose the 2nd option, and enter asterisk1.sbcglobal.net. This is assuming your Trixbox is named asterisk1...which it is by default...mine is.
Local internet domain name: sbcglobal.net.
Go ahead and click on the 'Save and apply' button at the bottom to save your changes, then click on "Return to Postfix configuration" (if it didn't take you to the main Postfix page) which is below the aforementioned button.
Now back at the main screen of Postfix, click on the 'Address Rewriting and Masquerading' button/link. And now we're going to make one change:
Address masquerading: choose the 2nd radio option/button, and enter sbcglobal.net .
Hit 'Save and Apply' here.
Next we need to do some user mapping. What you need to do next is edit the /etc/postfix/generic file. And you're going to want to add the following lines to the very end of the file:
asterisk@asterisk.local *****@sbcglobal.net
asterisk@sbcglobal.net *****@sbcglobal.net
You'll need to replace *****@sbcglobal.net with your actual username (i.e. joecool@sbcglobal.net) that you're using to log in with for both lines. And depending on how your machine is configured, you may not want to put the lines exactly the way I have it here - your hosts file could say something different. After you do this, save the file, and then issue the command:
postmap /etc/postfix/generic
Now we'll need to edit Postfix's main config file, main.cf. To do this, get back to the main Postfix Mail Server configuration page, click on the 'Edit Config Files' button/link. On this page, make sure that /etc/postfix/main.cf is selected in the drop-down box. Then in the main window, scroll all the way to the bottom of the file. Add the following line to the bottom:
smtp_generic_maps = hash:/etc/postfix/generic
Click 'Save' to save this new line.
Ok, let's do one last Postfix check now. Get to the main.cf file for Postfix by following the instructions I just gave above. You're looking for some lines like mine:
myhostname = asterisk1.sbcglobal.net
mydomain = sbcglobal.net
myorigin = sbcglobal.net
masquerade_domains = sbcglobal.net
smtp_generic_maps = hash:/etc/postfix/generic
Now if you have all of these lines, then great. If you're missing a line, you should add it, save it, and then Stop/Start Postfix. You can stop Postfix by going back to the main Postfix screen, and clicking on the 'Stop' button at the very bottom. Then when the page reloads, you can click on the 'Start' button.
Just a note, your lines might differ slightly from mine if you used your own info, that's ok.
Next go ahead and go into 'Config Edit' back in the Trixbox configuration area, from the 'Asterisk' pull-down menu. Click on the vm_general.inc file and look for the following line:
serveremail=vm@trixbox.dyndns.org (or something like that anyway)
I changed mine to match what I have in the /etc/postfix/generic file from above. So *****@sbcglobal.net...but again, replace that with what you're really using. And I'm not even really sure if this is a necessary step or not, but it works for me, so it should work for you. But if you do change this, don't forget to hit the 'Update' button, and then click on the 'Re-read configs' link at the top-left.
The only other thing that I've done to get my voicemail to email working with SBCGlobal is I edited my /etc/hosts file. Mine looks like this:
127.0.0.1 localhost
127.0.0.1 sbcglobal.net asterisk1.local
I'm actually not sure if this is absolutely necessary...I guess you could try to see if the voicemail to email works for you, and if it doesn't, then try that.
Well, if you followed all my instructions, then your Trixbox should be able to send out voicemail notifications if you have Postfix and ATT/SBC as your ISP.
Many thanks to Kerry Garrison for his instructions on replacing sendmail with Postfix, to all of the people who helped me along the way to get it to work (and to get it working again) and thank you to the entire Trixbox community.
