summarylogtreecommitdiffstats
path: root/ssmtp-remote-addr.patch
blob: 7e28926f0ae053c1124c98492e00fc153146e365 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=557741

Patch by Victor Sudakov <sudakov@sibptus.tomsk.ru>
Modified by Anibal Monsalve Salazar <anibal@debian.org>

--- a/ssmtp.c	2009-11-23 20:55:11.000000000 +1100
+++ b/ssmtp.c	2009-11-24 13:27:58.000000000 +1100
@@ -1409,6 +1409,7 @@
 int ssmtp(char *argv[])
 {
 	char b[(BUF_SZ + 2)], *buf = b+1, *p, *q;
+	char *remote_addr;
 #ifdef MD5AUTH
 	char challenge[(BUF_SZ + 1)];
 #endif
@@ -1612,6 +1613,10 @@
 		outbytes += smtp_write(sock, "From: %s", from);
 	}
 
+	if(remote_addr=getenv("REMOTE_ADDR")) {
+		outbytes += smtp_write(sock, "X-Originating-IP: %s", remote_addr);
+	}
+
 	if(have_date == False) {
 		outbytes += smtp_write(sock, "Date: %s", arpadate);
 	}