So, this is what I did instead of default_sieve:
sieve_before = file:/usr/lib/dovecot/sieve/bcc.sieve sieve_before2 = file:/usr/lib/dovecot/sieve/filespam.sieve
# cat /usr/lib/dovecot/sieve/bcc.sieve require ["variables", "copy"];
if address :matches ["To", "Cc"] ["*@*."] { redirect :copy "backup+295.${1}.${2}@. . ."; }
# cat /usr/lib/dovecot/sieve/filespam.sieve require ["fileinto", "imap4flags"];
if header :contains "X-spam-flag" "YES" { fileinto :flags "\Seen" "Junk"; }
The bcc.sieve file is generated each day with a little script to put in the day of the year, so that for the backup user the folder structure for backups for my list mail is, for example:
295 kremels kreme <messages> otheruser kreme <messages>
And tomorrow new folders for 296 will be created.
So far, I think it's working. 🤞
-- C code. C code run. Run, code, run.