Thanks Thomas. I completely and utterly missed that the ^ inside the brackets negates. I was thinking it was a boundary! I should have known better.
For the benefit of anyone else who goes carrot blind in the future (or for my notes).... \nfrom:[^\r\n]+?\@.+\.fr[>\b] .+?\nto:[^\r\n]+?the_recipient\@your_domain\.com=>40 looks for: from: at the start of a line followed by one or more characters that is NOT a line break [^\r\n] until we get to an @ (from there it's pretty self explanatory, but I'm more than happy to explain further as needed) On Mon, Sep 9, 2019 at 5:01 AM Thomas Eckardt <thomas.ecka...@thockar.com> wrote: > learn regular expressions - I dont want to explain - both lines are simple > and can be read from left to right - they are relative slow and can be > improved using 'look behind' and 'look aheat' > > assp/docs/Regular Expression Tutorial.htm > > http://www.rexegg.com/ > > >Aren't those all legal and likely? > All these cases are catched! > > Thomas > > > > > > Von: "K Post" <nntp.p...@gmail.com> > An: "ASSP development mailing list" < > assp-test@lists.sourceforge.net> > Datum: 08.09.2019 23:10 > Betreff: Re: [Assp-test] Help requested scoring mail from .fr > domains to a specific user > ------------------------------ > > > > > I'm assuming this should go into BombHeaderRe like: > \nfrom:[^\r\n]+?\@.+\.fr[>\b] > .+?\nto:[^\r\n]+?the_recipient\@your_domain\.com=>40 > \nto:[^\r\n]+?the_recipient\@your_domain\.com.+?\nfrom:[^\r\n]+?\@.+?\.fr > [>\b]=>40 > > I've got to be misunderstanding something with the relatively simply regex > that you so kindly provided. Is ASSP doing some sort of simplification of > the header before comparing first? > > As is, .I see how it would catch > to:ouru...@ourcharity.org > *from:anyth...@wahtever.fr* <from%3aanyth...@wahtever.fr> > in any order, but how would this catch something where the header has > something like: > From: "B & H France" <*newslet...@bandh.fr* <newslet...@bandh.fr>> > To: "Our User" <*ouru...@ourcharity.org* <ouru...@ourcharity.org>> > or even if there's just a space between the from and the email address > To: ouru...@ourcharity.org > or the email address is surrounded by < and > > To: <ouru...@ourcharity.org> > > Aren't those all legal and likely? > > > > > > > On Thu, Aug 29, 2019 at 2:13 AM Thomas Eckardt < > *thomas.ecka...@thockar.com* <thomas.ecka...@thockar.com>> wrote: > \.fr[>\b] > > should do it > > # > \nfrom:[^\r\n]+?\@.+\.fr[>\b].+?\nto:[^\r\n]+?the_recipient\@your_domain\.com > > # \nto:[^\r\n]+?the_recipient\@your_domain\.com.+?\nfrom:[^\r\n]+?\@.+?\.fr > [>\b] > > > Thomas > > > > > Von: "K Post" <*nntp.p...@gmail.com* <nntp.p...@gmail.com>> > An: "ASSP development mailing list" < > *assp-test@lists.sourceforge.net* <assp-test@lists.sourceforge.net>> > Datum: 29.08.2019 00:25 > Betreff: [Assp-test] Help requested scoring mail from .fr domains > to a specific user > ------------------------------ > > > > I've got a user who never communicates with France, but apparently is on a > French language fashion spam list. She's getting lots of messages from > email addresses ending in .fr and she doesn't want any. I've got as many > as I can in errors-spam, but my HMM/Bayes databases just doesn't have > enough French language content. > > Now, some users do need communicate with France, so it's not like I could > do a blanket block of all fr domains. > > Much of the mail comes out of bulk mailers like Constant Contact and > sendgrid in the US. Using geolocation isn't going to help here. > > So, I was thinking of doing something like what was proposed years ago in > this group, using a regex in BombHeaderRe to score messages from a .fr > address to this specific user using the template that was provided. > > #first case - from: before to: in the header > # > \nfrom:[^\r\n]+?\@sender_domain\.com.+?\nto:[^\r\n]+?the_recipient\@your_domain\.com > #second case - to: before from: in the header > # > \nto:[^\r\n]+?the_recipient\@your_domain\.com.+?\nfrom:[^\r\n]+?\@sender_domain\.com > > # > > So something like: > #first case - from: before to: in the header > # \nfrom:[^\r\n]+?\@.*\.fe.+?\nto:[^\r\n]+?the_recipient\@your_domain\.com > #second case - to: before from: in the header > # \nto:[^\r\n]+?the_recipient\@your_domain\.com.+?\nfrom:[^\r\n]+?\@*\.fr > # > > But, I believe that'll also block mail where the from is FRank.com. > Any suggestions on how to block domains ending in .fr? > should I be looking for > .fr> > .fr[^\r\n] > What else? > > OR, is there a better way to accomplish this? > I know that the lingua plugin isn't strong enough to detect the exact > romantic language, plus it needs to be just for this user.... > > THANK YOU > > > > _______________________________________________ > Assp-test mailing list > *Assp-test@lists.sourceforge.net* <Assp-test@lists.sourceforge.net> > *https://lists.sourceforge.net/lists/listinfo/assp-test* > <https://lists.sourceforge.net/lists/listinfo/assp-test> > > > > > DISCLAIMER: > ******************************************************* > This email and any files transmitted with it may be confidential, legally > privileged and protected in law and are intended solely for the use of the > individual to whom it is addressed. > This email was multiple times scanned for viruses. There should be no > known virus in this email! > ******************************************************* > > _______________________________________________ > Assp-test mailing list > *Assp-test@lists.sourceforge.net* <Assp-test@lists.sourceforge.net> > *https://lists.sourceforge.net/lists/listinfo/assp-test* > <https://lists.sourceforge.net/lists/listinfo/assp-test> > _______________________________________________ > Assp-test mailing list > Assp-test@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/assp-test > > > > > DISCLAIMER: > ******************************************************* > This email and any files transmitted with it may be confidential, legally > privileged and protected in law and are intended solely for the use of the > individual to whom it is addressed. > This email was multiple times scanned for viruses. There should be no > known virus in this email! > ******************************************************* > > _______________________________________________ > Assp-test mailing list > Assp-test@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/assp-test >
_______________________________________________ Assp-test mailing list Assp-test@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/assp-test