Hi I'm trying to create a fax to email function. I'm using asterisk 1.8.7.0 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) 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? -- Ishfaq Malik <ish at pack-net.co.uk> Department: VOIP Support Company: Packnet Limited t: +44 (0)845 004 4994 f: +44 (0)161 660 9825 e: ish at pack-net.co.uk w: http://www.pack-net.co.uk Registered Address: PACKNET LIMITED, 2A ENTERPRISE HOUSE, LLOYD STREET NORTH, MANCHESTER SCIENCE PARK, MANCHESTER, M156SE COMPANY REG NO. 04920552
On Monday 30 April 2012, Ishfaq Malik wrote:> I'm trying to create a fax to email function. > I'm using asterisk 1.8.7.0 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. -- AJS Answers come *after* questions.
Ishfaq Malik
2012-Apr-30 10:12 UTC
[asterisk-users] Cannot send mail from System command [SOLVED]
On Mon, 2012-04-30 at 10:10 +0100, Ishfaq Malik wrote:> Hi > > I'm trying to create a fax to email function. > I'm using asterisk 1.8.7.0 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) > > 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? > >There was something simple that I was missing. The asterisk user hadn't been assigned a valid shell. Used chsh and assigned it /bin/bash and it now works. Ish -- Ishfaq Malik <ish at pack-net.co.uk> Department: VOIP Support Company: Packnet Limited t: +44 (0)845 004 4994 f: +44 (0)161 660 9825 e: ish at pack-net.co.uk w: http://www.pack-net.co.uk Registered Address: PACKNET LIMITED, 2A ENTERPRISE HOUSE, LLOYD STREET NORTH, MANCHESTER SCIENCE PARK, MANCHESTER, M156SE COMPANY REG NO. 04920552