From owner-freebsd-questions Sat Mar 2 15:29:45 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mailsrv.otenet.gr (mailsrv.otenet.gr [195.170.0.5]) by hub.freebsd.org (Postfix) with ESMTP id 014CB37B402 for ; Sat, 2 Mar 2002 15:29:40 -0800 (PST) Received: from hades.hell.gr (patr530-b140.otenet.gr [212.205.244.148]) by mailsrv.otenet.gr (8.12.2/8.12.2) with ESMTP id g22NTaou028831; Sun, 3 Mar 2002 01:29:37 +0200 (EET) Received: (from charon@localhost) by hades.hell.gr (8.11.6/8.11.6) id g22NTYM25245; Sun, 3 Mar 2002 01:29:34 +0200 (EET) (envelope-from keramida@freebsd.org) Date: Sun, 3 Mar 2002 01:29:33 +0200 From: Giorgos Keramidas To: Lord Raiden Cc: freebsd-questions@freebsd.org Subject: Re: Fetchmail Questions Message-ID: <20020302232933.GB99866@hades.hell.gr> References: <4.2.0.58.20020302014811.009c1e90@pop.netzero.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4.2.0.58.20020302014811.009c1e90@pop.netzero.net> User-Agent: Mutt/1.3.27i Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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