summaryrefslogtreecommitdiff
path: root/network/ssmtp/patches/03-557741-remote-addr.patch
blob: 03efa81cd6cf66cedc6184c7f3329855f935871b (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
27
28
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>

Index: ssmtp-2.64/ssmtp.c
===================================================================
--- ssmtp-2.64.orig/ssmtp.c
+++ ssmtp-2.64/ssmtp.c
@@ -1421,6 +1421,7 @@ ssmtp() -- send the message (exactly one
 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
@@ -1624,6 +1625,10 @@ int ssmtp(char *argv[])
 		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);
 	}