>>>>> "mick" == mick crane <mick.crane at gmail.com> writes:> I'm using what ever is in Debian Bookworm, I'm pretty sure. > These filters?sieve of some sort.> I collect from different email addresses like gmail and that. If > filter for the "Sent to" email address, move to this directory If > "From" contains "blah", move to this other directory. If something > is Sent to and also From contains "blah" then I get 2 copies of the > message in both filter directories. How can I fix this? regardsBy posting an example of the non-working filter code? Otherwise how do we know what's giong wrong? Maybe you're filtering the wrong way? I use something like this and it's pretty good: require ["fileinto", "envelope"]; require "imap4flags"; require "regex"; if header :contains "Sender" "linux-kernel-owner at vger.kernel.org" { fileinto "lkml"; } elsif header :contains "X-Mailing-List" "linux-kernel at vger.kernel.org" { fileinto "lkml"; } else { # The rest goes into INBOX # default is "implicit keep", we do it explicitly here keep; } There's an implicit exit in each block as I recall and as my notes in there show... I've got a whole bunch of other matches. Now where *my* rules fail at times is handling duplicates which were went to a mailing list AND sent to me directly. I need to fix it, but haven't bothered to spend the time yet.
John Stoffel skrev den 2022-12-13 01:42:> I use something like this and it's pretty good: > > require ["fileinto", "envelope"]; > require "imap4flags"; > require "regex";can be merged into one line> if header :contains "Sender" "linux-kernel-owner at vger.kernel.org" { > fileinto "lkml"; > } > elsif header :contains "X-Mailing-List" > "linux-kernel at vger.kernel.org" > { > fileinto "lkml"; > }can be merged into one line if "List-Id: Dovecot Mailing List <dovecot.dovecot.org>" is used> else { > # The rest goes into INBOX > # default is "implicit keep", we do it explicitly here > keep; > } >posting to maillist will get dupes in return since message-id would not change, if any thing should be filtered as dupe delte the sent mail or do nothing :)
On 2022-12-13 00:42, John Stoffel wrote:> Maybe you're filtering the wrong way? > > I use something like this and it's pretty good: > > require ["fileinto", "envelope"]; > require "imap4flags"; > require "regex"; > > if header :contains "Sender" "linux-kernel-owner at vger.kernel.org" { > fileinto "lkml"; > } > elsif header :contains "X-Mailing-List" > "linux-kernel at vger.kernel.org" > { > fileinto "lkml"; > } > else { > # The rest goes into INBOX > # default is "implicit keep", we do it explicitly here > keep; > }I'm sorry, question should have gone to roundcube list as it is roundcube plugin "manage_sieve" am using to make rules. Don't see "elsif" in rule options which is likely what I want. I'll search for the sieve config file on Debian bullseye. cheers mick