Can cron e-mail HTML?

Ruben de Groot mail25 at bzerk.org
Mon Jul 16 13:26:53 UTC 2007


On Sat, Jul 14, 2007 at 06:21:16PM -0400, Mikhail Teterin typed:
> = To accomplish this I have my cron job run a script like this
> 
> Sorry, I missed the most important part. Your script just uses /usr/bin/mail, 
> the same way cron does. You are not adding anything, not already present in 
> cron -- your script should simply produce output to stdout. Cron will mail 
> all that to the address specified in MAILTO=... part of your crontab 
> automatically.
> 
> AFAIK, to make the e-mail message treated as a MIME one, the "MIME-Version: 
> 1.0" and "Content-Type: ..." have to be among _headers_.
> 
> I'm afraid, it is not possible to directly manipulate the message's headers 
> using mail(1), which is why I asked my question in the first place...

Just for the record, cron seems to be using /usr/lib/sendmail, not mail(1):

malenfant# grep -r _PATH_SENDMAIL /usr/src/usr.sbin/cron/cron/config.h
#if !defined(_PATH_SENDMAIL)
# define _PATH_SENDMAIL "/usr/lib/sendmail"
#define MAILCMD _PATH_SENDMAIL                                  /*-*/
malenfant# grep _PATH_SENDMAIL /usr/include/paths.h
#define    _PATH_SENDMAIL  "/usr/sbin/sendmail"

cheers,
Ruben



More information about the freebsd-questions mailing list