Re: [courier-users] Subtle header modification

2012-12-14 Thread Alessandro Vesely
On Fri 14/Dec/2012 01:01:23 +0100 Sam Varshavchik wrote:
 Alessandro Vesely writes:
 
 when I receive a message with, say:

   From: u...@example.com
   To: l...@example.org

 those non-compliant headers get changed to:

   From: u...@example.com
   To: l...@example.org

 I'm unclear on where the angle bracket removal happens.  The code in
 submit.C seems to be concerned with submission rather than reception
 (also because it entails a 511 Headers specify no recipients that I
 never saw on incoming mail.)
 
 submit.C handles all mail, but only locally-submitted mail have their
 headers reformatted, and not in submit.C but sendmail.c

I think it happens in getrcpts().  At line 1815 I see this call:

char*new_header=rw_rewrite_header(mf-module,
  header.c_str(),
  RW_HEADER|RW_SUBMIT,
  addresst, errmsg);

That's a couple of spans above the checks for NOADDMSGID and NOADDATE.
I set the former but not the latter.  I attach a small test file to
confirm what takes place.

 If there's any intermediate step in your mail path, such as maildrop
 or .courier forwarding the message somewhere, that can come across as
 a locally-submitted mail, that's subject to header rewriting.

But I should get extra Received: lines such path.

 Header rewriting occurs in sendmail.c, which only gets invoked via
 the command line, or by external script. courieresmtpd.c runs
 submit directly, no header rewriting takes place in that path.

Some does...  After looking a bit closer at the code, I think I could
try a patch, next week, say.  How about NOADDRTRANSCRIBE?


---BeginMessage---
Below I copy the session:

Trying 172.25.197.1...
Connected to wmail.tana.it.
Escape character is '^]'.
220 wmail.tana.it ESMTP
EHLO localhost
250-wmail.tana.it Ok.
250-AUTH LOGIN CRAM-MD5 CRAM-SHA1
250-STARTTLS
250-XCOURIEREXTENSIONS
250-XVERP=Courier
250-XEXDATA
250-XSECURITY=NONE,STARTTLS
250-PIPELINING
250-8BITMIME
250-SIZE
250 DSN
MAIL FROM:
250 Ok.
RCPT TO:ves...@tana.it
250 Ok.
DATA
354 Ok.
From: u...@example.com
To: angle-addr@another.example
Subject: session transcript

The angles are there...
---End Message---
--
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d___
courier-users mailing list
courier-users@lists.sourceforge.net
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users


Re: [courier-users] Subtle header modification

2012-12-14 Thread Sam Varshavchik

Alessandro Vesely writes:


On Fri 14/Dec/2012 01:01:23 +0100 Sam Varshavchik wrote:
 Alessandro Vesely writes:

 when I receive a message with, say:

   From: u...@example.com
   To: l...@example.org

 those non-compliant headers get changed to:

   From: u...@example.com
   To: l...@example.org

 I'm unclear on where the angle bracket removal happens.  The code in
 submit.C seems to be concerned with submission rather than reception
 (also because it entails a 511 Headers specify no recipients that I
 never saw on incoming mail.)

 submit.C handles all mail, but only locally-submitted mail have their
 headers reformatted, and not in submit.C but sendmail.c

I think it happens in getrcpts().  At line 1815 I see this call:

char*new_header=rw_rewrite_header(mf-module,
  header.c_str(),
  RW_HEADER|RW_SUBMIT,
  addresst, errmsg);

That's a couple of spans above the checks for NOADDMSGID and NOADDATE.
I set the former but not the latter.  I attach a small test file to
confirm what takes place.

 If there's any intermediate step in your mail path, such as maildrop
 or .courier forwarding the message somewhere, that can come across as
 a locally-submitted mail, that's subject to header rewriting.

But I should get extra Received: lines such path.

 Header rewriting occurs in sendmail.c, which only gets invoked via
 the command line, or by external script. courieresmtpd.c runs
 submit directly, no header rewriting takes place in that path.

Some does...  After looking a bit closer at the code, I think I could
try a patch, next week, say.  How about NOADDRTRANSCRIBE?


Try it; not sure about the name, NOADDRREWRITE sounds better.


pgpPGL3pYh0iz.pgp
Description: PGP signature
--
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d___
courier-users mailing list
courier-users@lists.sourceforge.net
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users