[fetchmail]Fetchmail daemon mode

Bill Greganti t20030101@greganti.com
Mon, 18 Apr 2005 21:19:46 -0700


> -----Original Message-----
> From: fetchmail-friends-admin@lists.ccil.org 
> [mailto:fetchmail-friends-admin@lists.ccil.org] On Behalf Of 
> Matthias Andree
> Sent: Sunday, April 17, 2005 12:36 PM
> To: fetchmail-friends@lists.ccil.org
> Subject: Re: [fetchmail]Fetchmail daemon mode
> 
> > Actually, the daemon runs as the user fetchmail by default, not as
> > root.
> 
> Is this something you're doing explicitly? Just running fetchmail as
> root user will not drop privileges.

That's seems to be the default for the Debian package.  I haven't 
changed anything.

> Then run them round-robin according to a particular schedule, with
> explicitly giving -d0 to override possible "set daemon 600" options in
> user configuration files. This also defangs nonsense such as 
> "set daemon 1" which would put fetchmail in a tight loop.

The would require me to make a cron job for each user that uses 
fetchmail, unless I'm missing some clever way to automate this.

> > Not being real familiar with fetchmail yet, does anyone see 
> > a problem with thousands of processes running?
> 
> You don't want to do that on very old operating systems or if you're
> short on memory.

The machine is an Athlon XP 2200 with 1GB of memory.  I guess 
I'm just a little too used to working with Windows machines where 
10 processes running crashes the machine. :)

> > Also, in the spirit of using a single fetchmail process 
> > against the advice given, does anyone see problem with 
> > writing a script to conpile all of the
> > ~/.fetchmailrc files into /etc/fetchmailrc?
> 
> A server that causes timeouts delays mail for all other 
> users, with many
> servers to poll up to the point where a single run of that single run
> control file takes longer to process than your users are willing to
> accept.

Doh!  With thousands of users that could pose a real problem in the 
future.  It becomes too likely that one server will gum up the whole
process at some point.

I went back and found the script I was looking for, which starts a 
fetchmail daemon at boot time for each user which has a .fetchmailrc 
file in their home directory.  After thinking about it, as the daemons 
start, with a poll interval of say 10 minutes, they'll all be spread
out over a few minutes.  So I shouldn't have thousands of processes all 
waking up at the same time, more like a few every second spread out over
a period of time.  That doesn't seem so bad I guess.

Thanks for all the help so far.