Posted: Fri May 22, 2009 11:37 am Post subject: [asterisk-users] VOICEMAIL : I've tried a lot but mailing th
Don't be afraid about the info that I'm going to post in this mail, but I want you to give as much info as possible. Also I want to show you what I've tried.
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.
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@telenet.be < /dev/null mutt -s "LOGFILE debug $DATUM" -a /var/log/asterisk/debug jonas.kellens@telenet.be < /dev/null
My /root/.msmtprc-file has the following :
# Set default values for all following accounts. defaults logfile ~/.msmtp.log
The logfile of msmtp (/root/.msmtp.log) shows a successful sending :
May 17 03:01:30 host=uit.telenet.be tls=off auth=off from=jonas.kellens@telenet.be recipients=jonas.kellens@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@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@telenet.be (jonas.kellens@telenet.be)
attach=yes
emailsubject=[PBX]: New message ${VM_MSGNUM} in mailbox ${VM_MAILBOX}
emailbody=Dear ${VM_NAME}:nntjust 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 mightnwant to check it when you get a chance. Thanks!nntttt--Asteriskn
emaildateformat=%A, %B %d, %Y at %r
mailcmd=/usr/sbin/sendmail -v -t -f
[zonemessages]
eastern=America/New_York|'vm-received' Q 'digits/at' IMp
central=America/Chicago|'vm-received' Q 'digits/at' IMp
central24=America/Chicago|'vm-received' q 'digits/at' H N 'hours'
military=Zulu|'vm-received' q 'digits/at' H N 'hours' 'phonetic/z_p'
european=Europe/Copenhagen|'vm-received' a d b 'digits/at' HM
belgie=Europe/Brussels|'vm-received' Q 'digits/at' R
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@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@asterisk agi-bin]# cat /var/lib/asterisk/agi-bin/mail2.sh
mutt -s "$1" -a "$2" jonas.kellens@telenet.be < /dev/null
But this does not work according to the output on the CLI :
-- Executing [3000@TCS-personeel-zoiper:1] NoOp("IAX2/jonaskellens-10491", "test mailscript") in new stack -- Executing [3000@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@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.
Posted: Fri May 22, 2009 4:44 pm Post subject: [asterisk-users] VOICEMAIL : I've tried a lot but mailing th
Maillog is for whatever you send to it, i send clamav/spamd/qmail etc to it
From:asterisk-users-bounces@lists.digium.com [mailto:asterisk-users-bounces@lists.digium.com] On Behalf Of jonas kellens
Sent: May-22-09 1:30 PM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [asterisk-users] VOICEMAIL : I've tried a lot but mailing through Asterisk is just not working...
I thought that /var/log/maillog was for sendmail ?? I'm not using sendmail...
Posted: Fri May 22, 2009 5:31 pm Post subject: [asterisk-users] VOICEMAIL : I've tried a lot but mailing th
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
jonas kellens wrote:
| David,
|
| what is your SMTP-client then ?
|
| Did you change the mailcommand 'mailcmd' in voicemail.conf ?? Or is it
| still /usr/sbin/sendmail ??
I don't have mailcmd in voicemail.conf, I was under the impression that
is the default.
|
| I use version 1.4.24.
|
| Thanks for your reply.
|
Your Welcome
| Greetingz,
| Jonas.
|
I use msmtp
/etc/msmtprc
account default
host mail.relay_my_isp.net
auto_from on
maildomain relay_my_isp.net
syslog LOG_MAIL
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum