Re: Help with body rule

2014-05-28 Thread Alex
Hi, > I'm used to a buffer being a __CHUNK (using your rule example) of > > text, or the first 4k or so, not up to the first two line breaks, so I > > was confused. > > You are confused, indeed. And confusing body for rawbody rules. So much > for the pun. ;) > > The terms I were using are directl

Re: Help with body rule

2014-05-28 Thread Karsten Bräckelmann
On Wed, 2014-05-28 at 23:36 -0400, Alex wrote: > > > > A body rule with beginning and end anchors /^ $/ as you posted matches > > > > complete paragraphs. Not the full body. > > > > > > I don't think I realized multiple buffers weren't considered > > > simultaneously. > > > > I don't get "buffer",

Re: Help with body rule

2014-05-28 Thread Alex
Hi, > > A body rule with beginning and end anchors /^ $/ as you posted matches > > > complete paragraphs. Not the full body. > > > > I don't think I realized multiple buffers weren't considered > > simultaneously. > > I don't get "buffer", neither "simultaneously" in this context. > I'm used to a

Re: Help with body rule

2014-05-28 Thread Karsten Bräckelmann
On Wed, 2014-05-28 at 22:05 -0400, Alex wrote: > This is the quoted-printable text/html content: > > > > > #00"> > Hi! href=3D"http://example.ru/rnj/trouble.php";>http://example.ru/rnj/trouble.php > > where example.ru is the real domain (which is now a dead link anyway). > The rendered v

Re: Help with body rule

2014-05-28 Thread Karsten Bräckelmann
On Wed, 2014-05-28 at 21:55 -0400, Alex wrote: > On Wed, May 28, 2014 at 5:36 PM, Karsten Bräckelmann wrote: > > Oh, come on, Alex. We've had that topic just recently in your "Help with > > short bodys with URLs" thread. Which wasn't the first time either... > > I know, I know. I actually started

Re: Help with body rule

2014-05-28 Thread Alex
Hi, > > ifplugin Mail::SpamAssassin::Plugin::BodyEval > >if can(Mail::SpamAssassin::Plugin::BodyEval::has_check_body_length) > > > body __BODY_LENGTH_100 eval:check_body_length('100') > > This indeed may be a neat substitution to the __RB_LE_nnn and __CHUNK > rules discussed, to match short m

Re: Help with body rule

2014-05-28 Thread Alex
Hi, On Wed, May 28, 2014 at 5:36 PM, Karsten Bräckelmann wrote: > > On Wed, 2014-05-28 at 14:16 -0400, Alex wrote: > > I'm trying to write a body rule that will catch an email exactly > > containing any number of characters up to 15, followed by a URI, > > followed by any number of characters, up

Re: [Bug 7045] "insecure dependency" and "can't locate object method"

2014-05-28 Thread Karsten Bräckelmann
On Thu, 2014-05-29 at 03:21 +0200, Karsten Bräckelmann wrote: > spamassassin --lint -D debug output will show weather that cf file and Whether. *sigh* When did I unlearn that? > the plugin are loaded. Running --lint without debug might be worthwhile > on its own already. -- char *t="\10pse\0r

Re: [Bug 7045] "insecure dependency" and "can't locate object method"

2014-05-28 Thread Karsten Bräckelmann
On Wed, 2014-05-28 at 20:54 -0400, Art Werschulz wrote: > > Your SA installation seems to be broken. That's stock code: > > > > $ grep -rl check_https_http_mismatch . > > Mail/SpamAssassin/Plugin/HTTPSMismatch.pm > > I have the same thing: > > $ pwd > /usr/share/perl5/vendor_perl/Mail/Sp

Re: Help with body rule

2014-05-28 Thread Karsten Bräckelmann
On Thu, 2014-05-29 at 00:12 +0200, Axb wrote: > On 05/28/2014 11:36 PM, Karsten Bräckelmann wrote: > > Another approach would be to actually ensure there is only a single > > chunk. And finally, meta them together. > > > >rawbody __CHUNK /^./ > >tflags __CHUNK multiple > or a "modern"

