Skip to content

Commit ba4d0d2

Browse files
committed
imap: disallow imap_force_tls=yes under imap_support_tls=no
The admin should make up his mind.
1 parent 82d49b5 commit ba4d0d2

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

mra/imap/main.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -492,8 +492,13 @@ int main(int argc, char **argv)
492492
}
493493

494494
auto imap_force_tls = parse_bool(g_config_file->get_value("imap_force_tls"));
495-
if (imap_support_tls && imap_force_tls)
496-
printf("[imap]: imap MUST be running with TLS\n");
495+
if (imap_force_tls) {
496+
if (!imap_support_tls) {
497+
fprintf(stderr, "Cannot combine imap_force_tls=yes with imap_support_tls=no.\n");
498+
return EXIT_FAILURE;
499+
}
500+
printf("[imap]: imap connections MUST be using TLS\n");
501+
}
497502
if (!imap_support_tls && listen_tls_port > 0)
498503
listen_tls_port = 0;
499504
if (listen_tls_port > 0)

0 commit comments

Comments
 (0)