SARK V4.0.0 vmail
Contents
Introduction
Voicemail to email uses two different mechanisms depending upon the distro (SME Server or Debian). There are also some restrictions for the SARK500 embedded PBX.
General considerations
Asterisk's voicemail to email implementation is pretty robust and there are no known problems with it (except for a restriction on the S500 - see below). However, you may encounter delivery problems with your own email server. This will usually be due to your server not recognising the incoming mail and treating it as spam. As a result, it may end up in your spam folder or it may not be relayed to its final destination. Asterisk allows you to modify the FROM address on your emails in order to make the mail more acceptable to your mail server. To do this you can modify the asterisk file sark_vmail_layout.conf, which you will find in asterisk->edit
The last two lines are the ones you can change to influence where the email appears to come from.
serveremail
This setting can be used to identify the source of a voicemail notification message. The value is a string which can be encoded one of two ways. If the string is of the form someone@host.com, then the string will be used as the source address for all voicemail notification emails. If the string is of the form someone, then the host name of the machine running Asterisk will be postpended to the string after insertion of the '@' symbol.
fromstring
This setting allows the adminstrator to override a portion of the From: line in the voicemail notification message. By default, Asterisk sends the string "From: Asterisk PBX <who>. The "Asterisk PBX" portion of the From: line can be overridden by specifying your own string as the value for this setting. One might use this to customize the voicemail notification message and/or remove the reference to "Asterisk PBX".
SME Server
The SME server distro uses qmail and has a full email server on-board, although this is usually not used in SME versions of SARK. In general, it will just work with most implementations although you may have to set serveremail and fromstring (see above) for your set-up.
Debian
The Debian implementations have no mailserver on-board, instead they have a lightweight mail client called ssmtp. ssmtp is pretty easy to set up in most cases, however, it isn't as all-encompassing or as "smart" as qmail on SME server so you have to do a little more work to set it up. The comments above about sending address also hold true for ssmtp. On debian sark releases 4.0.0-80 and higher, you set up your email preferences using the SMTP tab of the Network menu.
smtphost
This is the url of your mail server; in the example we are using gmail
user
This is the user name of the email account you wish to relay through
Password
This is the password of the account
=UseTLS
Specifies whether your email server requires an SSL connection
Use STARTTLS
Tells ssmtp whether to send STARTTLS or not (some mailservers, such as gmail require this)
Common ssmtp setups
internal mailserver
If you have your own internal mailserver and you only wish to send emails to users on that server from inside the same network then you will often only need to specify the local url of the mailserver and nothing else. i.e. set user and password to blank and set tls/starttls to NO.
forwarding mail through a server
If you have users on other servers and you wish to forward to them then you will need an account on your own mailserver to forward the mail through. Usually you will as a minimum need to specify a username and a password for an account on that server. Your mailserver administrator should be able to help you and also tell you whether to use SSL/TLS (you can use these terms pretty much interchangeably when talking about mail servers) and whether STARTTLS is required.
forwarding through a gmail account
Often, the easiest and fastest way to set up a mail forward is to create a gmail account to do it for you. Create a gmail account, perhaps with a descriptive name e.g. pbxmail.mycompany@gmail.com. Set up your SMTP page as we've done it in the screenshot above and that should just work for you.
testing your SMTP set up
You can test your mail account and forwarding manually from the Debian console using the sendmail command. sendmail is quite comp[lex but here is a simple way to use it to test your mail. At the console do
sendmail -t
this will give you a blank line. Type a To address like this
To:someaccount@mymailserver.url
This will give you another blank line; type a From address
From:pbx@some.url
then a subject
A test email to you
skip a couple of lines and type the body of your mail
This is a test email
skip a couple more and type CTRL+D to exit and send your mail. If you are using Google mail then there is a vaery good chance that google will dismiss the mail as spam and you'll find it in the spam folder. You can fix this by simply adding the sender to your contacts list.