From 78ca6d0a7c43715be44bf953da7f68f4d0827006 Mon Sep 17 00:00:00 2001 From: Matthias Andree Date: Mon, 29 Mar 2021 16:52:17 +0200 Subject: fetchmail.c: LMTP don't validate "port" on UNIX-domain sockets (those with a file path). Closes: #33 --- fetchmail.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'fetchmail.c') diff --git a/fetchmail.c b/fetchmail.c index 9644aea0..a345e2fa 100644 --- a/fetchmail.c +++ b/fetchmail.c @@ -1421,9 +1421,10 @@ static int load_params(int argc, char **argv, int optind) { char *cp; - if (!(cp = strrchr(idp->id, '/')) - || (0 == strcmp(cp + 1, SMTP_PORT)) - || servport(cp + 1) == SMTP_PORT_NUM) + if ((idp->id[0] != '/') /* do not port-check UNIX paths */ && + (!(cp = strrchr(idp->id, '/')) + || (0 == strcmp(cp + 1, SMTP_PORT)) + || servport(cp + 1) == SMTP_PORT_NUM)) { (void) fprintf(stderr, GT_("%s configuration invalid, LMTP can't use default SMTP port\n"), -- cgit v1.2.3