Next: , Previous: Structure of subscriber databases, Up: Overview of ezmlm function

4.12 Local case in email addresses

rfc822 states that the host part of an address is case insensitive, but that case of the local part should be respected and the interpretation of it is the prerogative of the machine where the mailbox exists. Thus, ezmlm preserves the case of the local part, but converts the host part to lower case. ezmlm proper also bases the hash on the case of the local part, so that ‘USER@host’ and ‘user@host’ are not (usually) stored in the same file.

Locally, deliveries are most often case insensitive, i.e. mail to ‘USER@host’ and ‘user@host’ are delivered to the same mail box. A consequence of this is that many users use email addresses with different case interchangeably. The problem is that when ‘USER@host’ is subscribed, ezmlm will not find that address in response to an unsubscribe request from ‘user@host’. This is even more problematic when email addresses have been added by hand to e.g. moderator lists.

ezmlm-idx>=0.22 changes address storage to make comparisons case insensitive and store email addresses based on the hash of the all lower case address. Case is maintained for the local part. Thus, if ‘USER@host’ is subscribed, mail is set to ‘USER@host’, but ‘user@host’ is recognized as a subscriber and an unsubscribe request from ‘user@host’ will remove ‘USER@host’ from the subscriber list.

To maintain backwards compatibility with old subscriber lists, a second lookup is made for partially upper case email addresses in some cases. This will find ‘USER@host’ subscribed with a case sensitive hash as well.

It may be useful to move all old mixed case email addresses to the ‘new’ positions. Without this, ‘USER@host’ subscribed with the old system will be able to unsubscribe as ‘USER@host’, but not as ‘user@host’. After the repositioning, s/he will be successfully able to use any case in an unsubscribe request, e.g. ‘UsEr@host’. To do this:

     % ezmlm-list DIR | grep -G '[A-Z]' > tmp.tmp
     % xargs ezmlm-sub DIR < tmp.tmp

This works, because subscribing an address, even if it already exists, will assure that it is stored with a case insensitive hash. On some systems, the grep -G switch need/should not be used.