idea stolen ;-) from http://linux.manuelschwab.de/?p=152
fetchmail.pl doesn't write a logfile, but in some cases that would be useful.
a) no logging = current script
b) normal logging
$ret=`/usr/bin/fetchmail -L /var/log/fetchmail`;
c) verbose logging
$ret=`/usr/bin/fetchmail -v >>/var/log/fetchmail`;
(Note: I just copied the commands from the page, needs to be checked)
The config options could be
- $logfile = "/var/log/fetchmail" # needs to be writeable for the user running the fetchmail cronjob!
- $loglevel = 0; # 0 = no logging, 1 = normal log, 2 = verbose log
(Using logger, log4perl or something like that would avoid the permission requirement on fetchmail.log, but probably means more work)