From 28b1f7b5a5d85bbe853b158ce82989e50adb8a89 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Fri, 20 Nov 1998 22:40:09 +0000 Subject: Fix the LMTP port sanity check. svn path=/trunk/; revision=2195 --- fetchmail.c | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/fetchmail.c b/fetchmail.c index df09ca1c..499a4ea5 100644 --- a/fetchmail.c +++ b/fetchmail.c @@ -1062,12 +1062,29 @@ static int load_params(int argc, char **argv, int optind) ctl->server.pollname); exit(PS_SYNTAX); } - if (ctl->server.port == 25 && ctl->listener == LMTP_MODE) + if (ctl->listener == LMTP_MODE) { - (void) fprintf(stderr, - "%s configuration invalid, LMTP can't use SMTP port", - ctl->server.pollname); - exit(PS_SYNTAX); + struct idlist *idp; + + for (idp = ctl->smtphunt; idp; idp = idp->next) + { + char *cp; + + if ((cp = strrchr(idp->id, '/'))) + { +#ifdef INET6 + if (strcmp(++cp, SMTP_PORT) == 0) +#else + if (atoi(++cp) == SMTP_PORT) +#endif /* INET6 */ + { + (void) fprintf(stderr, + "%s configuration invalid, LMTP can't use SMTP port", + ctl->server.pollname); + exit(PS_SYNTAX); + } + } + } } #endif /* !INET6 */ } -- cgit v1.2.3