aboutsummaryrefslogtreecommitdiffstats
path: root/imap.c
diff options
context:
space:
mode:
authorMatthias Andree <matthias.andree@gmx.de>2021-10-31 12:53:45 +0100
committerMatthias Andree <matthias.andree@gmx.de>2021-10-31 12:55:32 +0100
commit56e8f9b656fdc8bbec569b6ac5deb6fe66c62aed (patch)
tree597e762f3c25b01c3183329ebda3733b75b04305 /imap.c
parentb93af8e832b1b13b82ef6485dd8ddca08fc1340c (diff)
downloadfetchmail-56e8f9b656fdc8bbec569b6ac5deb6fe66c62aed.tar.gz
fetchmail-56e8f9b656fdc8bbec569b6ac5deb6fe66c62aed.tar.bz2
fetchmail-56e8f9b656fdc8bbec569b6ac5deb6fe66c62aed.zip
IMAP: improve STARTTLS error message for ssh-plugin case
For common ssh-based IMAP PREAUTH setups (i. e. those that use a plugin - no matter its contents - and that set auth ssh), change the STARTTLS error message to suggest sslproto '' instead.
Diffstat (limited to 'imap.c')
-rw-r--r--imap.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/imap.c b/imap.c
index f57c3e0f..0580d901 100644
--- a/imap.c
+++ b/imap.c
@@ -489,8 +489,13 @@ static int imap_getauth(int sock, struct query *ctl, char *greeting)
#ifdef SSL_ENABLE
/* Defend against a PREAUTH-prevents-STARTTLS attack */
if (preauth && must_starttls(ctl)) {
- report(stderr, GT_("%s: configuration requires TLS, but STARTTLS is not permitted "
- "because of authenticated state (PREAUTH). Aborting connection. Server permitting, try --ssl instead (see manual).\n"), commonname);
+ if (ctl->server.plugin && A_SSH == ctl->server.authenticate) {
+ report(stderr, GT_("%s: configuration requires TLS, but STARTTLS is not permitted "
+ "because of authenticated state (PREAUTH). Aborting connection. If your plugin is secure, you can defeat STARTTLS with --sslproto '' (see manual).\n"), commonname);
+ } else {
+ report(stderr, GT_("%s: configuration requires TLS, but STARTTLS is not permitted "
+ "because of authenticated state (PREAUTH). Aborting connection. Server permitting, try --ssl instead (see manual).\n"), commonname);
+ }
preauth = FALSE; /* reset for the next session */
return PS_SOCKET;
}