hi,

mutt-1.5.20
debian-6.0

i have the following system account in /etc/passwd:

  nut:x:104:107::/var/lib/nut:/bin/false

when it sends email from a script using mutt:

  mutt -s "`hostname` $1" root < /dev/null

it outputs the following error message:

  /sent: Permission denied (errno = 13)

which indicates that mutt wasn't looking in /etc/passwd
to get the user's home directory (i.e. /var/lib/nut) and
so it used the current directory (which was "/") as the
directory in which to create the "sent" file.

i thought that perhaps the fact that the nut user's
home directory was owned by root might be the problem
but changing its ownership to nut didn't help.

to get the email working i needed to add "set copy = no"
to a system Muttrc file because there's obviously no
point putting it in the nut user's own ~/.muttrc file
if mutt can't find the nut user's home directory which
contains the .muttrc file.

to me, this looks like two bug-like entities:

  1) mutt can't find this user's home directory,
  2) mutt abandons sending the email just because
     it can't save a copy of it as well.

2 may be justifiable but 1 is just wierd.
it's almost as if mutt is only looking at $HOME rather
than looking in /etc/passwd to identify the home directory
but that can't be the case. mutt is too smart for that.
$HOME could be set to anything or not set at all.

ah, the manpage says the following in the ENVIRONMENT section:

  HOME   Full path of the user's home directory.

so it must just be using $HOME.

in accordance with the principle of least astonishment,
i'd like to suggest that when $HOME is unset, mutt look up
the home directory in /etc/passwd (i.e. getpwuid() -> pw_dir).
this is an error that shouldn't ever have to happen.

cheers,
raf

Reply via email to