From owner-freebsd-questions@FreeBSD.ORG Thu Jul 19 10:03:23 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 CD7BC16A401 for ; Thu, 19 Jul 2007 10:03:23 +0000 (UTC) (envelope-from tevans.uk@googlemail.com) Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.172]) by mx1.freebsd.org (Postfix) with ESMTP id 5EE6913C4B5 for ; Thu, 19 Jul 2007 10:03:23 +0000 (UTC) (envelope-from tevans.uk@googlemail.com) Received: by ug-out-1314.google.com with SMTP id o4so536310uge for ; Thu, 19 Jul 2007 03:03:22 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=googlemail.com; s=beta; h=domainkey-signature:received:received:subject:from:to:cc:in-reply-to:references:content-type:date:message-id:mime-version:x-mailer; b=BupJeKNyyk/zyUZoc9utjJ++aDn+kkI4zAz28waDDnTnfnZ1LtKtkgLX7/thUi1CY+DgMQE6TD92uRqt8ZM3d5jCptdnKh71gRBYzm40sFOsQl3jj4kh7EDysD9JVJWnUPtJLDOLxQ2o1z3pumZuf4uY47mJ4h9pT8uIBc+5to4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=beta; h=received:subject:from:to:cc:in-reply-to:references:content-type:date:message-id:mime-version:x-mailer; b=JlysdilZ9rt4VXWFDotocJz+Zf1uKaTW6/vZ9uezjrpH6SQ2aG4wiFK/Ui31oXlAqX0PuhN5pmk+emDiU4nuvXHDWlRKfzHGQPHNVEp7kzLAYziduM0Rd2L8qewkn2j0DyJvUmJAwlwmEko2TyujF6WSFQdjO75hmfv4B+nkZOM= Received: by 10.67.22.2 with SMTP id z2mr1081496ugi.1184839402182; Thu, 19 Jul 2007 03:03:22 -0700 (PDT) Received: from ?127.0.0.1? ( [217.206.187.79]) by mx.google.com with ESMTPS id d24sm8968268nfh.2007.07.19.03.03.20 (version=SSLv3 cipher=RC4-MD5); Thu, 19 Jul 2007 03:03:21 -0700 (PDT) From: Tom Evans To: Mikhail Teterin In-Reply-To: <200707141914.07646@aldan> References: <200707141603.55899@aldan> <200707141827.31177@aldan> <46995194.8000108@slightlystrange.org> <200707141914.07646@aldan> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-0qU6yCjrCHMrvXJezoDo" Date: Thu, 19 Jul 2007 11:03:19 +0100 Message-Id: <1184839399.1313.16.camel@localhost> Mime-Version: 1.0 X-Mailer: Evolution 2.10.2 FreeBSD GNOME Team Port Cc: questions@freebsd.org, Daniel Bye 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: Thu, 19 Jul 2007 10:03:23 -0000 --=-0qU6yCjrCHMrvXJezoDo Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Sat, 2007-07-14 at 19:14 -0400, Mikhail Teterin wrote: > On =D1=81=D1=83=D0=B1=D0=BE=D1=82=D0=B0 14 =D0=BB=D0=B8=D0=BF=D0=B5=D0=BD= =D1=8C 2007, Daniel Bye wrote: > =3D So it's beginning to look as if your best bet is in fact to make your > =3D script handle sending the mail. >=20 > Yeah, seems like it... >=20 > =3D Not the cleanest solution, but one that will get your messages format= ted > =3D exactly how you want them. >=20 > Well, I started looking into how much effort would it be to translate the= =20 > strings returned by libmagic(3)'s routines into Content-Type. >=20 > If it is easy enough, I could hack cron to analyze the job's output using= =20 > magic_buffer(3) and set Content-Type if anything recognizable is detected= ... >=20 > The translation is the difficult part :-( Instead of the standardized >=20 > text/html >=20 > for example, libmagic returns: >=20 > HTML document text >=20 > It is trying to be human-readable, while I need the machine-readable stri= ngs. >=20 > There is stuff on-line that does the translation, but it is in much=20 > higher-level languages (like PHP), which think, hash-tables are free :-) >=20 > Oh, well... >=20 > -mi Or you could just use sendmail? 30 4 * * 1-6 ~/bin/foo 2>&1 | sendmail foo@bar.com Sendmail will read in any headers you put into the message. Eg: > $ cat sample.htmlh=20 Subject: really? Really? will work just fine and set the email subject header when piped into sendmail. Or you could patch cron to use libmagic, and have cron scripts that will only work on one box. Hmmm, decisions, decisions... --=-0qU6yCjrCHMrvXJezoDo Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (FreeBSD) iD8DBQBGnzbflcRvFfyds/cRAoiPAJ0aJTdceVKvhOuUxaZrpmSeokA77QCffT2i k1mX1dFrkHFXCL+Yd+RrnpE= =LOrJ -----END PGP SIGNATURE----- --=-0qU6yCjrCHMrvXJezoDo--