Hi, Anton!
Hi Denis,
I expected that when I send a message to alias+detail@mydomain.tld, it would go into the "detail" folder of user@mydomain.tld. However, it goes into the INBOX folder of user@mydomain.tld.
Is it the intended behavior?
It is.
To achieve the desired folder, you need a sieve script:
https://wiki.dovecot.org/Pigeonhole/Sieve/Examples#Plus_Addressed_mail_filte...
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
lda_mailbox_autosubscribe=yes
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@mydomain.tld had "Delivered-To" header not with value of "user@mydomain.tld" but with value of "user+detail@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@mydomain.tld" instead of "Delivered-To: user+detail@mydomain.tld". If this is the source of the problem, then how should I try to fix it?
-- Respectfully, Denis Shadrin