Gnus development mailing list
 help / color / mirror / Atom feed
* Advanced Scoring Syntax with "To" and "Cc" Headers
@ 2024-03-07  2:48 Husain Alshehhi
  0 siblings, 0 replies; 5+ messages in thread
From: Husain Alshehhi @ 2024-03-07  2:48 UTC (permalink / raw)
  To: ding

From the documentation[1], one can configure complex rules through and,
or, not operators. The documentation also states that match operators
are "header name strings followed by a match and a match type". The
documentation also provides examples[2].

However, all the docs and the examples provide the simple "from",
"body", "subject", "line" match operators. I am unable to create rules
that use "header" or "extra" operators. Ultimately, I want to setup a
rule that scores an message based on the (1) "from" header AND "to"
header, (2) "from" header AND "cc" header, (3) "from" header AND an
arbitrary header.

gnus errors out when parsing the following rules:

--8<---------------cut here---------------start------------->8---
((&
   ("from" "example@domain.com")
   ("to" "example@domain.com")) 10)

((&
   ("from" "example@domain.com")
   ("header" "example@domain.com" "To")) 10)

((&
   ("from" "example@domain.com")
   ("header" "example@domain.com" s "To")) 10)   

((&
   ("from" "example@domain.com")
   ("extra" "To: .*example@domain.com")) 10)
--8<---------------cut here---------------end--------------->8---

Any help is appreciated. Thanks.


[1]
https://www.gnu.org/software/emacs/manual/html_node/gnus/Advanced-Scoring-Syntax.html
[2]
https://www.gnu.org/software/emacs/manual/html_node/gnus/Advanced-Scoring-Examples.html


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Advanced Scoring Syntax with "To" and "Cc" Headers
@ 2024-03-08  8:35 Jakub Ječmínek
  0 siblings, 0 replies; 5+ messages in thread
From: Jakub Ječmínek @ 2024-03-08  8:35 UTC (permalink / raw)
  To: ding; +Cc: Husain Alshehhi

> Thank you. This seems to be working.

Glad it worked.

> But performance is the main reason I use "extra" for CC and To (after
> setting gnus-extra-headers). Is there an equivalent syntax for using
> "extra" matcher?

It seems that you cannot use `extra' match in advanced scoring at
all (see `gnus-advanced-index' variable).

-- 
Kuba Ječmínek (http://kubajecminek.cz)



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Advanced Scoring Syntax with "To" and "Cc" Headers
  2024-03-07 15:07 Jakub Ječmínek
@ 2024-03-08  5:16 ` husain
  0 siblings, 0 replies; 5+ messages in thread
From: husain @ 2024-03-08  5:16 UTC (permalink / raw)
  To: Jakub Ječmínek; +Cc: ding

Jakub Ječmínek <kuba@kubajecminek.cz> writes:

> Hi, I think that this is the syntax you're looking for:
>
> (((&
>    ("from" "Eric Abrahamsen")
>    ("head" "Cc: ding@gnus.org" s))
>   1000))
>
> Please note that scoring on "non-standard" headers takes
> a while.

Thank you. This seems to be working.

But performance is the main reason I use "extra" for CC and To (after
setting gnus-extra-headers). Is there an equivalent syntax for using
"extra" matcher?

-- 
Husain


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Advanced Scoring Syntax with "To" and "Cc" Headers
@ 2024-03-07 15:07 Jakub Ječmínek
  2024-03-08  5:16 ` husain
  0 siblings, 1 reply; 5+ messages in thread
From: Jakub Ječmínek @ 2024-03-07 15:07 UTC (permalink / raw)
  To: ding

Hi, I think that this is the syntax you're looking for:

(((&
   ("from" "Eric Abrahamsen")
   ("head" "Cc: ding@gnus.org" s))
  1000))

Please note that scoring on "non-standard" headers takes
a while.

Best

--
Kuba Ječmínek (http://kubajecminek.cz)


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Advanced Scoring Syntax with "To" and "Cc" Headers
       [not found] <39907.3355061532$1709779878@news.gmane.org>
@ 2024-03-07  9:03 ` Eric S Fraga
  0 siblings, 0 replies; 5+ messages in thread
From: Eric S Fraga @ 2024-03-07  9:03 UTC (permalink / raw)
  To: ding

On Wednesday,  6 Mar 2024 at 20:48, Husain Alshehhi wrote:
> From the documentation[1], one can configure complex rules through and,
> or, not operators. The documentation also states that match operators
> are "header name strings followed by a match and a match type". The
> documentation also provides examples[2].

My understanding is that the matches that look like this:

>    ("from" "example@domain.com")

should have the second argument be a list, so something like

>    ("from" ("example@domain.com"))

might do the job?  I've never used the logical operators you are trying
to use however.

-- 
Eric S Fraga via gnus (Emacs 30.0.50 2024-02-28) on Debian 12.2



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-03-08  8:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-07  2:48 Advanced Scoring Syntax with "To" and "Cc" Headers Husain Alshehhi
     [not found] <39907.3355061532$1709779878@news.gmane.org>
2024-03-07  9:03 ` Eric S Fraga
2024-03-07 15:07 Jakub Ječmínek
2024-03-08  5:16 ` husain
2024-03-08  8:35 Jakub Ječmínek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).