Messages sent to alias+detail end up in INBOX

ml at ml at
Wed Feb 17 17:13:13 EET 2021

Hi, Anton!

> Hi Denis,
> > I expected that when I send a message to alias+detail at mydomain.tld,
> > it would go into the "detail" folder of user at mydomain.tld. However,
> > it goes into the INBOX folder of user at mydomain.tld.
> > 
> > Is it the intended behavior?  
> It is.
> To achieve the desired folder, you need a sieve script:
> Ensure that you also subscribe to newly created mailboxes 
> (lda_mailbox_autosubscribe=yes).

Thanks for the advice.

I have tried using this code from the page you adised:

require ["variables", "fileinto", "envelope", "subaddress", "mailbox"];

if envelope :matches :detail "to" "*" {
  # you can prefix with INBOX/ or INBOX. if necessary
  # remove :create if you want to permit only existing mailboxes
  fileinto :create "${1}";

I have also set


Also, I of course have recompiled the sieve with sievec. But the mail is still dropped into INBOX. I suppose it's related to this piece of information also found on that page:

> To work with Postfix, this requires that the envelope "to" still
> contains the full address, so pass it with the -a flag. 

If I understand this correctly, this is needed so that the messages sent to alias+detail at mydomain.tld had "Delivered-To" header not with value of "user at mydomain.tld" but with value of "user+detail at mydomain.tld". Am I right?

So I have put into the postfix config this line:

mailbox_command = /usr/lib/dovecot/dovecot-lda -a "$RECIPIENT"

But in the headers of the received messages I have "Delivered-To: user at mydomain.tld" instead of "Delivered-To: user+detail at mydomain.tld". If this is the source of the problem, then how should I try to fix it?

Denis Shadrin

More information about the dovecot mailing list