0
  • Ubuntu Jaunty Server (9.04)
  • pure-ftpd 1.0.21-11.4ubuntu1
  • mutt 1.5.18-6ubuntu1

I need to receive e-mail notifications when my FTP users upload files.

I use pure-uploadscript to do this. The code below is set to be run from my own (non-super) user:

#! /bin/bash
echo "File $1 (size $UPLOAD_SIZE) uploaded by $UPLOAD_VUSER \
on $(date)" \
| /usr/bin/mutt -s "[FTP] File uploaded: $1" \
  user@example.com 2>&1 >> path/logfile \
&& echo "OK $1 $(id)" >> path/logfile \
|| echo "ERR $1 $(id)" >> path/logfile

My script gets called, $(id) displays correct data, but mutt says (as I can see from the log) "Could not send the message.".

When I run the same command from the commandline of my own user, message is sent.

What can I do to debug this?

Alexander Gladysh
  • 2,423
  • 8
  • 31
  • 49

1 Answers1

3

Mutt is probably looking at the wrong place for the sendmail command.

:set sendmail from within mutt gives you the location where mutt is looking for it. It can also be used for setting the right location e.g. :set sendmail="/usr/sbin/sendmail"

As a side note, mutt is a great program, but nail or mailx are usually the tools of choice for use in a script.

xyz
  • 151
  • 3