Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top
  • 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" \ 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?

share|improve this question
up vote 3 down vote accepted

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.

share|improve this answer
I've switched to mailx, and all worked out-of-the-box. Thank you! – Alexander Gladysh Jul 11 '09 at 21:40

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.