Praedor Atrebates grabbed a keyboard and wrote:
>
> Thanks all, I have it working in a desireable fashion now.
>
> I am once again using fetchmail + postfix and, now, spamassassin to deal
> with my incoming mail. Procmail is properly directing a subset of my mail
> to my mailbox directly and passing the rest through spamassassin - and a
> 30+ second delay for spamassassin processing isn't a problem. Procmail is
> also /dev/nulling all emails identified as spam so I never have to see any
> of it. Nice.
>
> A new question now. Fetchmail gave me a bit of a fit at first. I ran
> fetchmailconf as user and then ran fetchmail as user and this was fine,
> except I'd rather not have to start fetchmail myself every time I start my
> laptop up - I'd rather have it run as a daemon. I DID get the fetchmail
> daemon working eventually, but only after manually editing
> /etc/fetchmailrc.
> As root or user, all running fetchmailconf would do is create a
> ~/.fetchmailrc file while daemon mode requires /etc/fetchmailrc. I tried
> doing it from webmin as well to no avail. In the end, I copied my
> ~/.fetchmailrc file to /etc/fetchmailrc so that I could run the fetchmail
> daemon. How does one normally setup the daemon instead of running
> personal instances of fetchmail, that is, how is /etc/fetchmailrc normally
> created? I am assuming that I should not have to do what I did above and
> copy my personal .fetchmailrc to /etc/fetchmailrc.
>From the man page for fetchmail:
The --daemon <interval> or -d <interval> option runs fetchmail in dae-
mon mode. You must specify a numeric argument which is a
polling interval in seconds.
In daemon mode, fetchmail puts itself in background and runs forever,
querying each specified host and then sleeping for the given polling
interval.
Simply invoking
fetchmail -d 900
will, therefore, poll all the hosts described in your ~/.fetchmailrc
file (except those explicitly excluded with the `skip' verb) once every
fifteen minutes.
It is possible to set a polling interval in your ~/.fetchmailrc file by
saying `set daemon <interval>', where <interval> is an integer number
of seconds. If you do this, fetchmail will always start in daemon mode
unless you override it with the command-line option --daemon 0 or -d0.
Only one daemon process is permitted per user; in daemon mode, fetch-
mail makes a per-user lockfile to guarantee this.
Normally, calling fetchmail with a daemon in the background sends a
wakeup signal to the daemon, forcing it to poll mailservers immedi-
ately. (The wakeup signal is SIGHUP if fetchmail is running as root,
SIGUSR1 otherwise.) The wakeup action also clears any `wedged' flags
indicating that connections have wedged due to failed authentication or
multiple timeouts.
The option --quit will kill a running daemon process instead of waking
it up (if there is no such process, fetchmail notifies you). If the
--quit option is the only command-line option, that's all there is to
it.
The quit option may also be mixed with other command-line options; its
effect is to kill any running daemon before doing what the other
options specify in combination with the rc file.
Of course, if you're the only user, you can also setup a cron job for
yourself to poll every 5 minutes or whatever, by simply running fetchmail
from cron.
HTH.
--Dave
Want to buy your Pack or Services from MandrakeSoft?
Go to http://www.mandrakestore.com