From owner-freebsd-questions@FreeBSD.ORG Sun Jul 15 12:19:33 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 135C216A401 for ; Sun, 15 Jul 2007 12:19:33 +0000 (UTC) (envelope-from dan@slightlystrange.org) Received: from catflap.slightlystrange.org (cpc5-cmbg1-0-0-cust497.cmbg.cable.ntl.com [86.6.1.242]) by mx1.freebsd.org (Postfix) with ESMTP id C892213C491 for ; Sun, 15 Jul 2007 12:19:32 +0000 (UTC) (envelope-from dan@slightlystrange.org) Received: by catflap.slightlystrange.org (Postfix, from userid 106) id 0FC4F61AC; Sun, 15 Jul 2007 13:19:31 +0100 (BST) Received: from stoopid.slightlystrange.org (stoopid.slightlystrange.org [10.1.3.142]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by catflap.slightlystrange.org (Postfix) with ESMTP id 81D6460E2; Sun, 15 Jul 2007 13:19:30 +0100 (BST) Message-ID: <469A10CF.6080103@slightlystrange.org> Date: Sun, 15 Jul 2007 13:19:27 +0100 From: Daniel Bye User-Agent: Thunderbird 2.0.0.4 (Macintosh/20070604) MIME-Version: 1.0 To: Mikhail Teterin References: <200707141603.55899@aldan> <200707141827.31177@aldan> <46995194.8000108@slightlystrange.org> <200707141914.07646@aldan> In-Reply-To: <200707141914.07646@aldan> Content-Type: text/plain; charset=KOI8-U Content-Transfer-Encoding: 8bit Cc: questions@freebsd.org 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: Sun, 15 Jul 2007 12:19:33 -0000 Mikhail Teterin wrote: > On субота 14 липень 2007, Daniel Bye wrote: > = So it's beginning to look as if your best bet is in fact to make your > = script handle sending the mail. > > Yeah, seems like it... > > = Not the cleanest solution, but one that will get your messages formatted > = exactly how you want them. > > Well, I started looking into how much effort would it be to translate the > strings returned by libmagic(3)'s routines into Content-Type. > > If it is easy enough, I could hack cron to analyze the job's output using > magic_buffer(3) and set Content-Type if anything recognizable is detected... > > The translation is the difficult part :-( Instead of the standardized > > text/html > > for example, libmagic returns: > > HTML document text > > It is trying to be human-readable, while I need the machine-readable strings. Is /usr/share/misc/magic.mime of any use? Apparently it is consulted by file(1) when called with -i. According to libmagic(3), magic_open() with the MAGIC_MIME flag should do the same. Cheers, Dan