From: Matthias A. <mat...@gm...> - 2020-09-24 17:22:20
|
Am 21.09.20 um 03:56 schrieb Chris James: > Hi, > > I’ve been having issues (potential bug) with the polling interval using fetchmail-6.4.8 > > I’m running FreeBSD 11.3 inside an iocage jail. The package was pulled from the ‘quarterly’ repository, and is the latest currently available from that source. I’ve checked the bug tracker and see nothing related, nor any fix in releases 6-4-9 >> 6-4-12. > > My mail stack is comprised of: > > - fetchmail > - postfix > - rspamd > - dovecot > > The full stack has been operating for months with no issues. > > Fetchmail is running in daemon mode, with the config file located at: > > /usr/local/etc/fetchmailrc > > … and (redacted) contains: > > set daemon 180 > > set postmaster root > set invisible > set no bouncemail > > set no spambounce > set no softbounce # permanently delete undeliverable mail - use only when tested > > set logfile /var/log/fetchmail.log > set idfile /var/mail/uid.list > > # server section - XXXXXXXX.net <http://xxxxxxxx.net/> > > poll XXXXXXXX.net <http://xxxxxxxx.net/> aka {IP} protocol POP3 options uidl timeout 30 > > user “XXX...@XX... <mailto:ch...@XX...>" with pass “XXX-password-redacted-XXX" is “XXX-user-XXX" here sslproto '' fetchall nokeep norewrite preconnect "date >> /var/log/fetchmail.log” > > This adds a time stamp to the log file for every fetch. There are other mailboxes that pull from the same server using essentially the same config (sans the ‘preconnect’ assertion). > >>>> BEHAVIOUR >>> Changing the value of “set daemon” in /usr/local/etc/fetchmailrc has no effect - fetchmail continues to poll every 900 seconds, irrespective of the value set here. I have made repeated changes to the interval (300 seconds, 180 seconds, 120 seconds, 60 seconds) with service fetchmail restart issued after each change, but the polling interval remains at 900 seconds. > However, editing the file: /usr/local/etc/rc.d/fetchmail > … and changing > > : ${fetchmail_config="/usr/local/etc/fetchmailrc"} > : ${fetchmail_polling_interval=“900"} > > … to > > : ${fetchmail_config="/usr/local/etc/fetchmailrc"} > : ${fetchmail_polling_interval="300"} > > … causes the polling interval to change to 300 seconds, irrespective of the value specified in the /usr/local/etc/fetchmailrc settings file. Thus, it appears that when the daemon starts, it correctly loads the configuration from the fetchmailrc file (since it pulls emails according to the config) but subsequently overrides the polling interval with the setting in /rc.d/fetchmail. > > Incidentally, I now get entries in my daily security report: > > Checking for packages with mismatched checksums: > fetchmail-6.4.8: /usr/local/etc/rc.d/fetchmail > > … which is to be expected following the change to /usr/local/etc/rc.d/fetchmail > > From the (redacted, annotated) /var/log/fetchmail.log: > > Thu Sep 17 11:52:49 AEST 2020 > Thu Sep 17 12:07:59 AEST 2020 > Thu Sep 17 12:23:08 AEST 2020 ### polling interval every 15 minutes, despite ’set daemon 300' > Thu Sep 17 12:38:17 AEST 2020 > Thu Sep 17 12:53:26 AEST 2020 > Thu Sep 17 13:08:35 AEST 2020 > Thu Sep 17 13:23:44 AEST 2020 > Thu Sep 17 13:38:54 AEST 2020 > fetchmail: 1 message for XXX...@XX... <mailto:ch...@XX...> at XXXXXXXX.net <http://xxxxxxxx.net/> (72268 octets). > fetchmail: reading message XXX...@XX... <mailto:ch...@XX...>@XXXXXXXX.net:1 of 1 (72268 octets) flushed ### successful fetch > > fetchmail: terminated with signal 15 ### edited fetchmailrc to ‘set daemon 180’; service fetchmail restart issued > fetchmail: starting fetchmail 6.4.8 daemon > Thu Sep 17 13:47:20 AEST 2020 > Thu Sep 17 13:47:21 AEST 2020 > Thu Sep 17 14:02:34 AEST 2020 ### polling interval still at every 15 minutes, despite ’set daemon 180' > > fetchmail: terminated with signal 15 ### edited rc.d/fetchmail to ‘${fetchmail_polling_interval="300"}’; service fetchmail restart issued > fetchmail: starting fetchmail 6.4.8 daemon > Thu Sep 17 14:11:18 AEST 2020 > Thu Sep 17 14:11:19 AEST 2020 > fetchmail: 1 message for XXX...@XX... <mailto:ch...@XX...> at XXXXXXXX.net <http://xxxxxxxx.net/> (80421 octets). > fetchmail: reading message XXX...@XX... <mailto:ch...@XX...>@XXXXXXXX.net:1 of 1 (80421 octets) flushed ### successful fetch > Thu Sep 17 14:16:36 AEST 2020 > Thu Sep 17 14:21:45 AEST 2020 ### polling interval now at every 5 minutes, after editing /usr/local/etc/rc.d/fetchmail despite ’set daemon 180' > Thu Sep 17 14:27:02 AEST 2020 > Thu Sep 17 14:32:20 AEST 2020 > > Let me know if you need any further information, or if I’m overlooking something obvious. So just to make the explanation explicit and perhaps reword what Peter Pentchev was already stating, * the FreeBSD rcfile (rc.conf and thereabouts) indeed overrides the daemon interval you're setting in fetchmailrc. * the shell syntax in : ${fetchmail_polling_interval=“900"} may not be obvious but is well-formed Bourne shell. It follows sourcing the rc.conf* like files, and this shell line means that the fetchmail_polling_interval variable will be set to 900 if unset, meaning that you can add a line fetchmail_polling_interval=180 to, say, /etc/rc.conf.local and then FreeBSD's .../etc/rc.d/fetchmail will continue with that instead. There is usually no need to modify FreeBSD's rc.d/* scripts. HTH Matthias |