Re: Help with body rule

2014-05-28 Thread Axb
On 05/28/2014 11:36 PM, Karsten Bräckelmann wrote: Another approach would be to actually ensure there is only a single chunk. And finally, meta them together. rawbody __CHUNK /^./ tflags __CHUNK multiple metaSHORT_BODY_URI __SHORT_BODY_URI && (__CHUNK == 1) That all said,

Re: Help with body rule

2014-05-28 Thread Karsten Bräckelmann
On Wed, 2014-05-28 at 14:16 -0400, Alex wrote: > I'm trying to write a body rule that will catch an email exactly > containing any number of characters up to 15, followed by a URI, > followed by any number of characters, up to 15. My attempt has failed > miserably, and hoped someone could help. >

Re: Rule Help

2014-05-28 Thread John Hardin
On Wed, 28 May 2014, Rejaine Monteiro wrote: So, I doing this: header __ORCAMENTO_H Subject =~ /or.*amento|planilha|urgente/i body __ORCAMENTO_B /or.*amento|planilha|urgente/i ...is redundant. The subject text is included in body rules. -- John Hardin KA7OHZhttp://www.im

Re: Capture vs non-capture groups

2014-05-28 Thread John Hardin
On Wed, 28 May 2014, Ian Zimmerman wrote: On Wed, 28 May 2014 10:47:35 -0700 (PDT) John Hardin wrote: John> The only place I've found backreferences useful is when writing a John> header rule that is looking for the same string in multiple John> headers. John> Other than that, captures are ve

RE: Help with body rule

2014-05-28 Thread John Hardin
On Wed, 28 May 2014, Arthur Glennie wrote: [quote] I'm trying to write a body rule that will catch an email exactly containing any number of characters up to 15, followed by a URI, followed by any number of characters, up to 15. My attempt has failed miserably, and hoped someone could help.

Re: Help with body rule

2014-05-28 Thread Adam Katz
On 05/28/2014 11:16 AM, Alex wrote (syntax highlighting added): > I'm trying to write a body rule that will catch an email exactly > containing any number of characters up to 15, followed by a URI, > followed by any number of characters, up to 15. My attempt has failed > miserably, and hoped someon

Re: Capture vs non-capture groups

2014-05-28 Thread Ian Zimmerman
On Wed, 28 May 2014 10:47:35 -0700 (PDT) John Hardin wrote: John> The only place I've found backreferences useful is when writing a John> header rule that is looking for the same string in multiple John> headers. John> Other than that, captures are very rare. There was a pattern in the recent c

RE: Help with body rule

2014-05-28 Thread Arthur Glennie
[quote] I'm trying to write a body rule that will catch an email exactly containing any number of characters up to 15, followed by a URI, followed by any number of characters, up to 15. My attempt has failed miserably, and hoped someone could help. [/quote] This should work for you: BodyLOC

Re: Capture vs non-capture groups

2014-05-28 Thread Amir Caspi
On May 28, 2014, at 12:16 PM, Joe Quinn wrote: > > It could be worth discussing again. Perhaps you could write a proof of > concept and see what other use cases it has? In prior discussions, I think I mentioned it would be useful for spam templates... some templates embed a hash string in mult

RE: Capture vs non-capture groups

2014-05-28 Thread Arthur Glennie
[quote] I believe it has been discussed before, specifically regarding the __TO_IN_SUBJ rule in 70_sandbox.cf It could be worth discussing again. Perhaps you could write a proof of concept and see what other use cases it has? [/quote] Thanks, I was not aware it had already been discussed. I can inv

Help with body rule

2014-05-28 Thread Alex
Hi, I'm trying to write a body rule that will catch an email exactly containing any number of characters up to 15, followed by a URI, followed by any number of characters, up to 15. My attempt has failed miserably, and hoped someone could help. body LOC_SHORT_BODY_URI m{^.{0,15}(https?://.

Re: Capture vs non-capture groups

