This is about the two settings "Include domain name in usernames" and "Domain name style in username" from "System Settings / Virtualmin Configuration / Default for new domains".
Changes made to the former of those settings are immediately applied, also to existing domains. The latter though seems to be applied only to really new domains. As in, when I change it, and create a new email user in an existing domain, the change is not applied.
For one, this appears to be a somewhat confusing inconsistency in terms of when those settings are applied, and then, I'm just now trying to figure out how I can change the latter of those settings for existing domains, in case I change my mind and would like new email users for an existing domain be named "user.domainpart" instead of "user%domainpart".
Comments
Submitted by JamieCameron on Wed, 10/20/2010 - 19:03 Comment #1
Actually, both of those should apply to all new or existing domains immediately. However, once a user has been created he will remain in the selected format unless renamed ..
Submitted by Locutus on Wed, 10/20/2010 - 19:14 Comment #2
Yes, I agree about the existing user... But when I tested it, I created a new email user in an existing domain, and the naming scheme as it was before I edited it was applied... As if it was somehow fixed for the existing domain. Is that possible? Or should I test it again, maybe I missed something.
Submitted by JamieCameron on Wed, 10/20/2010 - 19:17 Comment #3
Try it again .. that shouldn't happen.
Also, what was the exact incorrect username (and what did you expect it to be) ?
Submitted by Locutus on Wed, 10/20/2010 - 19:26 Comment #4
I tried it again:
I set Domain name style in username to Username or first part of domain. Created a new domain "test5.tianet.de". Under that, an email user "test1". That user correctly became "test1%test5".
Then I changed Domain name style to Full domain name and created an email user "test2".
I would have expected that user to become "test2%test5.tianet.de", but it still became "test2%test5".
When I now, with the Domain name style change done, create a new domain, and an email user under that, it gets named correctly.
Submitted by JamieCameron on Wed, 10/20/2010 - 19:54 Comment #5
Ok, I forgot that the "domain name style" does get saved for existing domains, indirectly.
You can change this on the "Edit Virtual Server" page with the "Mailbox name prefix" field. However, it is only editable if the domain doesn't have any users yet .. otherwise, it is fixed.
Submitted by Locutus on Wed, 10/20/2010 - 20:00 Comment #6
Okidoki, I see it now. Thanks for clarifying!
Anyway, this behavior seems a little bit strange to me. What if I decide I'd like to change the auto-naming scheme for future email users... Then I can't change the suffix (it's reading "suffix" here for me, not "prefix") field anymore, unless I delete all existing users? I somehow find this a bit of a "harsh commitment" I have to make before setting up the first email user. :)
Submitted by JamieCameron on Wed, 10/20/2010 - 20:16 Comment #7
The reason is that the suffix or prefix is used to work out which users belong to the domain, so if it was changed while users exist that connection would be lost.
Submitted by Locutus on Thu, 10/21/2010 - 04:38 Comment #8
Okay, that's a good point.
Maybe, for a future improvement, it'd be nice to use a "mapping list" to tell which user belongs to which domain, instead of a naming scheme with unchangeable pre/suffix.
Submitted by JamieCameron on Thu, 10/21/2010 - 13:24 Comment #9
That would be an option .. but in general I want virtualmin to be able to determine the connection automatically, rather than using a separate database that would break if users were manually added or modified.
Submitted by Locutus on Thu, 10/21/2010 - 16:49 Comment #10
Sorry if there maybe was a misunderstanding: I would not want to be able to add/modify users manually, but just be able to modify the pre/suffix some time after users have been created.
So my suggestion would just be to use a "mapping list" between users and domains instead of a fixed naming scheme. Under VMin's control of course. That way the *fix could be changed, and existing users still attributed to their domain.
Submitted by JamieCameron on Thu, 10/21/2010 - 17:14 Comment #11
Yes, I see what you mean ... I would just prefer VIrtualmin to not need to maintain a separate mapping database.
I will look into adding support for changing the prefix/suffix somehow, and updating all existing users at the same time. This should be a sub-problem of renaming a domain, which is already possible.
Submitted by Locutus on Thu, 10/21/2010 - 17:21 Comment #12
I agree with trying to avoid another database, while keeping the option to change the *fix later would, to me personally, be rather important. :) But yeah, I'd say renaming existing users would be quite a viable option too to accomplish this.
I'm pondering all this because I'm making plans to migrate a web site that's currently hosted on a Windows system, with about 50 email users, which have a certain naming scheme for login (user@fulldomain.de). I know that having an @ in the username is problematic for Postfix, so I'm pondering to change that and inform the users that on day X their login name will change. And for this purpose I'd like to be somewhat open concerning naming scheme... As in, I decide to go with one, create like 30 users, and then notice "hmm, no, the other scheme might have been better". Having to delete and re-create those 30 again might be awkward. :)
Okay, there are the "batch creation" functions. Those will probably help at this point too.
Submitted by JamieCameron on Thu, 10/21/2010 - 18:17 Comment #13
Actually, virtualmin supports user@domain formats just fine, even with Postfix.
Submitted by Locutus on Thu, 10/21/2010 - 19:03 Comment #14
Yep I know it does... It just needs to create an additional system user or something, if I remember correctly, right? The documentation popup said something about that using that format is not recommended with Postfix.
Here, I looked up the corresponding line in the docu: "The username@domain option is not recommended unless you are migrating users from another system that already uses it. The Postfix mail server has problems with SMTP authentication by users with an @ in the username, and requires that an extra Unix user be created for each mailbox for mail delivery to work."
Anyway, thanks for all the effort you put into this issue here! I really don't want to keep you from working on serious issues! :)
Submitted by JamieCameron on Thu, 10/21/2010 - 19:15 Comment #15
Yes, to support this format Virtualmin has to create an extra Unix user without an @ in the name, to work around Postfix issues. However, this works fine, and is used by a lot of customers who want to avoid having to explain to users why their email address and username differ.
Submitted by Locutus on Thu, 10/21/2010 - 19:22 Comment #16
Okay, thanks again! I understand and ponder keeping the format then.
Two little follow-up things I just noticed:
1) Edit virtual server / Configurable settings always says "Mailbox name suffix" in the first line, even if it is configured to be a prefix, like "domain.user". Just a cosmetic thing of course.
2) Unlike the suffix text itself, I can change the "Format for usernames that include domain" in the templates, Mail for domain. Just wondering if that might constitute a problem, when I change that after users have been created? Will VMin still "remember" which users were created when the domain was a prefix, and for which it was a suffix, and what separator character was used?
Submitted by JamieCameron on Fri, 10/22/2010 - 01:12 Comment #17
Oh, you are right .. I got suffix and prefix mixed up. Will fix in the next release. Thanks for pointing this out!
It is fine to change this - virtualmin can still correctly associate users with the domain.
Submitted by Locutus on Fri, 10/22/2010 - 04:56 Comment #18
Great!
Again a few thumbs up for Virtualmin! I've been playing with some more options yesterday and am more and more thrilled about the sheer amount of features here.
Submitted by JamieCameron on Tue, 10/26/2010 - 01:02 Comment #19
Virtualmin 3.82 will allow the prefix / suffix to be changed independently on the "Change Domain Name" page.
Submitted by Locutus on Tue, 10/26/2010 - 03:09 Comment #20
Repeat post #18. ;)
Submitted by Issues on Tue, 11/09/2010 - 03:23 Comment #21
Automatically closed -- issue fixed for 2 weeks with no activity.