From ddb3069bf287af8f0a634110b7bb95203f147b51 Mon Sep 17 00:00:00 2001 From: manuel Date: Fri, 20 Nov 2020 01:03:21 +0100 Subject: Add X-UD-Smtp-Session to unauthed smtp session aswell --- qmail-smtpd.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'qmail-smtpd.c') diff --git a/qmail-smtpd.c b/qmail-smtpd.c index 1036eef..20027b0 100644 --- a/qmail-smtpd.c +++ b/qmail-smtpd.c @@ -63,6 +63,7 @@ char *remotehost; char *remoteinfo; char *local; char *relayclient; +static const stralloc *client_get_session_id(); #ifdef TLS # include @@ -346,6 +347,9 @@ void setup() else #endif dohelo(remotehost); + + /* generate session */ + (void)client_get_session_id(); } @@ -959,7 +963,7 @@ void smtp_data(arg) char *arg; { if (flagauth) received_authed(&qqt,protocol,local,remoteinfo,client_get_session_id()->s); else - received(&qqt,protocol,local,remoteip,remotehost,remoteinfo,fakehelo); + received(&qqt,protocol,local,remoteip,remotehost,remoteinfo,client_get_session_id()->s,fakehelo); qmail_put(&qqt,sppheaders.s,sppheaders.len); /* set in qmail-spp.c */ spp_rset(); blast(&hops); @@ -1244,7 +1248,6 @@ char *arg; switch (authcmds[i].fun(arg)) { case 0: - (void)client_get_session_id(); /* generate session */ if (!spp_auth(authcmds[i].text, user.s)) return; flagauth = 1; if (ssl) { -- cgit v1.2.3