sendmail-voicemail
Ok, so you've set up a system and you can't get mail to go out, probably because you've got no internal mail server.
------------------------------------------------------------------------------------------------------
If you do have an internal mail server you can use Webmin to setup Sendmail to use it very easily, this can also be used with outside mail servers that do NOT require authentication; otherwise skip this section and read on to use smtp auth:
yum install webmin
From another PC, login to webmin as root: https://trixbox.ip:10000
Go to Servers>Sendmail>Sendmail Options
and click the 2nd radio button where it says "Send outgoing mail via host", put your mail servers host name here.
------------------------------------------------------------------------------------------------------
There are a few ways around this, one way is to configure sendmail to use a smart host.
Edit /etc/mail/sendmail.mc
Find the following section:
dnl # Uncomment and edit the following line if your outgoing mail needs to dnl # be sent out through an external mail server: dnl # dnl define(`SMART_HOST', `smtp.your.provider')dnl
remove the dnl in front of the define:
define(`SMART_HOST', `smtp.your.provider')dnl
change smtp.your.provider to be your, you know, actual provider.
Save and exit.
NOTE:If your provider requires you to authenticate via smtp, you'll need to do a little more work. If you don't need to use smtp auth, skip to "Now BACK UP your existing sendmail.cf".
Go back into sendmail.mc and add the following line after the SMART_HOST define:
FEATURE(`authinfo',`hash -o /etc/mail/authinfo.db')dnl
Save and exit.
Now, we need to create authinfo:
Edit /etc/mail/authinfo and put in the following line:
AuthInfo: "U:someuser" "P:somepass" "M:PLAIN"
This should be self-explanitory. Replace someuser and somepass with your providers domain, your username and your password.
You may wish to use DIGEST-MD5 instead of PLAIN auth, so that your password isn't transmitted in cleartext. You are certainly encouraged to do so, but your provider may only accept PLAIN. The auth types are: LOGIN, PLAIN, DIGEST-MD5, and CRAM-MD5. Just replace PLAIN with one of those types, rerun the makemap command below and give it a shot. If it does't work, revert to PLAIN. (Outlook and Outlook Express -- and almost every other email client on the planet -- are set to transmit passwords as plain text by default.)
You have to create the hash:
makemap hash /etc/mail/authinfo < /etc/mail/authinfo
WARNING: This method has a serious drawback in that your password is stored in the plaintext file "authinfo." You can mitigate some of this risk by making sure only root can read the file, run:
chmod 660 /etc/mail/authinfo chmod 660 /etc/mail/authinfo.db
Now BACK UP your existing sendmail.cf:
cp /etc/mail/sendmail.cf /etc/mail/sendmail.cf.todaysdate
run m4 on the mc file:
m4 sendmail.mc > sendmail.cf
restart sendmail:
service sendmail restart
Now leave a voicemail, and it should work. If, for whatever reason, it doesn't, copy your old sendmail file back and you'll be where you started:
cp /etc/mail/sendmail.cf.todaysdate /etc/mail/sendmail.cf
When you are all done make sure to edit your /etc/asterisk/vm_general.inc and /etc/asterisk/vm_email.inc to properly reflect your network and mail server name. In /etc/asterisk/vm_general.inc edit the part that says:
serveremail=vm@(type your domain here)
In /etc/asterisk/vm_email.inc look for this:
Visit <a href="http://AMPWEBADDRESS/recordings/index.php" title="http://AMPWEBADDRESS/recordings/index.php">http://AMPWEBADDRESS/recordings/index.php</a>
Change AMPWEBADDRESS to be the IP or fully qualified domain name given to your pbx.

