From f105a27e68c304a6f3e0de8fdcc9bd234c781508 Mon Sep 17 00:00:00 2001 From: Vladimir Dubrovin <3proxy@3proxy.ru> Date: Wed, 18 Nov 2026 20:50:28 +0300 Subject: [PATCH] smtpp: a login name of a port alone names no destination --- src/common.c | 3 +++ src/smtpp.c | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/src/common.c b/src/common.c index 9595fac..2e670cb 100644 --- a/src/common.c +++ b/src/common.c @@ -587,6 +587,9 @@ int parsehostname(char *hostname, struct clientparam *param, uint16_t port){ port = atoi(sp+1); *sp = ':'; } + /* A port alone overrides the port of a host already set; without + one it names no destination to connect to. */ + if(!param->hostname || !*param->hostname) return 1; *SAPORT(¶m->req) = htons(port); return 0; } diff --git a/src/smtpp.c b/src/smtpp.c index 3905bf0..25d5fa6 100644 --- a/src/smtpp.c +++ b/src/smtpp.c @@ -195,6 +195,10 @@ void * smtppchild(struct clientparam* param) { } } + /* A login has to end with a host to connect to: what follows reads the + host name, and without one there is nowhere to go. */ + if(!param->hostname || !param->extusername){RETURN(669);} + #ifndef WITHMAIN { int action, reqbufsize, reqsize;