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

Sebastian Nielsen sebastian at sebbe.eu
Sat May 9 18:31:33 EEST 2020


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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5249 bytes
Desc: S/MIME Cryptographic Signature
URL: <https://dovecot.org/pipermail/dovecot/attachments/20200509/e7c73c7f/attachment.p7s>


More information about the dovecot mailing list