fetchmail-friends
[Top] [All Lists]

Re: [fetchmail] how do I timestamp local logfile?

2003-07-12 09:08:15
[ This message bounced back to me, so here we go again. ]

David Stutzman <david(_dot_)stutzman(_at_)dstutz(_dot_)com> wrote:

set logfile /home/cgraig/fetchmaillog
poll pop.mail.yahoo.com proto pop3
  user "XXXXX" pass "XXXXX" is cgraig
  nokeep
  fetchall

Accessing a server using POP3, nothing unusual there.

This is fetchmail release 6.2.2+NLS

Ok, that's up to date.

Taking options from command line
No mailservers set up -- perhaps /root/.fetchmailrc is missing?

That's not so good. Have you tried

  fetchmail -f /path/to/.fetchmailrc

instead? I just want to make sure fetchmail knows where to find the
run control file.

I already see one answer to my question...to use daemon mode. That's
the difference between your and his configs. How do you guys kick
off the initial fetchmail daemon mode process for the user when the
box is started up?

Well, I'd probably use something like the following script:

-----8<----------8<----------8<----------8<-----

#!/bin/bash

# Full path to fetchmail binary.
FM_BIN=/usr/local/bin/fetchmail

# Daemon interval (in seconds).
FM_INTERVAL=180

# List of local users for whom fetchmail should be started.
FM_USERS="john mary peter"

for u in $FM_USERS ; do
  su - $u -c "$FM_BIN -f /home/$u/.fetchmailrc \
    -L /home/$u/fetchmail.log -d $FM_INTERVAL" \
    &>/dev/null
done

-----8<----------8<----------8<----------8<-----

I've not tested this, but it should work. You could add the script
somewhere in your boot/autostart process if you like.

-- 
Mit freundlichen Grüßen / Yours sincerely
Dipl. Inform. Ralph Seichter

HORUS-IT
Ahornweg 10
D-57635 Oberirsen
Tel +49 2686 987880
Fax +49 2686 987889
http://horus-it.de/