From owner-freebsd-questions@FreeBSD.ORG Sat Jul 14 23:14:09 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 4B41016A404 for ; Sat, 14 Jul 2007 23:14:09 +0000 (UTC) (envelope-from mi+kde@aldan.algebra.com) Received: from aldan.algebra.com (aldan.algebra.com [216.254.65.224]) by mx1.freebsd.org (Postfix) with ESMTP id 0151513C4A5 for ; Sat, 14 Jul 2007 23:14:08 +0000 (UTC) (envelope-from mi+kde@aldan.algebra.com) Received: from aldan.algebra.com (localhost [127.0.0.1]) by aldan.algebra.com (8.14.1/8.14.1) with ESMTP id l6ENE80Q055928 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 14 Jul 2007 19:14:08 -0400 (EDT) (envelope-from mi+kde@aldan.algebra.com) Received: from localhost (localhost [[UNIX: localhost]]) by aldan.algebra.com (8.14.1/8.14.1/Submit) id l6ENE7iU055927; Sat, 14 Jul 2007 19:14:07 -0400 (EDT) (envelope-from mi+kde@aldan.algebra.com) From: Mikhail Teterin To: Daniel Bye Date: Sat, 14 Jul 2007 19:14:07 -0400 User-Agent: KMail/1.9.6 References: <200707141603.55899@aldan> <200707141827.31177@aldan> <46995194.8000108@slightlystrange.org> In-Reply-To: <46995194.8000108@slightlystrange.org> X-Face: %UW#n0|w>ydeGt/b@1-.UFP=K^~-:0f#O:D7whJ5G_<5143Bb3kOIs9XpX+"V+~$adGP:J|SLieM31VIhqXeLBli" 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: Sat, 14 Jul 2007 23:14:09 -0000 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. There is stuff on-line that does the translation, but it is in much higher-level languages (like PHP), which think, hash-tables are free :-) Oh, well... -mi