From owner-freebsd-questions@FreeBSD.ORG Sat Jul 14 22:27:32 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 A9B3B16A408 for ; Sat, 14 Jul 2007 22:27:32 +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 5D79F13C478 for ; Sat, 14 Jul 2007 22:27:32 +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 l6EMRVwt055764 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 14 Jul 2007 18:27:31 -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 l6EMRVZ5055763; Sat, 14 Jul 2007 18:27:31 -0400 (EDT) (envelope-from mi+kde@aldan.algebra.com) From: Mikhail Teterin To: Daniel Bye Date: Sat, 14 Jul 2007 18:27:30 -0400 User-Agent: KMail/1.9.6 References: <200707141603.55899@aldan> <46994B8E.1020108@slightlystrange.org> In-Reply-To: <46994B8E.1020108@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 22:27:32 -0000 On субота 14 липень 2007, Daniel Bye wrote: = > How can I force the ``Content-Type: text/html'' header without hacking = > cron's sources? I'd rather avoid poluting my script with e-mail sending = > code... = = Alter your script to add the 'Content-Type: text/html' header. No, I'm afraid, doing this will make the quoted text part of the _body_ of the message. = > Maybe, cron should apply file(1)-like logic to the e-mailed content? = No, cron doesn't need any knowledge of how to render email. I was not advocating adding such knowledge. My suggestion was to make cron add proper Content-Type, so that the /recepient's e-mail program/ will render the message correctly. My scripts generate HTML, someone else could be generating JPG images (from their web-camera, every morning)... = The script itself doesn't have to send the mail - cron will handle that if = there is any output when it exits, but you /can/ add headers to the message = as you need. = = Just make sure any custom headers come before the empty line delimiter = between headers and body, and most mail readers should do the right thing. The empty line is inserted by cron before any of the job's own output... This method will not work, unless the e-mail reader (incorrectly) acts upon parts of the body as if they were headers... Thanks! Yours, -mi