Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 3 Mar 2002 01:29:33 +0200
From:      Giorgos Keramidas <keramida@ceid.upatras.gr>
To:        Lord Raiden <raiden23@netzero.net>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Fetchmail Questions
Message-ID:  <20020302232933.GB99866@hades.hell.gr>
In-Reply-To: <4.2.0.58.20020302014811.009c1e90@pop.netzero.net>
References:  <4.2.0.58.20020302014811.009c1e90@pop.netzero.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On 2002-03-02 01:57, Lord Raiden wrote:
> Ok, couple of quick questions about fetchmail.
> 
> Choice 1 will allow the user to have their mail automatically fetched by
> fetchmail for them every 15 minutes.

That can easily be done with a cron job.

> Looking for a way to setup fetchmail so that as a second choice they can
> login and fetchmail kicks in automatically rather than having it do its
> thing via cron.

If you have a cron job already set up that calls fetchmail every 5 minutes,
you can add to their startup profiles:

	$ grep fetchmail .profile
	( fetchmail -a -K -d 300 || fetchmail ) 2>&1 >/dev/null

This will attempt to fire-up fetchmail in 'daemon mode'.  When run in
daemon mode, fetchmail will fork and stay in the background, fetching mail
every X seconds, where X is the number passed to the -d option.  If that
fails, there is usually another fetchmail running in daemon mode already,
and simply running 'fetchmail' (the second part of that command) will wake
up the sleeping daemonized fetchmail process.

If you go down this route, make sure you don't simply call 'fetchmail' in
the crontab, otherwise the fetchmail spawned by cron will attempt to run
while a daemon is already running, and print an error message, which (being
run from a crontab) will cause a mail message with the error to be mailed
to the user *every* 5 minutes!  In case you choose to have a fetchmail
daemon running from the loginn shell startup scripts, you will probably
have to wrap fetchmail's used in crontabs in some script that redirects all
output to /dev/null.

Giorgos Keramidas                       FreeBSD Documentation Project
keramida@{freebsd.org,ceid.upatras.gr}  http://www.FreeBSD.org/docproj/

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020302232933.GB99866>