SARK V4.0.0 vmail

From sailpbx
Revision as of 13:44, 12 August 2013 by Adminwiki (talk | contribs) (testing your SMTP set up)
Jump to: navigation, search

Up a level

Introduction

Voicemail to email uses two different mechanisms depending upon the distro; SME Server, Debian (SARK200) or PIKA Warp (SARK500). There are also some restrictions for the SARK500 embedded PBX.

Setting the sender in Asterisk

Asterisk's voicemail to email implementation is pretty robust and there are no known problems with it. 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

V4 asterisk files vmail layout.png



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".


SARK email client implementations

SME Server (SARK850, SARK1000, SARK1200)

The SME server distro uses qmail and it has a full-blown 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.

SARK200 & SARK500

The embedded 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.

V4 network smtp1.png



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/TLS 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. You may need to check with your mail administrator that the server accepts local mail over port 25 (SMTP).

forwarding mail through a server

If you have users on other servers and you wish to forward mail to them you will need an account on your own mailserver through which to forward the mail. 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 and which secure port to communicate on.

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 it should just work for you. If your end users are using Google mail then there is a very good chance that google will dismiss the mail as spam and you'll find it in the spam folder. Your user(s) can fix this by simply adding the sender to their gmail contacts lists.

testing your SMTP set up

You can test your mail account and forwarding by manually sending test mail from the SARK200 or SARK500 console using the sendmail command. sendmail can be quite complex to use from the CLI 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 the following like this

To:someaccount@mymailserver.url
From:pbx@some.url
Subject: A test email to you

This is a test email

CTRL+D

The only tricky bit is that you need to skip a couple of blank lines after the Subject line and at the end of the body of your mail. As mentioned above, if you are using Google mail then there is a very 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 gmail contacts list. Once you have proved this step then your vmail to email should work without further attention. If you get into trouble simply type Ctrl+D at any point to exit the command.

SARK500 restrictions

The SARK500 is not able to use SSL/TLS to send emails so your server must support SMTP (port 25) unencrypted mail. As long as it does then the S500 will work fine. Simply set up your mail with TLS and STARTTLS set to NO. Your email server administrator should be able to advise you on this. In the worst case, where your server will NOT accept mail over port 25 then you can again use gmail, with some restrictions. gmail will accept mail over port 25 but it will only forward it to other gmail users, it will not forward outside of gmail. The S500 SMTP implementation is a little different to the Debian releases, it simply gives you a box into which you can type the relevant settings for ssmtp. There is an example below. Set up is trivial; you don't even need a gmail account for it to work.

V4 network smtp4.png



This will allow you to send mail to any gmail user. You can of course create a rule within that user to forward the mail on to a designated external user. It's a bit more work to set up but it should work fine.