Re: Sieve by the addressee
> On 20 Feb 2021, at 11:02, Shawn Heisey wrote: > > On 2/20/2021 8:50 AM, Markus Schönhaber wrote: >> I consider it a better idea to filter mailing list messages by their >> List-ID header. > > I agree with Markus. It's what I do. This works well: > > if header :regex "list-id" "solr-user.lucene.apache.org" > { >fileinto "asf.solr-user"; >stop; > } if header :regex "list-id" "<([a-z_0-9-]+)[.@]" { set :lower "listname" "${1}"; addheader "X-Listname" "${listname}"; fileinto :create "${listname}"; stop; } > I do not know if List-ID is common to all mailing list software, but even if > it's not, there should be something available in the message headers that you > can use. It is not universal, but it is nearly so. There are still some old lists running old software that do not support I, but they are few enough that I no longer have rules to catch those lists. -- A bad day using a Mac is better than a good day using Windows
Re: Sieve by the addressee
On 20/02/2021 18:02, Shawn Heisey wrote: > On 2/20/2021 8:50 AM, Markus Schönhaber wrote: >> I consider it a better idea to filter mailing list messages by their >> List-ID header. > > I agree with Markus. It's what I do. This works well: > > if header :regex "list-id" "solr-user.lucene.apache.org" > { > fileinto "asf.solr-user"; > stop; > } > > I do not know if List-ID is common to all mailing list software, but > even if it's not, there should be something available in the message > headers that you can use. It's not, but it's fairly common. A few years ago someone posted a strategy for procmail that handled almost any kind of mailinglist software. I've translated that to the following sieve script (which, now that I look at it, could probably do with a bit of optimisation): # split out the various list forms # Apparently, mutt-users has some odd format, so handle it specially. if exists "list-post" { if header :regex "list-post" " > Thanks, > Shawn OpenPGP_signature Description: OpenPGP digital signature
Re: Sieve by the addressee
Hi all! On 20/02/2021 19:02, Shawn Heisey wrote: > On 2/20/2021 8:50 AM, Markus Schönhaber wrote: >> I consider it a better idea to filter mailing list messages by their >> List-ID header. > > I agree with Markus. It's what I do. This works well: > > if header :regex "list-id" "solr-user.lucene.apache.org" I use :contains or :is ... > { > fileinto "asf.solr-user"; > stop; > } > > I do not know if List-ID is common to all mailing list software, but It should be - RFC2919 defines it and at least mailman set's it. > even if it's not, there should be something available in the message > headers that you can use. MfG, Bernd -- Bernd Petrovitsch Email : be...@petrovitsch.priv.at There is NO CLOUD, just other people's computers. - FSFE LUGA : http://www.luga.at
Re: Sieve by the addressee
On 2/20/2021 8:50 AM, Markus Schönhaber wrote: I consider it a better idea to filter mailing list messages by their List-ID header. I agree with Markus. It's what I do. This works well: if header :regex "list-id" "solr-user.lucene.apache.org" { fileinto "asf.solr-user"; stop; } I do not know if List-ID is common to all mailing list software, but even if it's not, there should be something available in the message headers that you can use. Thanks, Shawn
Re: Sieve by the addressee
20.02.21, 15:44 +0100, m...@shadrinden.ru: > I have a sieve that is supposed to put all messages addressed to this mailing > list into a separate folder: > > if anyof (address :is "to" "m...@shadrinden.ru", > address :is "to" "dovecot@dovecot.org") { > fileinto "mail_list"; > stop; > } > > Generally, it's working, but today I have got two mailing list messages that > weren't put in that folder, they arrived straight into INBOX. I suppose that > was because they were replies and were addressed to the person who asked the > questions, so they had his address in "To:", and only in "Cc:" they had > dovecot@dovecot.org. > > So, am I right that, when filtering messages by the addressee, it's generally > a good idea to use not just "to", but ["to", "cc', "bcc"] ? I consider it a better idea to filter mailing list messages by their List-ID header. -- Regards mks