I have fetchmail daemon set to 60 seconds in the fetchmailrc file. However it takes up to 8 minutes and sometimes even more to start fetching.

Here is my fetchmailrc:

set daemon 60
set postmaster "root"
set syslog
set logfile "/var/log/fetchmail.log"
set no bouncemail
set spambounce
poll pop.gmail.com with proto pop3
user "user@gmail.com" there with password "mypassword" is root here
  no keep
  no rewrite
  mda "/usr/bin/procmail -f %F -d %T";

The reason I have to have the time to 60 seconds is because we collect telemetry data (pressure and temperature) from different sites around Africa. The mails are piped to procmail and then sent to MySql. A "realtime" graph is then created and available to our maintenance team.

Waiting longer than a minute or 2 for fetchmail is not really desireable.

Any pointers?

  • How large are the mail messages that you fetch in this way? – Kusalananda Nov 22 '18 at 14:00
  • between 5kb to 15kb ... consists of numerical values and sensors location and serial number – Danny Nov 22 '18 at 14:11

Many POP3 servers "discourage" too frequent polling.


IMAP with IDLE command

You can use IMAP with IDLE command instead of POP3.

Both fetchmail (program) and gmail (email provider) support IMAP with IDLE.

It would require one fetchmail process per one monitored IMAP account.
fetchamil will keep one IMAP session open permanently.
You should get "near real time" notifications about new emails.

man fetchmail

--idle (since 6.3.3)
(Keyword: idle, since before 6.0.0)
Enable IDLE use (effective only with IMAP). Note that this works with only one folder at a given time. While the idle rcfile keyword had been supported for a long time, the --idle command-line option was added in version 6.3.3. IDLE use means that fetchmail tells the IMAP server to send notice of new messages, so they can be retrieved sooner than would be possible with regular polls.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.