Re: delivered to wrong maildir

Sam Varshavchik <[email protected]> Sat, 08 Aug 2015 08:02:07 -0400
Newsgroups gmane.mail.maildrop
Message-ID <[email protected]>
[email protected] writes:

> On Thu, August 6, 2015 9:52 pm, Sam Varshavchik wrote:
> > [email protected] 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
[email protected]
https://lists.sourceforge.net/lists/listinfo/courier-maildrop
signature.asc (application/pgp-signature, 819 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQIcBAABAgAGBQJVxe+/AAoJEGs6Yr4nnb8lIEIP/2W5wRi0W+hJRE1pQHYayktr
mpoDnggZWw3NnTvyizQvHkeHI7WrCJbI5AKtVV42G2I+YTHvSxTdO86KXuXuLLK3
80VrTe+kdbeP0AlnusQSVr49dj+PbmrVxtp+lA3DUl80dYHaaLwrxpEqoke5vLqi
CYQywiOF1shRhvVdnSC7m8vbYN3OR6RbO25oFpsDAj6+2LsYLgeA4yLvNB6fvS+h
Wd4T89+wQOfBdjc8C5uZ+0iIhZ/qJINTrIUYa2HiaaFAS4Bs8yV+AyrqZTZdPYyk
h8EQECKRUoCQzjvIqhX/kN+yqsVBWg1GrPGJmrofw3c16Hy4Xuyc1k7OOTIFoZmn
WIP3jcC1yGR6Ta++P1p/OOy+5utwA7+gmyBv2mUVK3XRzZTtc8815zrVGGEdxaLq
IeSmu3rvK/pV400REIlS9R2Hxcrfu0H+4erNo3I/DSSw2zObJecinMQRdGVoKs65
jCtCy8y8Dzod5FFvCyQ3JLk5w/2hb5Bw824PhW5PorzdhVIYrJW3M2sIm2/kH+av
RH4oQJ24TPHIx8uICxEnJea3GoaQzk1jkIECwJ5/smbvnslPgbWR9Phm46nlABsx
AlKg+jD8pLyEMNMJMiNJBgVxYdUw8pxcQXbKxCChQCNxsRhqWvDcQfjHOAfU0XOK
12cgq1cfeSYoG06RUmcY
=wKsS
-----END PGP SIGNATURE-----