aboutsummaryrefslogtreecommitdiffstats
path: root/fetchmail.c
diff options
context:
space:
mode:
Diffstat (limited to 'fetchmail.c')
-rw-r--r--fetchmail.c41
1 files changed, 29 insertions, 12 deletions
diff --git a/fetchmail.c b/fetchmail.c
index a345e2fa..30500073 100644
--- a/fetchmail.c
+++ b/fetchmail.c
@@ -55,9 +55,9 @@
#endif /* ENETUNREACH */
#ifdef SSL_ENABLE
+#include "tls-aux.h" /* compatibility and helper functions */
#include <openssl/ssl.h> /* for OPENSSL_NO_SSL2 and ..._SSL3 checks */
#include <openssl/opensslv.h> /* for version queries */
-#include "tls-aux.h" /* compatibility and helper functions */
#endif
/* prototypes for internal functions */
@@ -146,11 +146,11 @@ static void printcopyright(FILE *fp) {
" Robert M. Funk, Graham Wilson\n"
"Copyright (C) 2005 - 2012 Sunil Shetye\n"
"Copyright (C) 2005 - %d Matthias Andree\n"
- ), 2021);
+ ), 2024);
fprintf(fp, GT_("Fetchmail comes with ABSOLUTELY NO WARRANTY. This is free software, and you\n"
"are welcome to redistribute it under certain conditions. For details,\n"
"please see the file COPYING in the source or documentation directory.\n"));
-#ifdef SSL_ENABLE
+#if defined(SSL_ENABLE) && !defined(USING_WOLFSSL)
/* Do not translate this */
fprintf(fp, "This product includes software developed by the OpenSSL Project\nfor use in the OpenSSL Toolkit. (http://www.openssl.org/)\n");
#endif
@@ -270,7 +270,11 @@ int main(int argc, char **argv)
#ifndef SSL_ENABLE
"-SSL"
#else
+#ifdef USING_WOLFSSL
+ "+WOLFSSL"
+#else
"+SSL-SSLv2"
+#endif
#if (HAVE_DECL_SSLV3_CLIENT_METHOD + 0 == 0) || defined(OPENSSL_NO_SSL3)
"-SSLv3"
#endif
@@ -313,12 +317,15 @@ int main(int argc, char **argv)
printf(GT_("OpenSSL: %s\nEngines: %s\n"),
OpenSSL_version(OPENSSL_DIR),
OpenSSL_version(OPENSSL_ENGINES_DIR));
-#if !HAVE_DECL_TLS1_3_VERSION || defined(OPENSSL_NO_TLS1_3)
+# if !HAVE_DECL_TLS1_3_VERSION || defined(OPENSSL_NO_TLS1_3)
printf(GT_("WARNING: Your SSL/TLS library does not support TLS v1.3.\n"));
-#endif
-#ifdef LIBRESSL_VERSION_NUMBER
- printf(GT_("WARNING: Compiled against LibreSSL, which is not a supported configuration.\n"));
-#endif
+# endif
+# if defined(LIBRESSL_VERSION_NUMBER) && !defined(__OpenBSD__)
+ /* OpenBSD ships LibreSSL as part of the base system, so is exempt
+ * because it can pull the GPL v2 clause 3 exception */
+ printf(GT_("ERROR: Compiled against LibreSSL, which is a copyright violation for lack of GPL clause 2b exception. See COPYING. Aborting.\n"));
+ exit(PS_UNDEFINED);
+# endif
#else
printf(GT_("WARNING: Compiled without SSL/TLS.\n"));
#endif
@@ -350,13 +357,13 @@ int main(int argc, char **argv)
xfree(run.logfile);
}
-#if 0
+# if 0
/* not in daemon mode -> turn off logfile option */
if (0 == run.poll_interval) {
if (outlevel >= O_NORMAL) { fprintf(stderr, GT_("Not running in daemon mode, ignoring logfile option.\n")); }
xfree(run.logfile);
}
-#endif
+# endif
/* log file not writable -> turn off logfile option */
if (run.logfile && 0 != access(run.logfile, F_OK)) {
@@ -765,7 +772,7 @@ int main(int argc, char **argv)
/* Boldly assume that we also have res_init() if we have
* res_search(), and call res_init() to re-read the resolv.conf
* file, so that we can pick up changes to that file that are
- * written by dhpccd, dhclient, pppd, openvpn and similar. */
+ * written by dhcpcd, dhclient, pppd, openvpn and similar. */
/* NOTE: This assumes that /etc/resolv.conf is written
* atomically (i. e. a temporary file is written, flushed and
@@ -996,7 +1003,7 @@ static void optmerge(struct query *h2, struct query *h1, int force)
list_merge(&h2->antispam, &h1->antispam, force);
#define FLAG_MERGE(fld) do { if (force ? !!h1->fld : !h2->fld) h2->fld = h1->fld; } while (0)
-#define STRING_MERGE(fld) do { if (force ? !!h1->fld : !h2->fld) { if (h2->fld) free((void *)h2->fld), h2->fld = 0; if (h1->fld) h2->fld = xstrdup(h1->fld); } } while (0)
+#define STRING_MERGE(fld) do { if (force ? !!h1->fld : !h2->fld) { if (h2->fld) free((void *)h2->fld), h2->fld = 0; if (h1->fld) { if (h1->fld != STRING_DISABLED) h2->fld = xstrdup(h1->fld); else h2->fld = STRING_DISABLED; } } } while (0)
STRING_MERGE(server.via);
FLAG_MERGE(server.protocol);
STRING_MERGE(server.service);
@@ -1412,6 +1419,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 normally need port 995/service pop3s for --ssl.\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 normally need port 993/service imaps for --ssl.\n"), ctl->server.pollname);
+ break;
+ }
}
if (ctl->listener == LMTP_MODE)
{