Emails Landing in Root Folder Instead of User Folder

Operating system: CentOS Linux 5.4 –
Webmin version: 1.580 –
Virtualmin version: 3.90.gpl GPL –
Theme version: 8.2 –
Kernel and CPU: Linux 2.6.18-238.9.1.el5.028stab089.1 on i686

Hi, I’m having issues receiving emails to a user account on a vps. The emails are being received, but they are landing in the root folder, not the user folder. Email sending from the user account is working fine. If I send the user (support@mysubdomain.mydomain.com) an external email, here’s what the log shows:

Mar 28 08:33:12 mydomain dovecot: Logins with UID 0 not permitted (user root) Mar 28 08:33:12 mydomain dovecot: pop3-login: Internal login failure: user=, method=PLAIN, rip=::ffff:mylocalip, lip=::ffff:mydomainip Mar 28 08:33:21 mydomain dovecot: Logins with UID 0 not permitted (user root) Mar 28 08:33:21 mydomain dovecot: pop3-login: Internal login failure: user=, method=PLAIN, rip=::ffff:mylocalip, lip=::ffff:mydomainip Mar 28 08:34:16 mydomain dovecot: Logins with UID 0 not permitted (user root) Mar 28 08:34:16 mydomain dovecot: pop3-login: Internal login failure: user=, method=PLAIN, rip=::ffff:mylocalip, lip=::ffff:mydomainip Mar 28 08:40:06 mydomain postfix/smtpd[30131]: connect from troken.hostasaurus.com[mylocalip] Mar 28 08:40:07 mydomain postfix/smtpd[30131]: B49719D9002D: client=troken.hostasaurus.com[mylocalip] Mar 28 08:40:07 mydomain postfix/cleanup[30135]: B49719D9002D: message-id=<55B2BFD839C24A618CCD744C94F61727@comp01> Mar 28 08:40:12 mydomain postfix/smtpd[30131]: disconnect from troken.hostasaurus.com[mylocalip] Mar 28 08:40:12 mydomain postfix/qmgr[26593]: B49719D9002D: from=, size=1046, nrcpt=1 (queue active) Mar 28 08:40:27 mydomain postfix/local[30136]: B49719D9002D: to=, orig_to=, relay=local, delay=20, delays=4.9/0.05/0/15, dsn=2.0.0, status=sent (delivered to command: /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME) Mar 28 08:40:27 mydomain postfix/qmgr[26593]: B49719D9002D: removed

Doing some research on the UID issue, I’ve located where I can set UID options: Webmin > Servers > Dovecot/IMAP/POP3 Server > User and Login Options.

I’ve also located the Dovecot configuration file at: Webmin > Servers > Dovecot/IMAP/POP3 Server > Edit Config Files. Here is what I have that’s UID related:

# Valid UID range for users, defaults to 500 and above. This is mostly # to make sure that users can't log in as daemons or other system users. # Note that denying root logins is hardcoded to dovecot binary and can't # be done even if first_valid_uid is set to 0. #first_valid_uid = 500 #last_valid_uid = 0

Valid GID range for users, defaults to non-root/wheel. Users having

non-valid GID as primary group ID aren’t allowed to log in. If user

belongs to supplementary groups with non-valid GIDs, those groups are

not set.

#first_valid_gid = 1
#last_valid_gid = 0

If somebody can help me with this, I would be grateful. I do have another domain on a different vps, with UID settings the same as above. That domain is working fine. It is using earlier versions though: Webmin version: 1.550 and Virtualmin version: 3.86.gpl GPL.

Thanks!

Hmm, so what is the UID of this particular user? It’s not by chance 0, is it?

You shouldn’t need to tweak any of the UID options. but it does seem like something unusual is going on there.

-Eric

Thanks Eric. Well I don’t know what the user’s UID is. But I did get around the UID issue by changing the range: Min UID = 0; Max UID = 9999. So that cleared the error line from the log. But that didn’t fix the issue of the user’s emails landing in root folder. I got around that issue by going into: Webmin > Servers > Postfix Mail Server > Mail Aliases. Then changed the alias for ‘root’ to the user’s email address: ‘support@mysubdomain.mydomain.com’. I didn’t need to do that with my other vps. But it does allow the user to inbox. The problem can be seen in this line from what I posted above:

Mar 28 08:40:27 mydomain postfix/local[30136]: B49719D9002D: to=, orig_to=, relay=local, delay=20, delays=4.9/0.05/0/15, dsn=2.0.0, status=sent (delivered to command: /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME)

Looking at the log for my other vps, the above line should look like this:

Mar 28 08:40:27 mydomain postfix/local[30136]: B49719D9002D: to=, orig_to=< support@mysubdomain.mydomain.com >, relay=local, delay=20, delays=4.9/0.05/0/15, dsn=2.0.0, status=sent (delivered to command: /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME)

I tried setting up a second user account, which is: ‘tester@mysubdomain.mydomain.com’. This account can’t receive email at all. When sending an external email to tester, I get:

Apr 2 22:53:44 mydomain postfix/smtpd[9781]: connect from troken.hostasaurus.com[someIP] Apr 2 22:53:44 mydomain postfix/smtpd[9781]: NOQUEUE: reject: RCPT from troken.hostasaurus.com[someIP]: 550 5.1.1 : Recipient address rejected: User unknown in local recipient table; from= to= proto=SMTP helo= Apr 2 22:53:44 alphatect postfix/smtpd[9781]: disconnect from troken.hostasaurus.com[someIP]

I think the reason that ‘support@mysubdomain.mydomain.com’ was able to receive email (though in root folder) and ‘tester@mysubdomain.mydomain.com’ could not, is that ‘support@mydomain.com’ is a default username already present in Virtualmin. So this looks like, for some reason, the subdomain is being cutoff. Instead of going to ‘tester@mysubdomain.mydomain.com’, emails goto ‘tester@mydomain.com’. This didn’t work because there is no ‘tester@mydomain.com’. Likewise, instead of going to ‘support@mysubdomain.mydomain.com’, emails goto ‘support@mydomain.com’. They were at least being deposited into the root folder because ‘support@mydomain.com’ already existed by default.

Also note that both ‘support@mysubdomain.mydomain.com’ and ‘tester@mysubdomain.mydomain.com’ can send emails both externally and to themselves.

Boy that was an mouthful. Thanks for listening!

Hmm, what is your server’s hostname? And is that hostname also the name of a Virtual Server that’s setup on your system now?

-Eric