summaryrefslogtreecommitdiffstats
path: root/received.c
diff options
context:
space:
mode:
authormanuel <manuel@mausz.at>2023-04-04 10:57:32 +0200
committermanuel <manuel@mausz.at>2023-04-04 10:57:32 +0200
commitae63d731e9c1d9a0403aac3ee0e680a6508dff07 (patch)
tree348a9e75365d76b143f76eb63113a90d9e0025c8 /received.c
parent026d6c79538ad9dbe646f3ee5559470419583fe9 (diff)
downloadqmail-ae63d731e9c1d9a0403aac3ee0e680a6508dff07.tar.gz
qmail-ae63d731e9c1d9a0403aac3ee0e680a6508dff07.tar.bz2
qmail-ae63d731e9c1d9a0403aac3ee0e680a6508dff07.zip
add NOSESSIONHEADER env variable
Diffstat (limited to 'received.c')
-rw-r--r--received.c35
1 files changed, 16 insertions, 19 deletions
diff --git a/received.c b/received.c
index 0b51c39..3d27bb0 100644
--- a/received.c
+++ b/received.c
@@ -41,7 +41,7 @@ static char buf[DATE822FMT];
41void received(const struct qmail *qqt, 41void received(const struct qmail *qqt,
42 const char *protocol, const char *local, 42 const char *protocol, const char *local,
43 const char *remoteip, const char *remotehost, const char *remoteinfo, 43 const char *remoteip, const char *remotehost, const char *remoteinfo,
44 const char *remotesession, const char *helo) 44 const char *helo)
45{ 45{
46 struct datetime dt; 46 struct datetime dt;
47 47
@@ -65,19 +65,12 @@ void received(const struct qmail *qqt,
65 qmail_puts(qqt,"; "); 65 qmail_puts(qqt,"; ");
66 datetime_tai(&dt,now()); 66 datetime_tai(&dt,now());
67 qmail_put(qqt,buf,date822fmt(buf,&dt)); 67 qmail_put(qqt,buf,date822fmt(buf,&dt));
68
69 if (remotesession) {
70 qmail_puts(qqt,"X-UD-Smtp-Session: ");
71 qmail_puts(qqt,remotesession);
72 qmail_put(qqt,"\n",1);
73 }
74} 68}
75 69
76/* "Received: by silverton.berkeley.edu with SMTP; 26 Sep 1995 04:46:54 -0000\n" 70/* "Received: by silverton.berkeley.edu with SMTP; 26 Sep 1995 04:46:54 -0000\n" */
77 * "X-UD-Smtp-Session: user@sessionid */
78 71
79void received_authed(const struct qmail *qqt, const char *protocol, 72void received_authed(const struct qmail *qqt, const char *protocol,
80 const char *local, const char *remoteinfo, const char *remotesession) 73 const char *local)
81{ 74{
82 struct datetime dt; 75 struct datetime dt;
83 76
@@ -88,15 +81,19 @@ void received_authed(const struct qmail *qqt, const char *protocol,
88 qmail_puts(qqt,"; "); 81 qmail_puts(qqt,"; ");
89 datetime_tai(&dt,now()); 82 datetime_tai(&dt,now());
90 qmail_put(qqt,buf,date822fmt(buf,&dt)); 83 qmail_put(qqt,buf,date822fmt(buf,&dt));
84}
85
86/* "X-UD-Smtp-Session: sessionid */
87/* "X-UD-Smtp-Session: user@sessionid */
91 88
92 if (remoteinfo || remotesession) { 89void xsmtpsession(const struct qmail *qqt,
93 qmail_puts(qqt,"X-UD-Smtp-Session: "); 90 const char *remoteinfo, const char *remotesession)
94 if (remoteinfo) { 91{
95 safeput(qqt,remoteinfo); 92 qmail_puts(qqt,"X-UD-Smtp-Session: ");
96 qmail_puts(qqt,"@"); 93 if (remoteinfo) {
97 } 94 safeput(qqt,remoteinfo);
98 if (remotesession) 95 qmail_puts(qqt,"@");
99 qmail_puts(qqt,remotesession);
100 qmail_put(qqt,"\n",1);
101 } 96 }
97 qmail_puts(qqt,remotesession);
98 qmail_put(qqt,"\n",1);
102} 99}