Re: Can not get a filter recognised for one email source

Anne Wilson <[email protected]>
Newsgroups gmane.mail.procmail
Message-ID <[email protected]>
On Wednesday 16 February 2011 10:35:40 you wrote:
> > From: Anne Wilson <[email protected]>
> > To: [email protected]
> > Subject: Can not get a filter recognised for one email source
> > Date: Wed, 16 Feb 2011 09:44:55 +0000
> > 
> > 
> > I get regular emails from one list, that always end up in my Inbox, no
> > matter what I put in the recipes.  At the moment these two recipes
> > 
> > are in place:
> > :0
> > 
> > * (^From|^To|^Subject):
> > .*(Janome|embroidery|Embroidery|emblibrary|empressmills)
> > ${MAILDIR}.INBOX.Sewing/
> > 
> > :0
> > 
> > * ^From: .*Debra\@emblibrary.com
> > ${MAILDIR}.INBOX.Sewing/
> > 
> > Among the headers of the mail are the following lines:
> > 
> > Received: from mail.emblibrary.com ([69.54.45.82]) (envelope-from
> > <[email protected]>) from: [email protected]
> > subject: Feather Your Nest - New at Embroidery Library!
> > X-Envelope-From: [email protected]
> > 
> > none of these trigger a match, and I've no idea why.  Any ideas?
> 
> This is just a *GUESS*.
> 
But it looks to be very likely :-)

>   Background:
>     1) The mail you show is -not- standards compliant.  Message "header"
>        lines are required to start with an upper-case letter.
> 
None of the important-for-this-purpose lines do :-(

>     2) 'Default' for a procmail recipe is to apply the checks against
>        the headers only.
> 
>     3) message format is:
> 	 headers
> 	 blank line
> 	 body
> 
> _Apparently_, when procmail scans the message, and sees something that is
> "not a valid header" _before_ the blank line, it does *NOT* treat it it as
> a header line.
> 
> Two possibilities why:
>   1) it simply 'ignores' that invalid line, and continues on -- looking
>      for the next 'valid' header, or the 'end of headers' blank line.

This appears to be the case.

>   2) it 'assumes' that the 'end of headers' blank line was missed, and that
>      this is 'body' text.
> 
Looking at the source, the blank line appears to be present.

> 
> The 'right' solution to this problem is to get the mailing list to fix
> their BROKEN, NON-STANDARDS-COMPLIANT, software.
> 
:-D  You know how likely that is :-)

> A possible work-around -- *if* 'possibility 2', above applies -- is to
> stick "HB" flags on those two recipes.   Doing that would mean possible
> 'false positives' on other mail, but given the nature of the specific
> patterns, it's very unlikely to be a problem.
> 
> 
> _IF_ 'possibility 1' applies, _and_ the list owner won't fix =their=
> problem, one can repair things on the receiving end, but it takes some
> actual "programming".  Need a program that will convert 'from:' and
> 'subject:', when encountered at the beginning of a line, and before the
> first blank line, to 'From:' and 'Subject:', respectively.  Then, you
> invoke this program, as a 'filter', in a recipe with no conditions,
> _before_ the two recipes you show above.  A crude, ugly, brute-force
> solution, but it will get the job done.

I guess this is the correct answer for this case, but I fear it would be 
beyond my capabilities.  Maybe some of my friends could give me a clue.

Thanks for the speedy answer.  I've been fighting this one for a very long 
time, and at least I know now that it's not being caused by errors on my part.

Anne
-- 
New to KDE Software? - get help from http://userbase.kde.org

____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
[email protected]
http://mailman.rwth-aachen.de/mailman/listinfo/procmail
signature.asc (application/pgp-signature, 198 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.16 (GNU/Linux)

iEYEABECAAYFAk1brnIACgkQj93fyh4cnBf3QwCfdfub8ePnMIdSDKz3CDV8+jbn
pQUAn0XXav5RUdX7I6qla3z6XfDG+nZm
=Sl0k
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.