diff options
author | Matthias Andree <matthias.andree@gmx.de> | 2021-10-31 12:53:45 +0100 |
---|---|---|
committer | Matthias Andree <matthias.andree@gmx.de> | 2021-10-31 12:55:32 +0100 |
commit | 56e8f9b656fdc8bbec569b6ac5deb6fe66c62aed (patch) | |
tree | 597e762f3c25b01c3183329ebda3733b75b04305 /imap.c | |
parent | b93af8e832b1b13b82ef6485dd8ddca08fc1340c (diff) | |
download | fetchmail-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.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -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; } |