[Dovecot] mailboxcasecmp()
I remember way back, i'd modified the dspam training plugin to compare mailbox names case-insensitively. that patch wasn't accepted. i didn't understand why since it was obviously correct and had no negative impact, at least i didn't think so.
Now I've hit another case where case-insensitive mailbox names would be useful: +addressing.
If I have a mailbox 'Ext' and I send mail to frank+Ext@, the LHS is lowercased to 'frank+ext' and the +extension delivery doesn't find the 'Ext' mailbox.
If the +extension is going to be lowercased, then the mailbox names should be lowercased when looking for them. Or, since 'ext' and 'Ext' can co-exist, the +extension shouldn't be lowercased when looking for the mailbox.
I prefer the former (lowercase everything), since it's unlikely a user would create both 'mailbox' and 'Mailbox', however I can envision plenty of times where users would try to use '+ext' yet create the '+Ext" mailbox and never be able to figure out why it doesn't work. I know the latter solution (case sensitive extensions and case sensitive mailboxes) is more correct but really it will be harder to debug user problems.
-frank
On Wed, 2009-12-02 at 02:19 -0800, Frank Cusack wrote:
I remember way back, i'd modified the dspam training plugin to compare mailbox names case-insensitively. that patch wasn't accepted. i didn't understand why since it was obviously correct and had no negative impact, at least i didn't think so.
I guess I didn't like that it was ascii-only. Nowadays Dovecot supports i;unicode-casemap to do Unicode case insensitive checks. That could be used.. But that could be done internally by dspam too. I'm not sure if there's much point in adding mailboxcasecmp() that does exactly the same as unicode_casecmp() (although a simple version of that doesn't exist yet either).
Now I've hit another case where case-insensitive mailbox names would be useful: +addressing.
If I have a mailbox 'Ext' and I send mail to frank+Ext@, the LHS is lowercased to 'frank+ext' and the +extension delivery doesn't find the 'Ext' mailbox.
If the +extension is going to be lowercased, then the mailbox names should be lowercased when looking for them. Or, since 'ext' and 'Ext' can co-exist, the +extension shouldn't be lowercased when looking for the mailbox.
Well.. I suppose the logic could be like:
Try opening the mailbox. If it exists, great, use it.
If it doesn't exist, try to find the mailbox case-insensitively. There may be multiple levels, like user+work/foo/stuff@domain.org so it would have to match all work, foo and stuff case-insensitively separately. Mailbox listing also makes it slower, but if this isn't done often it's probably not such a big deal.
participants (2)
-
Frank Cusack
-
Timo Sirainen