Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Qmail: users

Strip "received from" headers from Submitted Mails

 

 

Qmail users RSS feed   Index | Next | Previous | View Threaded


mail at oliwel

Jun 27, 2009, 1:03 AM

Post #1 of 2 (1097 views)
Permalink
Strip "received from" headers from Submitted Mails

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi All,

I am currently facing a damn stupid problem.

A customer of mine who uses a dynmaic IP DSL uplink frequently gets an
IP assigned that is listed by Spamcop, as the IP was connected to a Bot
Net PC in the past.

Spamcop puts a lot of points on that mail, due to the received lines in
the mail header. So my idea was to strip out these lines. Is there an
easy chance to do so, without patching and recompiling qmail?

The submission system uses netqmail with SMTP Auth patch but has no
other queue replacements or the like running.

TIA

Oliver
- --
Protect your environment - close windows and adopt a penguin!
PGP-Key: 3B2C 8095 A7DF 8BB5 2CFF 8168 CAB7 B0DD 3985 1721
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkpF0msACgkQyrew3TmFFyFbmQCfSXW4gSalgW+MFhGBqY2uy/RI
gg8An3tNY6gQ7Huu6J/PgbztRpnLFRw5
=lE4/
-----END PGP SIGNATURE-----


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/
Attachments: signature.asc (0.25 KB)

Qmail users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.