[asterisk-users] Cannot send mail from System command

A J Stiles asterisk_list at earthshod.co.uk
Mon Apr 30 05:10:38 CDT 2012

On Monday 30 April 2012, Ishfaq Malik wrote:
> I'm trying to create a fax to email function.
> I'm using asterisk on Centos 5.6 and using mutt to send the
> email with an attachment
> Whenever the system command to send the mail is executed, no mail is
> sent (have tried using mail as well as mutt)

You appear to have forgotten to attach the relevant portion of your dialplan, 
without which we are stabbing in the dark.  Did you provide the full path to 
the mutt or mail binary in your System() call?

> When I execute the same command from command line using my own user the
> mail and attachment are sent without a problem.
> The attachment has asterisk as user and 0644 permissions. The file I'm
> using for the body of text has 0777 permissions.
> I know system is executing commands as I did a touch command to test it.
> Asterisk is running as user asterisk.
> Is there something obvious that I'm missing?

Try running the command yourself, as user asterisk:
$ su -
(give root password)
# su - asterisk
Try executing *exactly* the same command as specified in the System() call in 
your dialplan.  Check the user's environment is sane.  Chances are, it's a 
PATH issue.


Answers come *after* questions.

More information about the asterisk-users mailing list