From owner-freebsd-questions@FreeBSD.ORG Mon Jul 16 13:26:53 2007 Return-Path: X-Original-To: questions@freebsd.org Delivered-To: freebsd-questions@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4342116A400 for ; Mon, 16 Jul 2007 13:26:53 +0000 (UTC) (envelope-from mail25@bzerk.org) Received: from ei.bzerk.org (ei.xs4all.nl [82.95.223.12]) by mx1.freebsd.org (Postfix) with ESMTP id CB11C13C4B2 for ; Mon, 16 Jul 2007 13:26:52 +0000 (UTC) (envelope-from mail25@bzerk.org) Received: from ei.bzerk.org (BOFH@localhost [127.0.0.1]) by ei.bzerk.org (8.13.8/8.13.8) with ESMTP id l6GD0Z66081517; Mon, 16 Jul 2007 15:00:35 +0200 (CEST) (envelope-from mail25@bzerk.org) Received: (from bulk@localhost) by ei.bzerk.org (8.13.8/8.13.8/Submit) id l6GD0Yje081516; Mon, 16 Jul 2007 15:00:34 +0200 (CEST) (envelope-from mail25@bzerk.org) Date: Mon, 16 Jul 2007 15:00:34 +0200 From: Ruben de Groot To: Mikhail Teterin Message-ID: <20070716130034.GA81331@ei.bzerk.org> References: <200707141603.55899@aldan> <6.0.0.22.2.20070714155424.0242a958@mail.computinginnovations.com> <200707141821.17085@aldan> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200707141821.17085@aldan> User-Agent: Mutt/1.4.2.2i X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.1.7 X-Spam-Checker-Version: SpamAssassin 3.1.7 (2006-10-05) on ei.bzerk.org X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0 (ei.bzerk.org [127.0.0.1]); Mon, 16 Jul 2007 15:00:41 +0200 (CEST) Cc: questions@freebsd.org, Derek Ragona Subject: Re: Can cron e-mail HTML? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jul 2007 13:26:53 -0000 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