#1134865 fetchmail: The new systemd service constantly dies

Package:
fetchmail
Source:
fetchmail
Description:
SSL enabled POP3, APOP, IMAP mail gatherer/forwarder
Submitter:
Gábor Gombás
Date:
2026-04-25 08:43:02 UTC
Severity:
normal
#1134865#5
Date:
2026-04-25 08:41:42 UTC
From:
To:
Hi,

Since moving away from initscipts, the service randomly dies, and needs
to be restarted manually. The reason is systemd considering perfectly
valid temporary conditions as errors, e.g.:

Apr 25 08:59:36 host.home fetchmail[623351]: fetchlimit 1000 reached; 1874 messages left on server imap.gmail.com account foobar@gmail.com
Apr 25 08:59:36 host.home fetchmail[623351]: Query status=13 (MAXFETCH)
Apr 25 08:59:36 host.home systemd[1]: fetchmail.service: Main process exited, code=exited, status=13/n/a

Reaching fetchlimit is not an error. It is perfectly normal. fetchmail
is expected to start fetching the next batch.

Apr 23 07:27:27 host.home fetchmail[539898]: No mail for foobar@gmail.com at imap.gmail.com (folder whatever)
Apr 23 07:27:27 host.home systemd[1]: fetchmail.service: Main process exited, code=exited, status=1/FAILURE

Not having any incoming mail once in a while is not an error. The
service should keep running and polling for messages.

If you want to make use of systemd instead of letting fetchmail
daemonize itself, as it did with the old initscript, then systemd must
also implement and handle the retry logic for all these conditions.

Regards,
Gabor