Move chat messages into .DeltaChat (postfix/maildrop/virtual mailboxes)

I’m trying to setup a filter rule for maildrop in order to move delta messages into .DeltaChat folder of virtual mailboxes.

My setup:
postfix delivers to mailboxes using maildrop, both to local users and virtual users.

master.cf

maildrop  unix  -       n       n       -       -       pipe
flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient}

I could easily set up a filter rule using “Chat-Version” header for local users with the following rule in /etc/maildroprc (or ~/.mailfilter)

DEFAULT="$HOME/Mail"
if (/^Chat-Version/)
{
    exception {
        to $DEFAULT/".DeltaChat"
    }
}

But this does not work for virtual mailboxes.

Anyone familiar with this setup and can help me out?

Why do I need this?
I have users on my mailserver which use delta desktop only sporadically and have no other delta app installed. Whenever they read their regular mail, confusing chat messages pop up in their inbox

With sieve enabled server you can use following:

if anyof (header :regex "chat-version" "(.*)", header :regex "x-mailer" "Delta Chat Core (.*)")
{
    fileinto "DeltaChat";
    stop;
}

Works for me since years

1 Like