From owner-freebsd-questions Tue Mar 30 11:31: 9 1999 Delivered-To: freebsd-questions@freebsd.org Received: from alpha.comkey.com.au (alpha.comkey.com.au [203.9.152.215]) by hub.freebsd.org (Postfix) with SMTP id 6A7A81504B for ; Tue, 30 Mar 1999 11:31:02 -0800 (PST) (envelope-from gjb@comkey.com.au) Received: (qmail 25875 invoked by uid 1001); 30 Mar 1999 11:19:31 -0000 Message-ID: <19990330111931.25874.qmail@alpha.comkey.com.au> X-Posted-By: GBA-Post 1.04 06-Feb-1999 X-PGP-Fingerprint: 5A91 6942 8CEA 9DAB B95B C249 1CE1 493B 2B5A CE30 Date: Tue, 30 Mar 1999 21:19:31 +1000 From: Greg Black To: Roelof Osinga Cc: freebsd-questions@FreeBSD.ORG Subject: Re: Phantom mail in local queue References: <36FC34A6.666D756A@eboa.com> <19990327053803.7854.qmail@alpha.comkey.com.au> <36FFD62D.8E9B5D39@eboa.com> In-reply-to: <36FFD62D.8E9B5D39@eboa.com> of Mon, 29 Mar 1999 21:36:13 +0200 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > So I guess the cron job first creates half a mail, then goes checking > to see if it can find half completed mails and finally reports that > it does indeed, then closes the mail thereby taking care of the problem > it reported? Not what I expected The way you've summarised this makes the system sound silly. But that's not the way it really happens because there are two completely independent processes involved in this. When cron runs any job, it normally collects anything that the job writes to its standard output and standard error streams and mails that output to the job's owner (see the man pages for the full story on this). So, since the daily scripts might produce output, cron sets up a mail process to handle the output. Unknown to cron, and of no consequence to it, the daily script runs the mailq command, not to disclose the incomplete mail job that will ultimately send the daily script's output to root, but to determine if there are real mail jobs queued and not getting anywhere. Of course, since there is a mail job that is at that moment incomplete, it appears in the queue in the form that you have seen. This is not a problem; it's just a fact. Once the cron job completes, the balance of its output is then collected and mailed and so the mail job disappears from the queue. All this is an artifact of the way the daily (and other) scripts work -- they just write stuff to their standard output, so that an interactive user will see what's happening; this is a convenient approach because, when the scripts are run by cron, the same output is collected automatically and mailed to the job owner. No fuss. Except for that one unfinished mail job, and nobody is ever going to waste their time eliminating that from the output. -- Greg Black To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message