procmail
[Top] [All Lists]

Re: Problem: address not caught in To: header

2001-04-24 06:47:05
On 24 Apr, Fredrik Björk wrote:
| At 01:52 2001-04-24 -0400, you wrote:
| >Hi everyone,
| >
| >   I'm currently using procmail to manage all of the email coming to my
| >(virtual) host, and had a problem today.  I received a message which was
| >sent out to a large committee which I am on, which contains around 100
| >people.  Now, my email address Matthew(_at_)Manuel(_dot_)ca is usually 
caught and
| >forwarded to my main mail acct.  For some reason, this message was not (it
| >"fell off the end" of my .procmailrc and ended up in my mail account on the
| >host).
| 
| 
| I have a similar problem. The To: header does not seem to be the primary 
| key for procmail when delivering the mail. In the below message, several 
| instances of nilsson(_at_)seaside(_dot_)se appears, like 
X-MDaemon-Deliver-To: 
| nilsson(_at_)seaside(_dot_)se(_dot_) Is procmail supposed to deliver based on 
anything else 
| than the To: header?

In fact procmail doesn't even pay attention to the To: header unless
you tell it to, and [re]direct delivery accordingly. The intended
(envelope) recipient is determined during the smtp conversation between
the two mail servers before procmail ever gets the message at your end.
There is absolutely no guarantee that that envelope recipient matches
the To:, Cc: or any other header in the message. For example, my mail
server adds an X-Envelope-To: header thanks to tips gathered here. But
I still get mail from some lists where that header is not added and the
recipient is not indicated *anywhere* in *any* header. It happens when
there are multiple recipients at my site. In your case, however, you
are simply mistaken as to whom the first message was addressed.

| Headers:
| 
| >X-POP3-Rcpt: nilsson(_at_)mail01
| >Return-Path: <claudia(_at_)optimasport(_dot_)se>
| >Received: from mailc.telia.com (mailc.telia.com [194.22.190.4])
| >  by mail01.varberg.net (8.11.3/8.11.3) with ESMTP id f3GABCN28483
| >  for <nilsson(_at_)seaside(_dot_)se>; Mon, 16 Apr 2001 12:11:12 +0200

          ^^^^^^^^^^^^^^^^^^^
That is the envelope recipient - the user the remote server told your
server to deliver the message to, and on whose behalf your server
accepted and passed it on to procmail. You can see the same thing in the
next 2 headers.

| >Received: from optimasport.se (t2o963p42.telia.com [195.67.214.162])
| >  by mailc.telia.com (8.11.2/8.11.0) with ESMTP id f3GA8cf24186
| >  for <nilsson(_at_)seaside(_dot_)se>; Mon, 16 Apr 2001 12:08:38 +0200 (CEST)
| >Received: from foo.telia.com [192.168.0.56] by optimasport.se [127.0.0.1]
| >  with SMTP (MDaemon.v3.5.4.R)
| >  for <nilsson(_at_)seaside(_dot_)se>; Mon, 16 Apr 2001 11:55:59 +0200
| >Message-ID: <000d01c0c65c$6f6429a0$3800a8c0(_at_)telia(_dot_)com>
| >From: "Claudia Becerra G" <claudia(_at_)optimasport(_dot_)se>
| >To: <anders(_dot_)nilsson(_at_)seaside(_dot_)se>
|
| [snip]
| 
| The mail was sent to  To: <anders(_dot_)nilsson(_at_)seaside(_dot_)se> which 
maps to user 
| sea0350b but it was delivered to user nilsson on my Linux system (Slackware 
| 7.1.0).

No, it was delivered to <nilsson(_at_)seaside(_dot_)se>. The next one was 
delivered
to <anders(_dot_)nilsson(_at_)seaside(_dot_)se>.

| [snip]
| 
| System log (messages):
| 
| Apr 16 12:11:33 mail01 sendmail[28483]: f3GABCN28483: 
| from=<claudia(_at_)optimasport(_dot_)se>, size=1941315, class=0, nrcpts=1, 
| msgid=<000d01c0c65c$6f6429a0$3800a8c0(_at_)telia(_dot_)com>, proto=ESMTP, 
daemon=MTA, 
| relay=mailc.telia.com [194.22.190.4]
| Apr 16 12:11:36 mail01 sendmail[28497]: f3GABCN28483: 
| to=<nilsson(_at_)seaside(_dot_)se>, delay=00:00:24, xdelay=00:00:03, 
mailer=local, 
| pri=1970429, dsn=2.0.0, stat=Sent

The to=<nilsson(_at_)seaside(_dot_)se> above indicates the envelope recipient.

| 
| Another mail was delivered correctly (I don't have the headers for this one):

But if you did, the Received: headers would match the snippet from the
sendmail log file below, indicating this message was delivered for
<anders(_dot_)nilsson(_at_)seaside(_dot_)se> - different recipient than the one 
above.

| [snip]
| 
| Apr 22 13:17:56 mail01 sendmail[10293]: f3MBHuR10293: 
| from=<claudia(_at_)optimasport(_dot_)se>, size=1786, class=0, nrcpts=1, 
| msgid=<001a01c0cb1d$40a7c200$3800a8c0(_at_)telia(_dot_)com>, proto=ESMTP, 
daemon=MTA, 
| relay=mailc.telia.com [194.22.190.4]
| Apr 22 13:17:56 mail01 sendmail[10295]: f3MBHuR10293: 
| to=<anders(_dot_)nilsson(_at_)seaside(_dot_)se>, delay=00:00:00, 
xdelay=00:00:00, 
| mailer=local, pri=30868, dsn=2.0.0, stat=Sent

Again, to=<anders(_dot_)nilsson(_at_)seaside(_dot_)se> indicates the envelope 
recipient
and it is not the same as the first message.

Don Hammond



_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail