From owner-freebsd-questions@FreeBSD.ORG Tue Mar 3 03:05:15 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 30F72106568B for ; Tue, 3 Mar 2009 03:05:15 +0000 (UTC) (envelope-from frank@esperance-linux.co.uk) Received: from mailout.zetnet.co.uk (mailout.zetnet.co.uk [194.247.47.231]) by mx1.freebsd.org (Postfix) with ESMTP id B3C7D8FC19 for ; Tue, 3 Mar 2009 03:05:14 +0000 (UTC) (envelope-from frank@esperance-linux.co.uk) Received: from irwell.zetnet.co.uk ([194.247.47.48] helo=zetnet.co.uk) by mailout.zetnet.co.uk with esmtp (Exim 4.63) (envelope-from ) id 1LeKwP-0000iB-SO; Tue, 03 Mar 2009 03:05:09 +0000 Received: from melon.esperance-linux.co.uk (54-144.adsl.zetnet.co.uk [194.247.54.144]) by zetnet.co.uk (8.14.1/8.14.1/Debian-9) with ESMTP id n23359jX012966; Tue, 3 Mar 2009 03:05:09 GMT Received: by melon.esperance-linux.co.uk (Postfix, from userid 1001) id 179E9FCA4DB; Tue, 3 Mar 2009 03:05:04 +0000 (GMT) Date: Tue, 3 Mar 2009 03:05:03 +0000 From: Frank Shute To: APseudoUtopia Message-ID: <20090303030503.GA23476@melon.esperance-linux.co.uk> Mail-Followup-To: APseudoUtopia , freebsd-questions@freebsd.org References: <27ade5280903011124v4d6d9fdq2071d5ab44a37ca9@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <27ade5280903011124v4d6d9fdq2071d5ab44a37ca9@mail.gmail.com> User-Agent: Mutt/1.4.2.3i X-Face: *}~{PHnDTzvXPe'wl_-f%!@+r5; VLhb':*DsX%wEOPg\fDrXWQJf|2\,92"DdS%63t*BHDyQ|OWo@Gfjcd72eaN!4%NE{0]p)ihQ1MyFNtWL X-Operating-System: FreeBSD 6.4-RELEASE-p2 i386 X-Organisation: 'http://www.shute.org.uk/' X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.1.7 (zetnet.co.uk [194.247.46.1]); Tue, 03 Mar 2009 03:05:09 +0000 (GMT) Cc: freebsd-questions@freebsd.org Subject: Re: Cron Not Sending Mail X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Frank Shute List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Mar 2009 03:05:15 -0000 On Sun, Mar 01, 2009 at 02:24:47PM -0500, APseudoUtopia wrote: > > Cron is not sending output as emails. I noticed this when I stopped > seeing the output of a backup script in my daily email. I thought > there was a problem with the backup script - but no, it's cron not > sending the emails. > > I had this problem before on 6.1, which I never found a solution to. I > gave up on it, and eventually I upgraded to 7.1. After the upgrade, > cron worked perfectly. However, I just noticed that it stopped working > again. I have no idea what changed (It's a production server, I > haven't been playing with config files). > > User www's mail is redirected to root, which is redirected to a @gmail > account via /etc/aliases. > This is on 7.1-RELEASE-p3 running a custom kernel. > > Any solution to this problem would be fantastic. I use the emails from > cron on a daily basis, and it really messes me up to have it not > working. > > ##### > # User www's crontab > # Note, I also tried removing the MAILTO to no avail > ##### > MAILTO=root > # m h dom mon dow cmd > * * * * * echo "Hello" PATH is not set or binary not called with it's path. > > > #### > # /var/log/cron > #### > Mar 1 19:22:00 youcant /usr/sbin/cron[22627]: (operator) CMD > (/usr/libexec/save-entropy) > Mar 1 19:22:00 youcant cron[22627]: NSSWITCH(nss_method_lookup): nis, > group_compat, setgrent, not found > Mar 1 19:22:00 youcant cron[22627]: NSSWITCH(nss_method_lookup): nis, > group_compat, endgrent, not found > Mar 1 19:22:00 youcant cron[22627]: NSSWITCH(nss_method_lookup): nis, > passwd_compat, endpwent, not found > Mar 1 19:22:00 youcant /usr/sbin/cron[22628]: (www) CMD (echo "Hello") > Mar 1 19:22:00 youcant cron[22628]: NSSWITCH(nss_method_lookup): nis, > group_compat, setgrent, not found > Mar 1 19:22:00 youcant cron[22628]: NSSWITCH(nss_method_lookup): nis, > group_compat, endgrent, not found > Mar 1 19:22:00 youcant cron[22628]: NSSWITCH(nss_method_lookup): nis, > passwd_compat, endpwent, not found > Mar 1 19:22:00 youcant cron[22630]: NSSWITCH(nss_method_lookup): nis, > group_compat, setgrent, not found > Mar 1 19:22:00 youcant cron[22630]: NSSWITCH(nss_method_lookup): nis, > group_compat, endgrent, not found > Mar 1 19:22:00 youcant cron[22630]: NSSWITCH(nss_method_lookup): nis, > passwd_compat, endpwent, not found > > Heh! I misread your original post. I didn't realise that "youcant" was your hostname. It confused me ;) A few ideas: Make MAILTO in cron point to your gmail account. If not you'll need an alias for www in aliases(5) to point to that gmail account and you have to remember to rebuild it with newaliases(1) after you've edited it. > > #### > # /var/log/maillog > #### > Mar 1 19:22:00 youcant sendmail[22630]: n21JM0Gl022630: from=www, > size=0, class=0, nrcpts=0, > msgid=<200903011922.n21JM0Gl022630@youcant.tastetherainbow.ws>, > relay=www@localhost This has got a few problems. It's saying the size of the message is 0 (probably because you've not set your PATH) & the number of recipients is 0 and it seems to be relaying it to www@localhost rather than delivering it to your gmail account (newaliases not run). Regards, -- Frank Contact info: http://www.shute.org.uk/misc/contact.html