[Qmail-it] Rimuovere uno header Received
Fabio Busatto
fabio.busatto at sikurezza.org
Mon Jan 8 19:48:32 CET 2007
On Mon, Jan 08, 2007 at 06:10:59PM +0100, Davide iDave Ronchi wrote:
> 24-10-2006 19:12: Fabio Busatto ha scritto:
> Salve, rispolvero questo vecchio thread perché mi trovo in una situazione
> simile a quella descritta dal poster originale, e vorrei risolvere questo
> annoso problema... La patch che uso è questa:
> http://www.shupp.org/patches/netqmail-1.05-tls-smtpauth-20060105.patch
>
> Sarebbe interessante che le mails provenienti da utenti autenticati non
> avessero proprio il primo degli header received, quello contenente l'ip
> bannato, e che risultasse invece l'ip del server (che è pulitissimo :)
Ecco qui, al volo, dateci un occhio mentre compro qualcosa :)
Fabio
-------------- next part --------------
diff -uNr netqmail-1.05-orig/qmail-qmqpd.c netqmail-1.05/qmail-qmqpd.c
--- netqmail-1.05-orig/qmail-qmqpd.c 1998-06-15 12:53:16.000000000 +0200
+++ netqmail-1.05/qmail-qmqpd.c 2007-01-08 19:30:31.000000000 +0100
@@ -78,7 +78,7 @@
if (!local) local = env_get("TCPLOCALIP");
if (!local) local = "unknown";
- received(&qq,"QMQP",local,remoteip,remotehost,remoteinfo,(char *) 0);
+ received(&qq,"QMQP",local,remoteip,remotehost,remoteinfo,(char *) 0,(char *) 0);
}
char buf[1000];
diff -uNr netqmail-1.05-orig/qmail-qmtpd.c netqmail-1.05/qmail-qmtpd.c
--- netqmail-1.05-orig/qmail-qmtpd.c 1998-06-15 12:53:16.000000000 +0200
+++ netqmail-1.05/qmail-qmtpd.c 2007-01-08 19:30:01.000000000 +0100
@@ -130,7 +130,7 @@
else if (ch == 13) flagdos = 1;
else badproto();
- received(&qq,"QMTP",local,remoteip,remotehost,remoteinfo,(char *) 0);
+ received(&qq,"QMTP",local,remoteip,remotehost,remoteinfo,(char *) 0,(char *) 0);
/* XXX: check for loops? only if len is big? */
diff -uNr netqmail-1.05-orig/qmail-smtpd.c netqmail-1.05/qmail-smtpd.c
--- netqmail-1.05-orig/qmail-smtpd.c 2007-01-08 19:33:53.000000000 +0100
+++ netqmail-1.05/qmail-smtpd.c 2007-01-08 19:28:56.000000000 +0100
@@ -514,7 +514,7 @@
qp = qmail_qp(&qqt);
out("354 go ahead\r\n");
- received(&qqt,protocol,local,remoteip,remotehost,remoteinfo,fakehelo);
+ received(&qqt,protocol,local,remoteip,remotehost,remoteinfo,fakehelo,relayclient);
blast(&hops);
hops = (hops >= MAXHOPS);
if (hops) qmail_fail(&qqt);
diff -uNr netqmail-1.05-orig/received.c netqmail-1.05/received.c
--- netqmail-1.05-orig/received.c 1998-06-15 12:53:16.000000000 +0200
+++ netqmail-1.05/received.c 2007-01-08 19:28:40.000000000 +0100
@@ -37,7 +37,7 @@
/* "Received: from relay1.uu.net (HELO uunet.uu.net) (7 at 192.48.96.5)\n" */
/* " by silverton.berkeley.edu with SMTP; 26 Sep 1995 04:46:54 -0000\n" */
-void received(qqt,protocol,local,remoteip,remotehost,remoteinfo,helo)
+void received(qqt,protocol,local,remoteip,remotehost,remoteinfo,helo,relayclient)
struct qmail *qqt;
char *protocol;
char *local;
@@ -45,11 +45,15 @@
char *remotehost;
char *remoteinfo;
char *helo;
+char *relayclient;
{
struct datetime dt;
qmail_puts(qqt,"Received: from ");
safeput(qqt,remotehost);
+ if (relayclient) {
+ qmail_puts(qqt,".trustedrelay");
+ }
if (helo) {
qmail_puts(qqt," (HELO ");
safeput(qqt,helo);
@@ -61,6 +65,9 @@
qmail_puts(qqt,"@");
}
safeput(qqt,remoteip);
+ if (relayclient) {
+ qmail_puts(qqt,".trustedrelay");
+ }
qmail_puts(qqt,")\n by ");
safeput(qqt,local);
qmail_puts(qqt," with ");
More information about the Qmail-it
mailing list