[pmg-devel] [PATCH pmg-api v2 0/2] improve fetchmail handling in PMG

Max R. Carrara m.carrara at proxmox.com
Fri Sep 26 14:07:58 CEST 2025


On Wed Sep 24, 2025 at 8:05 PM CEST, Stoiko Ivanov wrote:
> supersedes: https://lore.proxmox.com/pmg-devel/20250924113247.50931-1-s.ivanov@proxmox.com/T/#t
>
> v1->v2:
> * rework the commit messages after reading them through.
>
> pmg-api:
> Stoiko Ivanov (2):
>   fix #6798: fetchmail: adapt to changed sslproto semantics
>   templates: fetchmail: add comment where users can add manual accounts
>
>  src/PMG/Fetchmail.pm         | 13 ++++++++++++-
>  src/templates/fetchmailrc.tt |  3 +++
>  2 files changed, 15 insertions(+), 1 deletion(-)
>
> package-rebuilds:
> Stoiko Ivanov (1):
>   fetchmail: improve shipped service file
>
>  pkgs/fetchmail/fetchmail-6.4.39/debian/fetchmail.service | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

Gave this series a spin on my most recent two-node cluster I set up for
testing.

Note: Instead of applying and building our rebuild of `fetchmail`, I
used systemd overrides (via `systemctl edit fetchmail.service`) to set
the options in patch #3; has the same effect, but saved me some time.

- Smoke-tested patch #1 by setting up fetchmail for our mailserver via
  IMAP, using SSL, my own credentials as well as a dummy recipient

- Mails were fetched successfully according to the logs
  --> Mail server using a cert that isn't self-signed works (patch #1)

- `fetchmail.service` exited gracefully after disabling the user's
  entry (patch #3)

○ fetchmail.service - fetchmail mail retriever agent
     Loaded: loaded (/usr/lib/systemd/system/fetchmail.service; enabled; preset: enabled)
    Drop-In: /etc/systemd/system/fetchmail.service.d
             └─override.conf
     Active: inactive (dead) since Fri 2025-09-26 13:01:10 CEST; 4min 25s ago
   Duration: 5min 211ms
 Invocation: ca50a0619b934676b631588b4d337980
       Docs: man:fetchmail(1)
    Process: 6690 ExecCondition=/bin/sh -c [ "$START_DAEMON" = "yes" ] (code=exited, status=0/SUCCESS)
    Process: 6693 ExecStart=/usr/bin/fetchmail --daemon 300 $OPTIONS --nodetach -f /etc/fetchmailrc --pidfile /run/fetchmail/fetchmail.pid (code=exited, status=3)
   Main PID: 6693 (code=exited, status=3)
   Mem peak: 3.1M
        CPU: 24ms

Sep 26 12:56:10 pmg-9-beta-01 systemd[1]: Starting fetchmail.service - fetchmail mail retriever agent...
Sep 26 12:56:10 pmg-9-beta-01 systemd[1]: Started fetchmail.service - fetchmail mail retriever agent.
Sep 26 12:56:10 pmg-9-beta-01 fetchmail[6693]: fetchmail: starting fetchmail 6.4.39 daemon
Sep 26 12:56:10 pmg-9-beta-01 fetchmail[6693]: 824 messages (824 seen) for m.carrara at proxmox.com at proxmox0001.
Sep 26 13:01:10 pmg-9-beta-01 fetchmail[6693]: fetchmail: restarting fetchmail (/etc/fetchmailrc changed)
Sep 26 13:01:10 pmg-9-beta-01 fetchmail[6693]: fetchmail: starting fetchmail 6.4.39 daemon
Sep 26 13:01:10 pmg-9-beta-01 fetchmail[6693]: fetchmail: All connections are wedged.  Exiting.
Sep 26 13:01:10 pmg-9-beta-01 systemd[1]: fetchmail.service: Deactivated successfully.

So, exit code 3 is interpreted as a successful exit status by systemd.
Admins will still have to `systemctl restart fetchmail.service` if they
re-enable all fetchmail users again, but now the service doesn't die
on the spot anymore if no users are enabled. Neat!

So, overall LGTM; see the comments inline in patch #2 and #3 though.
Those can be addressed when applying the series, so I don't think a
v3 is necessary.

Consider:

Tested-by: Max R. Carrara <m.carrara at proxmox.com>
Reviewed-by: Max R. Carrara <m.carrara at proxmox.com>




More information about the pmg-devel mailing list