
werner at yellowcouch
Jun 27, 2009, 4:05 AM
Post #2 of 2
(1016 views)
Permalink
|
|
Re: Strip "received from" headers from Submitted Mails
[In reply to]
|
|
Hello, I had the same problem. I patched my installation somewhat such that _if_ the use was able to authenticate himself properly the received-from would be stripped. This of course relies on a variety of ssl and smtp-auth patches. So I'm not sure whether I can simply provide you with a working patch. I can however provide you with the only fuhnction I had to modify to achieve the required result. The main change was the addition of the line 'if (!authd)' in the TLS ifdef. of the smtp_data function in qmail-smtpd.c void smtp_data() { int hops; unsigned long qp; char *qqx; #ifdef TLS stralloc protocolinfo = {0}; #endif if (!seenmail) { err_wantmail(); return; } if (!rcptto.len) { err_wantrcpt(); return; } seenmail = 0; if (databytes) bytestooverflow = databytes + 1; if (qmail_open(&qqt) == -1) { err_qqt(); return; } qp = qmail_qp(&qqt); out("354 go ahead\r\n"); #ifdef TLS if(ssl){ if (!stralloc_copys(&protocolinfo, SSL_CIPHER_get_name(SSL_get_current_cipher(ssl)))) die_nomem(); if (!stralloc_catb(&protocolinfo, " encrypted SMTP", 15)) die_nomem(); if (clientcert.len){ if (!stralloc_catb(&protocolinfo," cert ", 6)) die_nomem(); if (!stralloc_catb(&protocolinfo,clientcert.s, clientcert.len)) die_nomem(); } if (!stralloc_0(&protocolinfo)) die_nomem(); } else if (!stralloc_copyb(&protocolinfo,"SMTP",5)) die_nomem(); if (!authd) received(&qqt,protocolinfo.s,local,remoteip,remotehost,remoteinfo,case_diffs(remotehost,helohost.s) ? he lohost.s : 0); #else etcetera... I hope this helps you forward, With kind regards, Werner,- -- Dr. Werner Van Belle http://werner.yellowcouch.org/
|