Case-insensitive User Name Creation
Hello,
I am having a go at setting up an e-mail server using CentOS 6.2 running under VirtualBox. I have never done this before, only previously using Linux as a desktop OS. So I installed CentOS, using a "minimal" install with the "E-mail Server" option selected. postfix and dovecot are available. I also installed mailx for testing. I can send an e-mail to "root" and this will appear in /var/mail/root. However, after creating a user with my forum username and trying to send e-mail to that, nothing seems to happen. Examining /var/log/maillog shows that the e-mail bounced due to an unknown user "smurf7". Reading around this, it seems that postfix converts the requested user name into lowercase before looking anywhere (putting "smurf7:SMurf7" into \etc\aliases and running newaliases didn't fix it). Short of butchering the code, there is little I can do about that. Most people also infer that creating usernames with uppercase letters is bad form, yet adduser did not complain when I did it. Is there a way that I can force adduser to treat all usernames as lowercase, preventing duplicate names in different case (and allowing e-mail to work)? |
Well, you could make a wrapper:
lcadduser.sh (lowercase adduser): Code:
#!/bin/bash Code:
# lcadduser SMurf7 |
No need to use tr for this in modern versions of bash. It has built-in case conversion.
Code:
#!/bin/bash But first take a look at man adduser.conf for details on the NAME_REGEX value. According to mine, the default value is set to accept lowercase-only anyway. |
All times are GMT -5. The time now is 01:47 AM. |