Voicemail email configuration


I’m having trouble configure voicemail to send emails.

I have Asterisk 1.6 running on a Synology ds108j. I’ve installed nail to be able to send emails under my gmail credentials.

Basically, I can get Asterisk to send an email, but with the following observations:

  1. Only wav49 format works. If I set format=wav, I get errors such as ‘Can’t find format wav’
  2. I don’t seem able to override the default ‘messagebody’. The email that is sent always comes through with some default message “Just wanted to let you know you were just left a 0:04 long message …”
  3. The ‘wav’ attachment isn’t coming through as an attachment, but instead arrives as some ‘MIME mulitpart’ nonsense:

Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit

Dear CiscoFon:

   Just wanted to let you know you were just left a 0:04 long message (number 1)

in mailbox 2000 from xxx, on Wednesday, April 18, 2012 at 07:29:20 AM so you might
want to check it when you get a chance. Thanks!


Content-Type: audio/x-WAV; name="msg0000.WAV"
Content-Transfer-Encoding: base64
Content-Description: Voicemail sound attachment.
Content-Disposition: attachment; filename=“msg0000.WAV”


My voicemail.conf file is along the lines of:


Any assistance will be much appreciated, I’ve been battling with this for hours!


That’s how attachments have been handled in internet mail for more than the last decade. Before that, the methods were more ad hoc and required heuristics in the mail client.

MIME might be the proctcol used to deliver the message, but you would not expect an email client to present the ‘raw’ MIME code to you as text content.

I think the issue is something to do with using “nail” as the mailcmd instead of “sendmail”. With sendmail you can do "cat | sendmail -t target_address. But with nail, you have to do "nail -a ". So the question becomes, how can I override the way Asterisk uses the ‘mailcmd’? I could just write a shell script to do this, and set the mailcmd as the path to this script, but surely there is a more elegant way to do this by editing the Asterisk configuration.

No. The defacto standards for program submission of mail is the sendmail one, which is why alternative MTAs will emulate sendmail for submission purposes. They question is why are you using a non-conforming mail program, possibly one intended only for human use?

The submission to sendmail will include the top level headers, not just the ones for the individual parts.

nail appears to be based on mailx. A CentOS build of mailx users /usr/sbin/sendmail to actually submit the email. You should not be using mailx to submit mail from a program.

[quote][root@centos code]# strings /bin/mailx | grep sendmail
[-- sendmail-options …]

David, thanks for your response. I’ve ended up using msmtp, as it looks like sendmail is difficult to configure without a static IP address. msmtp works well.

One good option would also be using SSMTP instead of sendmail. SSMTP is also very simple to set up.