Marking all emails in "Trash" as opened, and also prohibiting email clients from creating new mails

Marc Roos M.Roos at f1-outsourcing.eu
Sat May 9 19:29:16 EEST 2020


 
Someone just told me about imapsieve. Sieve rules for folders. I assume 
that could solve your issue.

https://wiki.dovecot.org/HowTo/AntispamWithSieve

-----Original Message-----
Sent: 09 May 2020 17:32
To: dovecot at dovecot.org
Subject: Marking all emails in "Trash" as opened, and also prohibiting 
email clients from creating new mails 

Dovecot version: 2.3.7.2 (3c910f64b)
(pkg shipped by: Ubuntu-Desktop 20.04)

I want to accomplish 2 things in dovecot:

1:
I want to force all mails inside Trash to have an "opened"/"read" flag 
and "Non-Recent" flag. Basically Status: RO This regardless how the flag 
appears, either by copying/moving the mail into trash, creating a new 
mail in trash, flagging email in Trash or whatever.

Basically, no email in Trash should ever be able to have a recent or 
unread flag.

I tried with a static mail filter and sieve filter to add \\seen to the 
email upon COPY (as mentioned here:
https://dovecot.org/pipermail/dovecot/2017-November/110122.html ), but 
regardless how I do it, it doesn't work when Samsung Email client 
trashes an unread email, AND/OR also, it causes weird issues like 
duplicate email in the trash folder sometimes.

Best would be some event filter that executes for every mail that 
somehow end up in Trash, that checks if \\seen is present, if not, then 
it will add it, on all emails in trash? But how I do to prevent the 
duplicate copy that appears sometimes?

2:
I want to prohibit email clients from ever creating a new mail in Sent 
folder.
If its possible to allow MOVE and/or COPY, it should be allowed, only 
new mail should be prohibited.
(also note that external processes must be able to create new mail in 
Sent)

HOWEVER - this prohibition must be silent - ergo the newly created email 
is simply discarded. No error message or error codes should be returned 
to IMAP client.

(The reason I want this, is because I have configured my outgoing SMTP 
server to populate Sent, and some email clients doesn't have the option 
to "Don't store a copy of the email in Sent folder" resulting in 
duplicates)


Best regards, Sebastian Nielsen




More information about the dovecot mailing list