[asterisk-bugs] [Asterisk 0015199]: VOICEMAIL : I've tried a lot but mailing is not working...

Asterisk Bug Tracker noreply at bugs.digium.com
Tue May 26 16:31:27 CDT 2009


The following issue has been RESOLVED. 
====================================================================== 
https://issues.asterisk.org/view.php?id=15199 
====================================================================== 
Reported By:                jonaskellens
Assigned To:                russell
====================================================================== 
Project:                    Asterisk
Issue ID:                   15199
Category:                   Applications/app_voicemail
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     resolved
Asterisk Version:           1.4.24 
Regression:                 No 
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Request Review:              
Resolution:                 no change required
Fixed in Version:           
====================================================================== 
Date Submitted:             2009-05-26 13:24 CDT
Last Modified:              2009-05-26 16:31 CDT
====================================================================== 
Summary:                    VOICEMAIL : I've tried a lot but mailing is not
working...
Description: 
What do I want :

When a voicemail-message is left via the Voicemail()-application, I want
the .wav-file send to my mail-address as an attachment.
(the great feature of Comedian Mail compared to proprietary solutions!)

My mail-setup :

I'm not using sendmail as MTA. I have msmtp as MTA and mutt as MUA.
Mailing with mutt and msmtp works well. I have a crontab running that
sends me every Saturday my Asterisk logfiles like this :

#!/bin/bash
DATUM=`date`
mutt -s "LOGFILE verbose $DATUM" -a /var/log/asterisk/verbose
jonas.kellens at telenet.be < /dev/null
mutt -s "LOGFILE debug $DATUM" -a /var/log/asterisk/debug
jonas.kellens at telenet.be < /dev/null

My /root/.msmtprc-file has the following :

# Set default values for all following accounts.
defaults
logfile ~/.msmtp.log

# The SMTP server of the provider.
account default
host uit.telenet.be
user my_username
password my_password
from jonas.kellens at telenet.be

The logfile of msmtp (/root/.msmtp.log) shows a successful sending :

May 23 03:01:30 host=uit.telenet.be tls=off auth=off
from=jonas.kellens at telenet.be recipients=jonas.kellens at telenet.be
mailsize=197590 smtpstatus=250 smtpms
g='250 2.0.0 Message accepted for delivery (sR311b0033o2nLm0HR31q7)'
exitcode=EX_OK
(this was last sunday morning at 3 am)

Msmtp vs Sendmail

I have made a symbolic link from sendmail to msmtp :
[root at asterisk asterisk]# ls -l /usr/sbin/sendmail
lrwxrwxrwx 1 root root 20 May 17 21:10 /usr/sbin/sendmail ->
/usr/local/bin/msmtp

When I use the default setting in voicemail.conf
(mailcmd=/usr/sbin/sendmail -v -t -f), then msmtp will be used. I hoped...


Voicemail.conf

[general]
format=wav49|gsm|wav
serveremail=jonas.kellens at telenet.be
attach=yes
emailsubject=[PBX]: New message ${VM_MSGNUM} in mailbox ${VM_MAILBOX}
emailbody=Dear ${VM_NAME}:\n\n\tjust wanted to let you know you were just
left a ${VM_DUR} long message (number ${VM_MSGNUM})\nin mailbox
${VM_MAILBOX} from ${VM_CALLERID}, on ${VM_DATE}, so you might\nwant to
check it when you get a chance. Thanks!\n\n\t\t\t\t--Asterisk\n
emaildateformat=%A, %B %d, %Y at %r

mailcmd=/usr/sbin/sendmail -v -t -f

[zonemessages]
european=Europe/Copenhagen|'vm-received' a d b 'digits/at' HM
belgie=Europe/Brussels|'vm-received' Q 'digits/at' R

[Voicemail-context]
60 => 4569,Jonas Kellens,jonas.kellens at telenet.be

In my extensions.conf I has the following :

exten => 2000,1,Voicemail(60 at voicemail-context,u)


Now, which settings have I tried :

voicemail.conf :

serveremail=Asterisk PBX
serveremail=jonas.kellens at telenet.be


mailcmd=/usr/sbin/sendmail -v -t -f
mailcmd=/usr/local/bin/msmtp -v -t -f
mailcmd=/usr/local/bin/mutt -v -f -a
mailcmd=/usr/sbin/sendmail -v -t -f jonas.kellens at telenet.be
mailcmd=/usr/local/bin/msmtp -v -t -f jonas.kellens at telenet.be


Logfile msmtp :

Whenever I call extension 2000, I get the voicemail. I leave a message.
There is no fault on the Asterisk CLI.
There is NO entry in the logfile of msmtp (/root/.msmtp.log). No error, no
success.

I have the impression that Asterisk is unable to communicate with sendmail
or msmtp...


Let's try something different :

So if Asterisk does not want to send mail, I can maybe write a dialplan
that checks for messages and sends the voicemailmessages to my
mailaddress.

So I have the following :
[root at asterisk agi-bin]# ls -l /var/lib/asterisk/agi-bin/mail2.sh
-rwxr-xr-x 1 root root 58 May 21 15:16 /var/lib/asterisk/agi-bin/mail2.sh
[root at asterisk agi-bin]# cat /var/lib/asterisk/agi-bin/mail2.sh
#!/bin/sh
mutt -s "$1" -a "$2" jonas.kellens at telenet.be < /dev/null

and this in my dialplan :

exten => 3000,1,NoOp(test mailscript)
exten => 3000,n,System(/var/lib/asterisk/agi-bin/mail2.sh test-email
/etc/asterisk/iax.conf)
exten => 3000,n,NoOp(systemstatus : ${SYSTEMSTATUS})


But this does not work according to the output on the CLI :

-- Executing [3000 at TCS-personeel-zoiper:1] NoOp("IAX2/jonaskellens-10491",
"test mailscript") in new stack
-- Executing [3000 at TCS-personeel-zoiper:2]
System("IAX2/jonaskellens-10491", "/var/lib/asterisk/agi-bin/mail2.sh
test-email /etc/asterisk/iax.conf") in new stack
-- Executing [3000 at TCS-personeel-zoiper:3] NoOp("IAX2/jonaskellens-10491",
"systemstatus : APPERROR") in new stack


So I'm stuck

There is no way for me to get my voicemail-messages through mailing... and
I absolutely want to implement this.

====================================================================== 

---------------------------------------------------------------------- 
 (0105466) russell (administrator) - 2009-05-26 16:31
 https://issues.asterisk.org/view.php?id=15199#c105466 
---------------------------------------------------------------------- 
Please use the forums or mailing lists for support. 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2009-05-26 16:31 russell        Note Added: 0105466                          
2009-05-26 16:31 russell        Status                   new => resolved     
2009-05-26 16:31 russell        Resolution               open => no change
required
2009-05-26 16:31 russell        Assigned To               => russell         
======================================================================




More information about the asterisk-bugs mailing list