From: Peter P. <ro...@ri...> - 2020-09-10 22:12:08
|
On Thu, Sep 10, 2020 at 01:43:36PM -0700, James Moe via Fetchmail-users wrote: > On 9/10/20 10:36 AM, Dennis Putnam wrote: > > > Has anyone figured out how to add a timestamp on the fetchmail log > > messages to the maillog? TIA > > > Not that I ever found. > My configuration file has these entries as a workaround: > > set logfile "/path/to/fetchmail.log" > poll example.com interval 1 > protocol imap username "account_name_of_interest" password "secret" > preconnect "echo `date +%Y-%m-%dT%H:%M:%S` <account_name_of_interest> >> > /path/to/fetchmail.log > ... other stuff ... > > It does result in an entry for every time fetchmail connects to a server to > check for mail even if no mail is available. Huh... I guess I never thought I'd need that, since I've always run fetchmail in daemon mode with the -v option, and (at least for a long time, maybe always) it outputs lines like: fetchmail: 6.4.8 querying mail.example.com (protocol IMAP) at 11.09.2020 (пт) 0:46:26: poll started ... fetchmail: 6.4.8 querying mail.example.com (protocol IMAP) at 11.09.2020 (пт) 0:48:26: poll completed fetchmail: sleeping at 11.09.2020 (пт) 0:48:26 for 120 seconds (the "пт" part is the Bulgarian abbreviation for "Friday") Other than that, I'd suggest somehow running a combination of fetchmail and one of the logging tools like Prof. Bernstein's "multilog", but that would require a reliable mechanism of starting both processes and making sure both of them keep running, and there are not so many ways of doing that if not using a service supervision framework like daemontools, runit, s6, or similar. Of course, one could always write a simple Perl / Python / Ruby / Rust / maybe even C program that starts two processes and kills them both if anything bad happens, but that's not what I'd consider an easy general solution. G'luck, Peter -- Peter Pentchev ro...@ri... ro...@de... pp...@st... PGP key: http://people.FreeBSD.org/~roam/roam.key.asc Key fingerprint 2EE7 A7A5 17FC 124C F115 C354 651E EFB0 2527 DF13 |