summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--qmail-qmqpd.c2
-rw-r--r--qmail-qmtpd.c2
-rw-r--r--qmail-smtpd.c6
-rw-r--r--received.c35
-rw-r--r--received.h6
5 files changed, 26 insertions, 25 deletions
diff --git a/qmail-qmqpd.c b/qmail-qmqpd.c
index 3eb06e4..38b6b67 100644
--- a/qmail-qmqpd.c
+++ b/qmail-qmqpd.c
@@ -80,7 +80,7 @@ void identify()
80 if (!local) local = env_get("TCPLOCALIP"); 80 if (!local) local = env_get("TCPLOCALIP");
81 if (!local) local = "unknown"; 81 if (!local) local = "unknown";
82 82
83 received(&qq,"QMQP",local,remoteip,remotehost,remoteinfo,NULL,NULL); 83 received(&qq,"QMQP",local,remoteip,remotehost,remoteinfo,NULL);
84} 84}
85 85
86char buf[1000]; 86char buf[1000];
diff --git a/qmail-qmtpd.c b/qmail-qmtpd.c
index 77d36aa..d6f6eba 100644
--- a/qmail-qmtpd.c
+++ b/qmail-qmtpd.c
@@ -144,7 +144,7 @@ int main()
144 else if (ch == 13) flagdos = 1; 144 else if (ch == 13) flagdos = 1;
145 else badproto(); 145 else badproto();
146 146
147 received(&qq,"QMTP",local,remoteip,remotehost,remoteinfo,NULL,NULL); 147 received(&qq,"QMTP",local,remoteip,remotehost,remoteinfo,NULL);
148 148
149 /* XXX: check for loops? only if len is big? */ 149 /* XXX: check for loops? only if len is big? */
150 150
diff --git a/qmail-smtpd.c b/qmail-smtpd.c
index f038314..5ea23dc 100644
--- a/qmail-smtpd.c
+++ b/qmail-smtpd.c
@@ -970,9 +970,11 @@ void smtp_data(arg) char *arg; {
970 } 970 }
971 971
972 if (flagauth) 972 if (flagauth)
973 received_authed(&qqt,protocol,local,remoteinfo,client_get_session_id()->s); 973 received_authed(&qqt,protocol,local);
974 else 974 else
975 received(&qqt,protocol,local,remoteip,remotehost,remoteinfo,client_get_session_id()->s,fakehelo); 975 received(&qqt,protocol,local,remoteip,remotehost,remoteinfo,fakehelo);
976 if (!env_get("NOSESSIONHEADER"))
977 xsmtpsession(&qqt, (flagauth) ? remoteinfo : NULL, client_get_session_id()->s);
976 qmail_put(&qqt,sppheaders.s,sppheaders.len); /* set in qmail-spp.c */ 978 qmail_put(&qqt,sppheaders.s,sppheaders.len); /* set in qmail-spp.c */
977 spp_rset(); 979 spp_rset();
978 blast(&hops); 980 blast(&hops);
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}
diff --git a/received.h b/received.h
index 473c3ca..2476454 100644
--- a/received.h
+++ b/received.h
@@ -5,9 +5,11 @@
5 5
6void received(const struct qmail *qqt, const char *protocol, 6void received(const struct qmail *qqt, const char *protocol,
7 const char *local, const char *remoteip, const char *remotehost, 7 const char *local, const char *remoteip, const char *remotehost,
8 const char *remoteinfo, const char *remotesession, const char *helo 8 const char *remoteinfo, const char *helo
9); 9);
10void received_authed(const struct qmail *qqt, const char *protocol, 10void received_authed(const struct qmail *qqt, const char *protocol,
11 const char *local, const char *remoteinfo, const char *remotesession); 11 const char *local);
12void xsmtpsession(const struct qmail *qqt,
13 const char *remoteinfo, const char *remotesession);
12 14
13#endif 15#endif