1

How to customise email headers from Vixie-cron (debian) and msmtp?

view story
linux-howto

http://serverfault.com – I have had some trouble with getting cron to send emails. My ISP requires that the "From:" field match the email address the email is being sent from, otherwise the email is rejected. As cron hardcodes the "From:" field to "root (Cron Daemon)", these emails are not being sent. I have set up msmtp and can send emails with no problem from the command line. In fact I have wrapped some of my cron jobs in a script that sends the email itself. This works fine, but I would like a more elegant solution. I originally used the package msmtp-mta, which just symlinks /usr/lib/sendmail to /usr/bin/msmtp (HowTos)