aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>1998-11-20 22:40:09 +0000
committerEric S. Raymond <esr@thyrsus.com>1998-11-20 22:40:09 +0000
commit28b1f7b5a5d85bbe853b158ce82989e50adb8a89 (patch)
tree876f8ec6efcaa15eb1becca36d338b564626594b
parenta7309012d9445a2aa5afb99af5bde1a13ace398a (diff)
downloadfetchmail-28b1f7b5a5d85bbe853b158ce82989e50adb8a89.tar.gz
fetchmail-28b1f7b5a5d85bbe853b158ce82989e50adb8a89.tar.bz2
fetchmail-28b1f7b5a5d85bbe853b158ce82989e50adb8a89.zip
Fix the LMTP port sanity check.
svn path=/trunk/; revision=2195
-rw-r--r--fetchmail.c27
1 files 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 */
}