2014-05-28 Thread Joe Quinn
On 5/28/2014 2:10 PM, Arthur Glennie wrote: [quote] The only place I've found backreferences useful is when writing a header rule that is looking for the same string in multiple headers. Other than that, captures are very rare. If SA had a way to capture a match from rule1 and use that in rule2 y

RE: Capture vs non-capture groups

2014-05-28 Thread Arthur Glennie
[quote] The only place I've found backreferences useful is when writing a header rule that is looking for the same string in multiple headers. Other than that, captures are very rare. If SA had a way to capture a match from rule1 and use that in rule2 you might see more of that. [/quote] So it can

Re: Capture vs non-capture groups

2014-05-28 Thread John Hardin
On Wed, 28 May 2014, Arthur Glennie wrote: Specific to spamassassin, are capture groups ever useful, or should I always use non-capture groups? Eg. (lit) vs. (?:lit) The only place I've found backreferences useful is when writing a header rule that is looking for the same string in multiple h

Re: Capture vs non-capture groups

2014-05-28 Thread Bowie Bailey
On 5/28/2014 12:44 PM, Arthur Glennie wrote: Specific to spamassassin, are capture groups ever useful, or should I always use non-capture groups? Eg. (lit) vs. (?:lit) This is not specific to SA, but the same in any regular expression. If you need to reference the captured string later, use a

Re: Capture vs non-capture groups

2014-05-28 Thread Joe Quinn
On 5/28/2014 12:46 PM, Kevin A. McGrail wrote: On 5/28/2014 12:44 PM, Arthur Glennie wrote: Specific to spamassassin, are capture groups ever useful, or should I always use non-capture groups? Eg. (lit) vs. (?:lit) I believe ?: will always be ever so slightly more efficient. He's asking if the

Re: Capture vs non-capture groups

2014-05-28 Thread Kevin A. McGrail
On 5/28/2014 12:44 PM, Arthur Glennie wrote: Specific to spamassassin, are capture groups ever useful, or should I always use non-capture groups? Eg. (lit) vs. (?:lit) I believe ?: will always be ever so slightly more efficient.

Capture vs non-capture groups

2014-05-28 Thread Arthur Glennie
Specific to spamassassin, are capture groups ever useful, or should I always use non-capture groups? Eg. (lit) vs. (?:lit)

Re: Rule Help

2014-05-28 Thread Bowie Bailey
On 5/28/2014 11:14 AM, Martin Gregorie wrote: On Wed, 2014-05-28 at 10:19 -0300, Rejaine Monteiro wrote: So, I doing this: header __ORCAMENTO_H Subject =~ /or.*amento|planilha|urgente/i body __ORCAMENTO_B /or.*amento|planilha|urgente/i uri __ORCAMENTO_U /orcamento\.php|/orcamento\.pdf|planilha\

Re: Rule Help

2014-05-28 Thread Rejaine Monteiro
In fact, there was this error, even after fixing it still didn't work. I believe that the problem was occurring because the message had a HMTL attached and in turn had a link to the file. I decided to change and do as follows: header __ORCAMENTO_H Subject =~ /or.*amento|planilha|urgente/i bod

Re: Rule Help

2014-05-28 Thread Bowie Bailey
On 5/28/2014 9:19 AM, Rejaine Monteiro wrote: Hi I need a rule to block spam contains Subject or Body contains words 'or.*amento' or 'planilha' or 'urgente' AND URI contains links to orcamento or panilha (php or pdf) So, I doing this: header __ORCAMENTO_H Subject =~ /or.*amento|planilha|urgent

Rule Help

2014-05-28 Thread Rejaine Monteiro
Hi I need a rule to block spam contains Subject or Body contains words 'or.*amento' or 'planilha' or 'urgente' AND URI contains links to orcamento or panilha (php or pdf) So, I doing this: header __ORCAMENTO_H Subject =~ /or.*amento|planilha|urgente/i body __ORCAMENTO_B /or.*amento|planilha|u