Ok, I did a little bit of searching:

For the envelope FROM, RFC-1123 specifies that the mail server making
"final delivery" of a message:

                 MUST pass the MAIL FROM: address from the SMTP envelope
         with the message, for use if an error notification message must
         be sent later
...

         IMPLEMENTATION:
              The MAIL FROM: information may be passed as a parameter or
              in a Return-Path: line inserted at the beginning of the
              message.
...

         The syntax shown for the Return-path line omits the possibility
         of a null return path, which is used to prevent looping of
         error notifications (see Section 5.3.3).  The complete syntax
         is:

             return = "Return-path"  ":" route-addr
                    / "Return-path"  ":" "<" ">"


So, for envelope from checking, we should use the "Return-Path" header. 
I'll make a rule which compares Return-Path to From: and see how it does
at differentiating spam from nonspam.

For the envelope TO, there seem to be 2 "standards", depending on when
the info is added to the message header.  One is added on SMTP-reception
(such as with exim I think), in which case the header used is
"Envelope-To".  The other is added during delivery, after local alias
resolution, etc, and is called "Delivered-To" -- qmail does this, and
it's basically what Charlie is doing too.  I think what we really want
to do for spam-id purposes is to compare the "RCPT TO:" info from SMTP
to the "To:"/"Cc:" fields in the message header.  If you compare To/Cc
to the delivery address, then you'll think messages To:
[EMAIL PROTECTED] are spam (assuming that postmaster is an alias for a
real user), because the delivery-to will be [EMAIL PROTECTED] not
[EMAIL PROTECTED], which will be the envelope-to value.

So, Charlie, I would suggest altering your mail system to insert a
Envelope-To instead of X-Delivery-To (or at least standardize and use
Delivery-To).  I'll implement Charlie's patch below but using
Envelope-To and add it to the SA distro.  Then people can just make sure
their mail system adds the right header, and they'll automatically get
this feature.

C

dman wrote once:
>On Fri, Feb 15, 2002 at 02:52:05PM +0000, Nigel Metheringham wrote:
>| On Fri, 2002-02-15 at 14:45, dman wrote:
>| > On Fri, Feb 15, 2002 at 10:37:46AM +0000, Nigel Metheringham wrote:
>| > | In terms of headers, Return-Path: would be the one to go for.
>| > 
>| > Well, in your message that I'm replying to, there is no
Return-Path:
>| > header.  Maybe procmail sticks that in or something (I'm not using
>| > procmail), but I don't know where it comes from.
>| 
>| Return-path: is added by the MTA on final delivery.  For exim its a
>| transport option,
>
>Ahh, got it now.  Return-Path: and Envelope-To: headers are just as
>good to me as a command line option.  Either way the site's admin has
>to set up the MTA properly to deliver the info.


On Sun, 2002-02-17 at 13:12, Charlie Watts wrote:
> sub check_if_listed_recipient {
>   my ($self) = @_;
>   my $deliveredto = $self->get ('X-Delivered-To:addr');
>   my $to = $self->get ('To');
>   my $cc = $self->get ('Cc');
> 
>   if ($deliveredto eq '') { return 0; }
>   if (($to =~ /${deliveredto}/i) || ($cc =~ /${deliveredto}/i)) { return 0; }
>   return 1;
> }


_______________________________________________
Spamassassin-talk mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/spamassassin-talk

Reply via email to