From owner-freebsd-questions@FreeBSD.ORG Sun Oct 25 17:19:39 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BAB92106566C for ; Sun, 25 Oct 2009 17:19:39 +0000 (UTC) (envelope-from kraduk@googlemail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.156]) by mx1.freebsd.org (Postfix) with ESMTP id 454D88FC0A for ; Sun, 25 Oct 2009 17:19:38 +0000 (UTC) Received: by fg-out-1718.google.com with SMTP id 16so638795fgg.13 for ; Sun, 25 Oct 2009 10:19:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=SRFL3M8aNxOYUe/yyTrisTT8iTq/cbId1RSc078km0I=; b=mxsEuSVCCW9Ey/Og5Vtn9XX6IiSAXtbYgqNy2NrvsttREn0diMd2cVWZ+tEiT9P/Xh vyXLxVSEuRUr1Zd+Mz2jh2NCsrUj/mDb/7cXn2MMwhevIMeVBNf0YeFLJ/VQAmi7TZS9 mLGyNPDG074WZLHn4PPkarVyVRnxHUwyVTI38= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=Og+A45GiYfKcio7fZhxBVf9+b8zfts25sSxFGS81A5jPzPFCxeBQibYlGO72VIt7xG m0Hw3t6wEty/sXzXVohkeE5AbRYoRDrNAfZ3c1A+sAJoq4XX4wB+tFcZyxd0l8SVP4Ap PiqzxMfkR7hsDlHhXVAVoVpdW2XeJQ0KIsz2w= MIME-Version: 1.0 Received: by 10.239.183.30 with SMTP id s30mr1218979hbg.171.1256491177912; Sun, 25 Oct 2009 10:19:37 -0700 (PDT) In-Reply-To: <20091025021009.051de285.dcdowse@gmx.net> References: <1338880b0910240008h5d5e7846q8ccf184728d9e036@mail.gmail.com> <20091025021009.051de285.dcdowse@gmx.net> Date: Sun, 25 Oct 2009 17:19:37 +0000 Message-ID: From: krad To: "Daniel C. Dowse" Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Kelly Martin , FreeBSD Questions Subject: Re: changing cron's From: address in emails 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, 25 Oct 2009 17:19:39 -0000 2009/10/25 Daniel C. Dowse > On Sat, 24 Oct 2009 01:08:21 -0600 > Kelly Martin wrote: > > > Greetings, here's a simple question for the FreeBSD gurus out there. I > > have several servers running cron scripts daily for me, and they all > > send me e-mail with their output. Regardless of which server it is, > > each of these e-mails have the From: address looking exactly the same. > > They all say they are from the "Cron Daemon". Fine, but I'd like to > > know more clearly which server the cron output is from. > > > > How can I change the From: address of these emails to "Myserver Cron > > Daemon" instead? I know cron runs as the user, so it's not immediately > > obvious to me how to change the From: field. Already the subject line > > says something like "Cron ..." but this doesn't stand > > out enough for my tired eyes. > > Why don`t you just create some filter rules in your mua ? > It may makes it clear for you if you create a folder for each host > and filter your msg on receiving ? > > e.g. > > Inbox > ... > CronDir > - Host 1 > - Host 2 > .... > > > Cheers > > Daniel > > -- > Just because I don`t care - Doesn`t mean I don`t understand ! > -- Homer J. Simpson > > > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to " > freebsd-questions-unsubscribe@freebsd.org" > The simplist way to do it is get you scripts to print out a to, from and subject line at the top of their output containing the information you want. eg To: your@mailbox.com From: scriptname@hostname.com Subject: scriptname, hostname other script output Then in the cron pipe the output into sendmail with the t flag eg 1 1 * * * somescript 2>&1 | /usr/sbin/sendmail -t you will then get the loverly named emails