diff options
author | Matthias Andree <matthias.andree@gmx.de> | 2021-08-26 23:53:14 +0200 |
---|---|---|
committer | Matthias Andree <matthias.andree@gmx.de> | 2021-08-26 23:53:14 +0200 |
commit | 5b22b38daf3f94eadfa0667ae799bcd0f9ee40b9 (patch) | |
tree | 506710dde657bfc9bbb9c659b490368c01daf540 /fetchmail.c | |
parent | 9ef9cd28d92980b266196925784ab43bb812a839 (diff) | |
download | fetchmail-5b22b38daf3f94eadfa0667ae799bcd0f9ee40b9.tar.gz fetchmail-5b22b38daf3f94eadfa0667ae799bcd0f9ee40b9.tar.bz2 fetchmail-5b22b38daf3f94eadfa0667ae799bcd0f9ee40b9.zip |
sanity check well-known POP3/IMAP ports vs. SSL
Gitlab: Closes #31.
(cherry picked from commit da6eb347af326912560f56081d603a0a78c3d56d)
Diffstat (limited to 'fetchmail.c')
-rw-r--r-- | fetchmail.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/fetchmail.c b/fetchmail.c index 6ca9db94..ddac95df 100644 --- a/fetchmail.c +++ b/fetchmail.c @@ -1412,6 +1412,16 @@ static int load_params(int argc, char **argv, int optind) ctl->server.pollname); exit(PS_SYNTAX); } + switch (ctl->server.protocol) { + case P_POP3: case P_APOP: + if (port == 995 && !ctl->use_ssl) report(stderr, GT_("WARNING: %s configuration invalid, you normally need --ssl for port 995/service pop3s.\n"), ctl->server.pollname); + if (port == 110 && ctl->use_ssl) report(stderr, GT_("WARNING: %s configuration invalid, you should normally omit --ssl for port 110/service pop3.\n"), ctl->server.pollname); + break; + case P_IMAP: + if (port == 993 && !ctl->use_ssl) report(stderr, GT_("WARNING: %s configuration invalid, you normally need --ssl for port 993/service imaps.\n"), ctl->server.pollname); + if (port == 143 && ctl->use_ssl) report(stderr, GT_("WARNING: %s configuration invalid, you should normally omit --ssl for port 143/service imap.\n"), ctl->server.pollname); + break; + } } if (ctl->listener == LMTP_MODE) { |