Sieve rule to move DeltaChat mails to DeltaChat folder

Hi everyone,

a friend of mine tried out DeltaChat and was immediately bothered that his standard mail Client (I think AquaMail), which he configured to watch the inbox with IMAP IDLE, would notify him whenever a DeltaChat mail came in. I assume that is because when DeltaChat gets the notification from the IMAP server, it’s already too late.

Since he has the opportunity to configure sieve rules on his mail server, I was wondering whether anyone could provide a solid sieve rule that identifies DeltaChat mails and moves them to the DeltaChat folder. This should solve his issue, because the messages would never even show up in the Inbox folder, from his mail client’s perspective.


1 Like

I don’t know anything about sieve rules but what about all messages starting with “Chat:”?

I would rather user Delta Chats custom mail headers for detection…
without the pgp key, encrypted DC messages can’t be filtered based of the subject…

Shouldn’t the subject be Chat: Encrypted message for encrypted messages?

From what I saw yesterday, encrypted messages had just “…” as subject.

I see a “Chat-Version: 1.0” header, and “X-Mailer: Delta Chat 0.40.0 for Android” - but the values of both are likely to change in the future.
I guess doing a “contains” match on the “X-Mailer” header and look for “Delta Chat” should work, but I’m open to better ideas.

In “sieve”, that would mean:

<Spam filtering>

require "fileinto";
if header :contains "X-Mailer" "Delta Chat" {
  fileinto "DeltaChat";

<Other rules, like moving mails from recipient "X Y" to folder "Friends/X_Y">

The problem of double notifications has been reported long ago, but has not been addressed and solved yet. If the coming re-introduction of the Email browsing (Make Contact Requests more visible) will also allow deltachat to emit notifications for regular emails again, it could be one solution to turn the notification off in the standard email client, and let deltachat handle that.

Concerning the SIEVE filter, it may be more robust to filter by message IDs, in-reply-to, and references starting with “<Mr.”, to also get the replies to chats sent from classic email clients.

If you get it working, you could add it to the SIEVE part in this wiki page:

Have you found a solution to share?

I would check for existence of the Chat-Version Header

1 Like

Here is my working sieve filter which is checking on the “Chat-Version” header:

require ["fileinto"];

if header :contains ["Chat-Version"] [""] {
  fileinto "DeltaChat";

the “” checks for “exists” of the header as documented here: rfc5228

1 Like