Dovecot interprets dots in plus-address component of address as subfolder boundaries -- bug or feature?
WHM/cPanel v82.0.16. When Dovecot is configured to create subfolders when receiving plus-addressed mail, each dot in the plus-address component is interpreted as a subfolder boundary when delivering incoming mail via LMTP to a maildir folder (I have not tested mdbox format). I have found no reference to this behavior in cPanel or Dovecot's LMTP local mail delivery component. If this behavior is correct, where is it documented?
For example, mail to john.smith+one.two.three@example.com gets delivered not to user john smith's INBOX/one.two.three directory as I expected but to the directory INBOX/one/two/three.
-
Hi @Matthew Swift Ok, this took some serious research and it's not very well documented from dovecot but here's what I have for you: While So while that's what handles plus addressing it's not actually what dictates how the mail is organized for the user. This is instead handled by namespaces. Information on what specifically namespaces are can be found here: Essentially, what namespaces do is dictate how and where to find mailboxes for users. A feature of namespaces is the hierarchy separator and that is where we'll find our answers. maildir's hierarchy separator is a ( . ). Per the documentation in a couple of places, changing this hierarchy separator can cause a bunch of issues: [QUOTE]IMAP clients, Sieve scripts and many parts of Dovecot configuration use the configured separator when referring to mailboxes. This means that if you change the separator, you may break things.
We also found a better reason why in a more obscure documentation source for dovecot0 -
Thank you very much for the thorough and useful reply, including all the links. FWIW, this question came up in a general attempt to take a long, un-enumerated list of active email addresses given over many years to various companies and mailing lists in the form ='something-or-other@example.com'>prefix-something-or-other@example.com and map them to lists+something-or-other@example.com. The reason to do this is to be able to reject default ("catch all") mail on example.com. When contains a dot, the mail gets put in an unexpected subfolder. It's not a significant problem in my application, but I expect if I wanted a solution, a more complicated regexp (in an exim filter) could substitute another character for the first finite N dots in the address (where N is more than ever would be expected). 0 -
Hi @Matthew Swift No problem! I'm glad it helped and it was pretty interesting to find out. I think, in your case, it might be best to do a filter, though I can't help but wonder if a forwarder might suffice? 0
Please sign in to leave a comment.
Comments
3 comments