Imexpire and localized mailbox names

From Messaging Server Technical Reference Wiki
Jump to: navigation, search


imexpire and localized mailbox names

The IMAP protocol specifies that mailbox names use modified UTF-7 encoding. Messaging Server supports localized character sets on external interfaces so that mailbox names can be localized. Internally, however, the system converts the localized name to MUTF-7. Thus, a folder that has a localized mailbox name on a client will have a corresponding mailbox file name in MUTF-7. (Note that IMAP error messages will output mailbox names in MUTF-7 and not the localized character set.)

In general, most Message Store utilities that require mailbox names expect the names in the localized character set, although they may have an option flag that allows a different character set to be used. These utilities include reconstruct, mboxutil, imsbackup, imsrestore, and hashdir. However, imexpire requires that the mailbox name, specified as the attribute folderpattern, be in MUTF-7. Using a localized name will not work.

To obtain the appropriate folderpattern value for use with imexpire, it may be necessary to convert a localized mailbox name to the modified UTF-7 equivalent. This can be done using the mboxutil -E command as follows:


$ mboxutil -l -p user/han/*
 
  msgs  Kbytes last msg         partition   quotaroot mailbox
 
    57     100 2010/04/29 11:18 primary       5242880 user/han/INBOX
     1       1 2010/04/30 12:56 primary             -
user/han/multibyte-mailbox-name
 
$ mboxutil -l -E MUTF-7 -p user/han/*
 
    57     100 2010/04/29 11:18 primary       5242880 user/han/INBOX
     1       1 2010/04/30 12:56 primary             -
user/han/&kAFP4W4IMH8wojCkMMYw4A-

The output of the first mboxutil command shows the localized mailbox name. The output of the second mboxutil command shows the mailbox name in MUTF-7. The MUTF-7 mailbox name is identical to that shown in response to an IMAP LIST command:


x list "" *
* LIST (\NoInferiors) "/" INBOX
* LIST (\HasNoChildren) "/" &kAFP4W4IMH8wojCkMMYw4A-

To convert the local charset to modified UTF-7 encoding, use the mboxutil command's -E option:


$ mboxutil -l -E MUTF-7 -P user/han/multibyte-mailbox-name
 
  msgs  Kbytes last msg         partition   quotaroot mailbox
 
     1       1 2010/04/30 12:56 primary             -
user/han/&kAFP4W4IMH8wojCkMMYw4A-

Such a mboxutil -E command can be used in preparation for use of any utility that requires the use of an MUTF-7 mailbox name, including as discussed here in preparation to use imexpire.


See also: