diff -Naur cyrus-imapd-2.4.10.orig/imap/global.c cyrus-imapd-2.4.10/imap/global.c --- cyrus-imapd-2.4.10.orig/imap/global.c 2011-07-04 17:05:01.000000000 +0200 +++ cyrus-imapd-2.4.10/imap/global.c 2011-08-04 08:21:17.000000000 +0200 @@ -392,6 +392,14 @@ char *domain = NULL; int len = strlen(user); char buf[81]; + char tmp[MAX_MAILBOX_NAME+1]; + + if (config_getstring(IMAPOPT_APPENDDOMAIN)) { + if( !strchr(user, '@') ) { + snprintf(tmp, (MAX_MAILBOX_NAME+1), "%s@%s", user, config_getstring(IMAPOPT_APPENDDOMAIN)); + user = tmp; + } + } /* check for domain */ if (config_virtdomains && diff -Naur cyrus-imapd-2.4.10.orig/lib/imapoptions cyrus-imapd-2.4.10/lib/imapoptions --- cyrus-imapd-2.4.10.orig/lib/imapoptions 2011-07-04 17:05:01.000000000 +0200 +++ cyrus-imapd-2.4.10/lib/imapoptions 2011-08-04 08:21:17.000000000 +0200 @@ -220,6 +220,10 @@ file or mailboxes list entry? It's noisy so disabled by default, but can be very useful for tracking down what happened if things look strange */ +{ "appenddomain", NULL, STRING } +/* Append this domain name to user names without a domain portion. Do not use + with the default domain option. */ + { "auth_mech", "unix", STRINGLIST("unix", "pts", "krb", "krb5")} /* The authorization mechanism to use. */ @@ -270,7 +274,10 @@ mailbox that does not have a parent mailbox. */ { "defaultdomain", NULL, STRING } -/* The default domain for virtual domain support */ +/* The default domain for virtual domain support. If the domain part of + user@domain is the same as the value specified, it will be removed from + usernames. Use this option if you add virtual domain support and do not + want to rename exisiting mailboxes. See \fIappenddomain\fR. */ { "defaultpartition", NULL, STRING } /* The partition name used by default for new mailboxes. If not