Quantcast

delivered to wrong maildir

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

delivered to wrong maildir

Russell L. Harris-2
The maildrop log has the following entry for a message delivered to
$MAILREPOSITORY/list/xkb:

Date: Thu Aug  6 21:36:30 2015
From: =?utf-8?Q?Ligonier=20Ministries?= <[hidden email]>
Subj: [POSSIBLE SPAM]
File: /home/rlh/mail/repository/list/xkb                              
(16707)

However, the only rule in ".mailfilter" which contains the string "xkb" is
the following:

if ( /^(To: xkb@listserv)||(From:.*xkb-subscribe)/ )
   to $MAILREPOSITORY/list/xkb

What is the cause of this mis-delivery?



------------------------------------------------------------------------------
_______________________________________________
Courier-maildrop mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/courier-maildrop
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: delivered to wrong maildir

Sam Varshavchik
[hidden email] writes:

> The maildrop log has the following entry for a message delivered to
> $MAILREPOSITORY/list/xkb:
>
> Date: Thu Aug  6 21:36:30 2015
> From: =?utf-8?Q?Ligonier=20Ministries?= <[hidden email]>
> Subj: [POSSIBLE SPAM]
> File: /home/rlh/mail/repository/list/xkb
> (16707)
>
> However, the only rule in ".mailfilter" which contains the string "xkb" is
> the following:
>
> if ( /^(To: xkb@listserv)||(From:.*xkb-subscribe)/ )
>    to $MAILREPOSITORY/list/xkb
>
> What is the cause of this mis-delivery?
Looks like you have two pipes between the parenthesized expressions, instead  
of 1. This is probably getting parsed as an empty string between two "or"  
pipes, which, in this context, would match any header.


------------------------------------------------------------------------------

_______________________________________________
Courier-maildrop mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/courier-maildrop

attachment0 (836 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: delivered to wrong maildir

Russell L. Harris-2
On Thu, August 6, 2015 9:52 pm, Sam Varshavchik wrote:
> [hidden email] writes:
...
>> if ( /^(To: xkb@listserv)||(From:.*xkb-subscribe)/ ) to
>> $MAILREPOSITORY/list/xkb
...
> Looks like you have two pipes between the parenthesized expressions,
> instead of 1. This is probably getting parsed as an empty string between
> two "or" pipes, which, in this context, would match any header.

I thank you for the diagnosis and explanation.  If I understand correctly,
the way to write the logical OR which I intended is:

if ( /^(To: xkb@listserv) || (From:.*xkb-subscribe)/ )

RLH



------------------------------------------------------------------------------
_______________________________________________
Courier-maildrop mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/courier-maildrop
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: delivered to wrong maildir

Sam Varshavchik
[hidden email] writes:

> On Thu, August 6, 2015 9:52 pm, Sam Varshavchik wrote:
> > [hidden email] writes:
> ...
> >> if ( /^(To: xkb@listserv)||(From:.*xkb-subscribe)/ ) to
> >> $MAILREPOSITORY/list/xkb
> ...
> > Looks like you have two pipes between the parenthesized expressions,
> > instead of 1. This is probably getting parsed as an empty string between
> > two "or" pipes, which, in this context, would match any header.
>
> I thank you for the diagnosis and explanation.  If I understand correctly,
> the way to write the logical OR which I intended is:
>
> if ( /^(To: xkb@listserv) || (From:.*xkb-subscribe)/ )
No. As I wrote, "instead of 1". This has nothing to do with spaces. Your  
original expression gets parsed, essentially as

^(To: xkb@listserv)|<empty string>|(From:.*xkb-subscribe)

Which will match anything, since matching an empty string at the beginning  
of the header line always works.

Additionally, in a pattern, all characters are important, for example:

To:  xkb@listserv

Wouldn't match the above pattern anyway, because the pattern only has one  
space. There's nothing special about spaces, they have to match like any  
other character, and, as I said, it's one | character, not two.

The reference to the || operator in the maildropfitler man page is something  
completely different, and refers to the logical or operator in a boolean  
expression, and has nothing to do with pattern matching.

You should find the Wikipedia page on regular expressions helpful in  
learning more about regular expressions. maildropfilter uses the Perl syntax  
for regular expressions, for which the closest match is the POSIX regular  
expressions mentioned on the Wikipedia page.

------------------------------------------------------------------------------

_______________________________________________
Courier-maildrop mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/courier-maildrop

attachment0 (836 bytes) Download Attachment
Loading...