How to stop a cron job sending email

Erik Christiansen dvalin at internode.on.net
Sat Nov 1 09:33:30 UTC 2008


On Fri, Oct 31, 2008 at 02:16:45PM +0200, Johann Spies wrote:
> On Fri, Oct 31, 2008 at 10:02:27PM +1100, Karl Auer wrote:
> > I'm curious though - why on earth are you killing and restarting
> > fetchmail every five minutes?!?
> 
> I collect mail (by imap) every 5 minutes.  It happened in the past
> due to a slow network connection that the previous process did not
> finish in 5 minutes.

Even though asynchronously killing fetchmail doesn't seem to have
resulted in the loss of partially transferred emails, it remains an
unnecessary potential hazard, I suspect. The additional supression of
error messages is not a particularly positive attribute either, as
others have commented.

Though the precise aspect of the slow network connection which is being
worked around is not crystal clear, is there any help in the following?

a) To make fetchmail wait 10 minutes between fetches, to ensure the
   previous transfer is complete, add to .fetchmailrc:

   set daemon 600

b) Alternatively, enable fetchmail's IDLE mode, which causes transfer to
   occur on server notification, rather than regular polls. (man
   fetchmail) This works only with IMAP (which you're using ISTR), and
   only with _one_ mail folder at a given time. For a single user, that
   sounds OK, though.

It may be that you've considered these options already, but if not, then
cleaner fixes than stomping error messages to death, and manually
respawning daemons, might just be more portable and predictable.

Erik

-- 
"Man is alone in the universe. The marshmallow of faith is gone.
We are condemned to freedom." A Prairie Home Companion, September 15 2007.
(In the world of the script, it's on a DVD called "Douleur Magnifique".)




More information about the ubuntu-users mailing list