[Dovecot] mailboxcasecmp()

Timo Sirainen tss at iki.fi
Wed Dec 9 21:44:35 EET 2009


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:

1) Try opening the mailbox. If it exists, great, use it.

2) If it doesn't exist, try to find the mailbox case-insensitively.
There may be multiple levels, like user+work/foo/stuff at 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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
Url : http://dovecot.org/pipermail/dovecot/attachments/20091209/be4bcef8/attachment-0001.bin 


More information about the dovecot mailing list