Importance of servername canonicalization - can/should this be improved?

Nic Bernstein nic at onlight.com
Thu May 10 10:56:41 EDT 2012


Folks,
Proceeding with my (sometimes steep) learning curve on Cyrus Murder (and 
preparing a Wiki guide to same) I have recently experienced a case of 
missing mailboxes.

Let me explain...  I started out by splitting a long-running non-murder 
2.4.10 host into a single frontend and backend, with a separate mupdate 
master.  I then added a second frontend -- no problem.  I then added a 
second backend (several problems, but a lot of learning!) and ultimately 
moved an account onto it.

The next day, I tweaked some settings in the config files and restarted 
the Cyrus server.  Went to look at my mailboxes and they're gone!  Uh-oh!!

Long story short, the original backend is configured with 'servername: 
mailbox.example.com' and the new backend is 'servername: 
mailbox.wi.example.com'.  I had moved the account with this command (in 
cyradm):
     mail.example.com> xfermailbox user.onlight mailbox.wi

Problem is that ctl_mboxlist.c:do_dump() compares the mailboxes.db entry 
for the mailbox with config_servername, and deletes any mailboxes on the 
local host which don't match.  The mailboxes.db entry contains whatever 
string the user types in to cyradm's XFER command, regardless of what 
the target server thinks its name is.

Now I can understand this, to some extent, but seeing as in several 
other places Cyrus cavalierly discards portions of hostnames (i.e. all 
the host_* settings in imapd.conf) it seems odd that here it behaves 
like this.  The user might enter quite a few different names into cyradm 
and successfully transfer the mailbox, only to have it disappear upon 
reboot/restart.  They may use a short name (as I did) or an IP address, 
or any other host name which resolves to the destination server, and the 
command will succeed.

It seems to me that since servername is so important, this behavior 
should at least be mentioned in the imapd.conf(5) manpage.  But really, 
I would expect that once the source server is connected to the target 
server via IMAP protocol, if the target lists a servername in its 
greeting or capability string (as it will unless 'serverinfo: off' is 
set) then THAT name is what should be entered into the mailboxes.db 
file, and not whatever shorthand the user may have used.

Is this doable?

Cheers,
     -nic

-- 
Nic Bernstein                             nic at onlight.com
Onlight, Inc.                             www.onlight.com
219 N. Milwaukee St., Suite 2a            v. 414.272.4477
Milwaukee, Wisconsin  53202



More information about the Info-cyrus mailing list