Summary:ASTERISK-12511: Asterisk does not send voicemail alerts when it is being executed as a non-root user
Reporter:urzedo (urzedo)Labels:
Date Opened:2008-08-03 15:53:05Date Closed:2011-06-07 14:03:23
Versions:Frequency of
Description:I have been using Asterisk 1.2.19 for the past two years. We created a non-root user to execute this Asterisk instance and everything was ok.

Now we upgraded to Asterisk and want to continue using this non-root user to execute Asterisk. However, we noticed that after the upgrade no voicemail alerts are generated by Asterisk anymore, when using a non-root user. If we use root, the emails alerts are sent.

We downgraded this Asterisk instance until we found that Asterisk 1.4.14 is able to send the alerts as a non-root user, but from version 1.4.15 on we can reproduce the issue.

We are not good C programmers, but found that this issue should be something related to umask setting (at least in app_voicemail.c).

Please help.
Comments:By: Michiel van Baak (mvanbaak) 2008-08-03 17:34:22

are you able to send mail as this user using mail/mailx/mutt/sendmail/whatever_mail_agent_you_have_installed ?

By: urzedo (urzedo) 2008-08-03 17:40:36

Yes, we can send emails via command line using this linux user. We are using postfix.

By: Michiel van Baak (mvanbaak) 2008-08-04 12:22:28

any hints in /var/log/mail.log ?

By: Tilghman Lesher (tilghman) 2008-08-04 12:40:41

Please upload the contents of your voicemail.conf's [general] section (i.e. no users/passwords, just the general settings).

Also, what is the output of:
bash% ls -l /usr/sbin/sendmail

By: urzedo (urzedo) 2008-08-04 16:45:42

Hi all!

mvanbaak, when we were running Asterisk as a non-root user, there were no messages in the mail log. When using root, the logs were there. Looks like Asterisk does not send messages at all, when running as a non-root user. When sending mails from command line, both users generate entries in the mail log file.

Corydon76, the heneral section of my voicemail.conf is attached. Please find bellow some information from my linux box (the non-root user is asterisk_user):

[root@lv19 asterisk]# ls -l /usr/sbin/sendmail
lrwxrwxrwx  1 root root 21 Jul 14 16:32 /usr/sbin/sendmail -> /usr/sbin/sendmail.postfix

[root@lv19 asterisk]# ls -l /usr/sbin/sendmail.postfix
-rwxr-xr-x  1 root root 157424 Apr  9 14:30 /usr/sbin/sendmail.postfix

[root@lv19 asterisk]# groups asterisk_user
asterisk_user : asterisk_user root tty uucp

We were under some pressure from our client and then we changed the file app_voicemail.c in order not to use the variable "myumask". Now, Asterisk can send the message alerts when running as a non-root user. However, it is not able to delete the messages already sent from /tmp folder.

Please let me know what do you think about this issue.

By: Tilghman Lesher (tilghman) 2008-08-04 18:14:00

What is the umask of your 'asterisk_user' user?

By: Tilghman Lesher (tilghman) 2008-08-04 18:22:04

If the umask is set such that the asterisk_user does not have permission to read the file (e.g. 0666) or 0600), then that would explain why sendmail is unable to send the email.  Try setting the umask of the asterisk_user user to something sane, like 0002.

By: urzedo (urzedo) 2008-08-05 06:44:57

Hi Corydon76,

I will follow your advice. Please wait for my feedback.

Thanks a lot.

By: urzedo (urzedo) 2008-08-05 16:13:36

Hi Corydon76 and mvanbaak,

We were already using umask 002.

However, we installed a fresh asterisk this morning and since that we cannot reproduce the issue anymore... All the emails are now being sent when Asterisk runs both as root and asterisk_user. There were so many changes we did in the machine that one could possibly solved the issue.

Anyway, THANKS A LOT for your patience and sorry for the noise!