[Nix-dev] Crontab and mail / ssmtp troubles
M. P. Ashton
data at imap.cc
Wed Oct 15 22:07:24 CEST 2014
I'm having trouble getting a rather simple crontab running on a new
NixOS installation.
The crontab is supposed to run a shell script in a user account. It
doesn't work. So I tried just having it run "echo test". That got me
this in the journal:
Oct 15 15:54:01 bode cron[22272]: (mpashton) CMD (echo test)
Oct 15 15:54:01 bode cron[22271]: (mpashton) MAIL (mailed 5 bytes of
output but got status 0x0001
)
Sadly I can't see cron's mail output, because mail doesn't work either.
I installed ssmtp using networking.defaultMailServer.directDelivery =
true, but none of my mail programs, like mutt and mail, seem to be able
to find sendmail. For example:
[mpashton at bode:~]$ echo "Hi there" |mail -s "Test subject"
data at gtf.org
Cannot open mailer: No such file or directory
I can force Mutt to see sendmail by putting this in .muttrc:
set sendmail="sendmail";
Then it works fine and I can send mail successfully. So, obviously Mutt
is pointing to something like /usr/sbin/sendmail by default. Maybe
crontab is too? But I would have thought this would be patched already.
Crontab is below. Notice I tried adding paths -- this did not help.
Thanks to anyone who can offer advice here!
--Michael
* * *
SH=/run/current-system/sw/bin/sh
MAILTO=data at gtf.org
PATH=/run/current-system/sw/sbin
10 02 * * * echo test
More information about the nix-dev
mailing list