From: Stoiko Ivanov <s.ivanov@proxmox.com>
To: pmg-devel@lists.proxmox.com
Subject: [pmg-devel] [PATCH pmg-api 1/2] fix #6798: fetchmail: adapt to changed sslproto semantics
Date: Wed, 24 Sep 2025 13:32:30 +0200 [thread overview]
Message-ID: <20250924113247.50931-3-s.ivanov@proxmox.com> (raw)
In-Reply-To: <20250924113247.50931-1-s.ivanov@proxmox.com>
fetchmail defaults to verifying certificates since version 6.4.0
see fetchmail(1)
- sslproto defaults to auto instead of ''
- when sslproto is not '' then implicit/opportunistic TLS (StartTLS)
is tried over the plain-text port
- this results in the current config parsing and writing to always
try a TLS-connection if the server offers starttls
additionally sslcertck (only accept trusted certificates) defaults to
true since 6.4.0
The combination of these two things has as a consequence, that
unsetting 'use SSL' will fail for servers which have a self-signed
certificate installed (I expect many to still do so).
This patch simply fixes the 'use SSL' flag to disable all TLS
(explicit and opportunistic) and thus keep the expectations of users.
I did consider changing this to:
* either add a checkbox to ignore an invalid certificate.
* allow users to provide a fingerprint instead (not considered
further as fetchmail (in trixie) uses MD5 fingerprints, and this
seems a step back).
Since we ship versions with the semantic change since PMG 6.x (buster
shipped 6.4.0~beta43[0]) I don't think many users who use fetchmail
ran into this (also most ISPs/Mail providers have valid certificates
nowadays), the potential for regression should not be large.
We could consider deprecating plain-text IMAP/POP in a future version,
but I'd announce the deprecation with 9.0 to give it some visibility.
[0] https://manpages.debian.org/buster/fetchmail/fetchmail.1.en.html
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
---
src/PMG/Fetchmail.pm | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/src/PMG/Fetchmail.pm b/src/PMG/Fetchmail.pm
index 3a647420..c35e03d8 100644
--- a/src/PMG/Fetchmail.pm
+++ b/src/PMG/Fetchmail.pm
@@ -143,6 +143,11 @@ sub read_fetchmail_conf {
my $finalize_item = sub {
my ($item) = @_;
+
+ if ($item->{ssl} && !$item->{ssl_proto}) {
+ die "conflicting SSL settings for $item->{id}\n" if $item->{enabled};
+ }
+
$cfg->{ $item->{id} } = $item;
};
@@ -174,6 +179,8 @@ sub read_fetchmail_conf {
$item->{port} = $get_token_argument->();
} elsif ($token eq 'interval') {
$item->{interval} = $get_token_argument->();
+ } elsif ($token eq 'sslproto') {
+ $item->{sslproto} = $get_token_argument->();
} elsif (
$token eq 'ssl'
|| $token eq 'keep'
@@ -210,7 +217,11 @@ sub write_fetchmail_conf {
}
$set_fetchmail_defaults->($item);
my $options = ['dropdelivered'];
- push @$options, 'ssl' if $item->{ssl};
+ if ($item->{ssl}) {
+ push @$options, 'ssl';
+ } else {
+ push @$options, ('sslproto', '\'\'');
+ }
push @$options, 'keep' if $item->{keep};
$item->{options} = join(' ', @$options);
$data->{$id} = $item;
--
2.47.3
_______________________________________________
pmg-devel mailing list
pmg-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pmg-devel
next prev parent reply other threads:[~2025-09-24 11:32 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-24 11:32 [pmg-devel] [PATCH pmg-api/package-rebuilds] improve fetchmail handling in PMG Stoiko Ivanov
2025-09-24 11:32 ` [pmg-devel] [PATCH 1/1 package-rebuilds] fetchmail: improve shipped service file Stoiko Ivanov
2025-09-24 11:32 ` Stoiko Ivanov [this message]
2025-09-24 11:32 ` [pmg-devel] [PATCH pmg-api 2/2] templates: fetchmail: add comment where users can manual accounts Stoiko Ivanov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250924113247.50931-3-s.ivanov@proxmox.com \
--to=s.ivanov@proxmox.com \
--cc=pmg-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox