Domain created E-mails works fine, new e-mail accounts are not working.

Errov

New member
Joined
Jul 27, 2011
Messages
8
I am new to DirectAdmin, bought an VPS server with preinstalles DirectAdmin. Got almost everything to work now, except email login from POP3 and Webmail IMAP. So please bare with my lack in knowledge....

The auto created email that gets the account name @ domain is working fine, its possible to log in both Webmail IMAP and POP3. Same goes for mailforward, also working well.

New created e-mail accounts nevertheless are not working. The error I see in the logs when a user tries logging in is:

Jul 27 12:13:59 server dovecot: pop3-login: Login: user=<[email protected]>, method=PLAIN, rip=xxx.xxx.xxx.xxx, lip=yyy.yyy.yyy.yyy, mpid=9078
Jul 27 12:13:59 server dovecot: pop3([email protected]): Error: user [email protected]: Couldn't drop privileges: User is missing UID (see mail_uid setting)
Jul 27 12:13:59 server dovecot: pop3([email protected]): Error: Internal error occurred. Refer to server log for more information.
Jul 27 12:14:02 server dovecot: auth: passwd-file([email protected],xxx.xxx.xxx.xxx): Password mismatch
Jul 27 12:14:02 server dovecot: auth: shadow([email protected],xxx.xxx.xxx.xxx): unknown user


To me it looks like something goes wrong in the creation process when making emails in the DirectAdmin panel, either password or user is not being created correct somehow.

Any idea or link to where I should start looking ?
 
More info, sorry..

Log file :

Jul 27 12:13:59 server dovecot: pop3-login: Login: user=<[email protected]>, method=PLAIN, rip=xxx.xxx.xxx.xxx, lip=yyy.yyy.yyy.yyy, mpid=9078
Jul 27 12:13:59 server dovecot: pop3([email protected]): Error: user [email protected]: Couldn't drop privileges: User is missing UID (see mail_uid setting)
Jul 27 12:13:59 server dovecot: pop3([email protected]): Error: Internal error occurred. Refer to server log for more information.
Jul 27 12:14:02 server dovecot: auth: passwd-file([email protected],xxx.xxx.xxx.xxx): Password mismatch
Jul 27 12:14:02 server dovecot: auth: shadow([email protected],xxx.xxx.xxx.xxx): unknown user

xxx.xxx.xxx.xxx = My ip
yyy.yyy.yyy.yyy = Server IP
[email protected] = the created account

Linux system = Centos 5 (VPS Express Cloud - Leaseweb holland)
 
Thanks for the bold characters...its impossible to read otherwise.
 
Sorry, reposted in new format.

Well sorry once again, new to this forum - I will try so change my post then :

Problem still the same as above.

Problem log :
Code:
Jul 27 12:13:59 server dovecot: pop3-login: Login: user=<[email protected]>, method=PLAIN, rip=xxx.xxx.xxx.xxx, lip=yyy.yyy.yyy.yyy, mpid=9078
Jul 27 12:13:59 server dovecot: pop3([email protected]): Error: user [email protected]: Couldn't drop privileges: User is missing UID (see mail_uid setting)
Jul 27 12:13:59 server dovecot: pop3([email protected]): Error: Internal error occurred. Refer to server log for more information.
Jul 27 12:14:02 server dovecot: auth: passwd-file([email protected],xxx.xxx.xxx.xxx): Password mismatch
Jul 27 12:14:02 server dovecot: auth: shadow([email protected],xxx.xxx.xxx.xxx): unknown user

My DirectAdmin conf:
Code:
SSL=0
addip=/usr/local/directadmin/scripts/addip
admin_helper=admin.site-helper.com
admindir=./data/admin
apache_public_html=0
apache_ver=2.0
apachecert=/etc/httpd/conf/ssl.crt/server.crt
apacheconf=/etc/httpd/conf/extra/directadmin-vhosts.conf
apacheips=/etc/httpd/conf/ips.conf
apachekey=/etc/httpd/conf/ssl.key/server.key
apachelogdir=/var/log/httpd/domains
apachemimetypes=/etc/mime.types
brute_force_log_scanner=1
brute_force_time_limit=240
brutecount=25
bruteforce=1
cacert=/usr/local/directadmin/conf/cacert.pem
cakey=/usr/local/directadmin/conf/cakey.pem
check_partitions=2
check_subdomain_owner=1
clear_blacklist_ip_time=0
clear_brute_log_entry_time=7
clear_brute_log_time=24
demodocsroot=./data/skins/enhanced
docsroot=./data/skins/enhanced
emailspoolvirtual=/var/spool/virtual
emailvirtual=/etc/virtual
enforce_difficult_passwords=0
ethernet_dev=eth0
exempt_local_block=0
frontpage_on=0
ftpconfig=/etc/proftpd.conf
ftppasswd=/etc/proftpd.passwd
ftpvhosts=/etc/proftpd.vhosts.conf
ip_brutecount=20
license=/usr/local/directadmin/conf/license.key
log_rotate_size=5
logdir=/var/log/directadmin
logger=/usr/local/directadmin/logger
loghostname=0
login_history=10
logs_to_keep=5
lost_password=1
max_username_length=10
maxfilesize=50485760
mysqlconf=/usr/local/directadmin/conf/mysql.conf
namedconfig=/etc/named.conf
nameddir=/var/named
ns1=ns1.xxxx.xx
ns2=ns2.xxxx.xx
numservers=5
owsadm=/usr/local/frontpage/version5.0/bin/owsadm.exe
partition_usage_threshold=95
port=2222
purge_spam_days=0
quota_partition=/
removeip=/usr/local/directadmin/scripts/removeip
reseller_helper=reseller.site-helper.com
secure_access_group=access
servername=server.cisab.eu
serverpath=/usr/local/directadmin
session_minutes=60
skinsdir=./data/skins
sshdconfig=/etc/ssh/sshd_config
ssl_cipher=SSLv3
taskqueue=/usr/local/directadmin/data/task.queue
templates=/usr/local/directadmin/data/templates
ticketsdir=/usr/local/directadmin/data/tickets
timeout=60
tmpdir=../../../home/tmp
unified_ftp_password_file=1
user_brutecount=20
user_helper=www.site-helper.com
userdata=./data/users
dovecot=1


My Dovecot donf :

Code:
## Dovecot 1.1 configuration file
 
protocols = imap imaps pop3 pop3s
 
#ssl_cert_file = /etc/exim.cert
#ssl_key_file =  /etc/exim.key
ssl_cert_file = /etc/httpd/conf/ssl.crt/server.crt
ssl_key_file = /etc/httpd/conf/ssl.key/server.key
 
 
disable_plaintext_auth = no
 
##
## Login processes
##
 
#login_chroot = yes
 
login_user = dovecot
login_processes_count = 16
 
login_greeting = Dovecot DA ready.
 
##
## Mail processes
##
 
verbose_proctitle = yes
 
first_valid_uid = 500
last_valid_uid = 0
 
 
mail_access_groups = mail
 
#mail_debug = no
 
#default_mail_env = maildir:~/Maildir
mail_location = maildir:~/Maildir
 
# Like mailbox_check_interval, but used for IDLE command.
#mailbox_idle_check_interval = 30
 
# Copy mail to another folders using hard links. This is much faster than
# actually copying the file. This is problematic only if something modifies
# the mail in one folder but doesn't want it modified in the others. I don't
# know any MUA which would modify mail files directly. IMAP protocol also
# requires that the mails don't change, so it would be problematic in any case.
# If you care about performance, enable it.
#maildir_copy_with_hardlinks = no
 
# umask to use for mail files and directories
umask = 0007
 
# Set max. process size in megabytes. Most of the memory goes to mmap()ing
# files, so it shouldn't harm much even if this limit is set pretty high.
#mail_process_size = 256
 
# Log prefix for mail processes. See doc/variables.txt for list of possible
# variables you can use.
#mail_log_prefix = "%Us(%u): "
 
##
## IMAP specific settings
##
 
protocol imap {
 
  # Maximum IMAP command line length in bytes. Some clients generate very long
  # command lines with huge mailboxes, so you may need to raise this if you get
  # "Too long argument" or "IMAP command line too large" errors often.
  #imap_max_line_length = 65536
 
  # Send IMAP capabilities in greeting message. This makes it unnecessary for
  # clients to request it with CAPABILITY command, so it saves one round-trip.
  # Many clients however don't understand it and ask the CAPABILITY anyway.
  #login_greeting_capability = no
 
  # Workarounds for various client bugs:
  #   delay-newmail:
  #     Send EXISTS/RECENT new mail notifications only when replying to NOOP
  #     and CHECK commands. Some clients ignore them otherwise, for example
  #     OSX Mail. Outlook Express breaks more badly though, without this it
  #     may show user "Message no longer in server" errors. Note that OE6 still
  #     breaks even with this workaround if synchronization is set to
  #     "Headers Only".
  #   outlook-idle:
  #     Outlook and Outlook Express never abort IDLE command, so if no mail
  #     arrives in half a hour, Dovecot closes the connection. This is still
  #     fine, except Outlook doesn't connect back so you don't see if new mail
  #     arrives.
  #   netscape-eoh:
  #     Netscape 4.x breaks if message headers don't end with the empty "end of
  #     headers" line. Normally all messages have this, but setting this
  #     workaround makes sure that Netscape never breaks by adding the line if
  #     it doesn't exist. This is done only for FETCH BODY[HEADER.FIELDS..]
  #     commands. Note that RFC says this shouldn't be done.
  #   tb-extra-mailbox-sep:
  #     With mbox storage a mailbox can contain either mails or submailboxes,
  #     but not both. Thunderbird separates these two by forcing server to
  #     accept '/' suffix in mailbox names in subscriptions list.
  #imap_client_workarounds = outlook-idle
}
  
##
## POP3 specific settings
##
 
protocol pop3 {
 
  # Don't try to set mails non-recent or seen with POP3 sessions. This is
  # mostly intended to reduce disk I/O. With maildir it doesn't move files
  # from new/ to cur/, with mbox it doesn't write Status-header.
  #pop3_no_flag_updates = no
 
  # Support LAST command which exists in old POP3 specs, but has been removed
  # from new ones. Some clients still wish to use this though. Enabling this
  # makes RSET command clear all \Seen flags from messages.
  #pop3_enable_last = no
  
  # POP3 UIDL format to use. You can use following variables:
  #
  #  %v - Mailbox UIDVALIDITY
  #  %u - Mail UID
  #  %m - MD5 sum of the mailbox headers in hex (mbox only)
  #  %f - filename (maildir only)
  #
  # If you want UIDL compatibility with other POP3 servers, use:
  #  UW's ipop3d         : %08Xv%08Xu
  #  Courier version 0   : %f
  #  Courier version 1   : %u
  #  Courier version 2   : %v-%u
  #  Cyrus (<= 2.1.3)    : %u
  #  Cyrus (>= 2.1.4)    : %v.%u
  #
  # Note that Outlook 2003 seems to have problems with %v.%u format which is
  # Dovecot's default, so if you're building a new server it would be a good
  # idea to change this. %08Xu%08Xv should be pretty fail-safe.
 
  #pop3_uidl_format = %v.%u
  pop3_uidl_format = %08Xu%08Xv
 
  # POP3 logout format string:
  #  %t - number of TOP commands
  #  %T - number of bytes sent to client as a result of TOP command
  #  %r - number of RETR commands
  #  %R - number of bytes sent to client as a result of RETR command
  #  %d - number of deleted messages
  #  %m - number of messages (before deletion)
  #  %s - mailbox size in bytes (before deletion)
  #pop3_logout_format = top=%t/%T, retr=%r/%R, del=%d/%m, size=%s
 
  # Support for dynamically loadable modules.
  #mail_use_modules = no
  #mail_modules = /usr/lib/dovecot/pop3
 
  # Workarounds for various client bugs:
  #   outlook-no-nuls:
  #     Outlook and Outlook Express hang if mails contain NUL characters.
  #     This setting replaces them with 0x80 character.
  #   oe-ns-eoh:
  #     Outlook Express and Netscape Mail breaks if end of headers-line is
  #     missing. This option simply sends it if it's missing.
  #pop3_client_workarounds = 
}
 
##
## Authentication processes
##
 
# Set max. process size in megabytes.
#auth_process_size = 256
 
# Authentication cache size in kilobytes.
auth_cache_size = 0
# Time to live in seconds for cached data. After this many seconds a cached
# record is forced out of cache.
#auth_cache_ttl = 3600
 
# List of allowed characters in username. If the user-given username contains
# a character not listed in here, the login automatically fails. This is just
# an extra check to make sure user can't exploit any potential quote escaping
# vulnerabilities with SQL/LDAP databases. If you want to allow all characters,
# set this value to empty.
auth_username_chars = abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890.-_@&
 
# More verbose logging. Useful for figuring out why authentication isn't
# working.
auth_verbose = yes
 
# Even more verbose logging for debugging purposes. Shows for example SQL
# queries.
#auth_debug = no
 
# Maximum number of dovecot-auth worker processes. They're used to execute
# blocking passdb and userdb queries (eg. MySQL and PAM). They're
# automatically created and destroyed as needed.
#auth_worker_max_count = 30
 
auth default {
  mechanisms = plain
 
  #FreeBSD may require this instead of 'passdb shadow'
  #passdb passwd {
  #}
 
  passdb shadow {
  }
 
  passdb passwd-file {
	args = username_format=%n /etc/virtual/%d/passwd
  }
 
  userdb passwd {
  }
 
  userdb passwd-file {
	args = username_format=%n /etc/virtual/%d/passwd
  }
 
 
  # User to use for the process. This user needs access to only user and
  # password databases, nothing else. Only shadow and pam authentication
  # requires roots, so use something else if possible. Note that passwd
  # authentication with BSDs internally accesses shadow files, which also
  # requires roots. Note that this user is NOT used to access mails.
  # That user is specified by userdb above.
  user = root
 
  # Number of authentication processes to create
  #count = 1
}

Tried this post from scsi :

Code:
cd /usr/local/directadmin/custombuild
./build update
./build clean
./build dovecot d
wget -O /etc/dovecot/dovecot.conf "http://files.directadmin.com/services/custombuild/dovecot.conf.2.0"

And this : http://help.directadmin.com/item.php?id=219

And whatever post i could find.

Restartet etc.
 
Guess its just not my day..

Reformattet the complete post with Code snips, and posted config files and what i have tried till now.

Seems like somthing whent wrong when i posted it, so now im w8ing for a forum admin to approve the post...

Cry...:(
 
Have you restarted DA after directadmin.conf edit?

Have you used todovecot after the directadmin.conf edits/da restart?

Regards
 
Does the user testmail exist in the file /etc/virtual/domain.dk/passwd and does there exist an entry in /etc/virtual/domains that contains domain.dk and an entry in /etc/virtual/domainowners that contains domain.dk and an actual UNIX userid?

Those are the three files used by dovecot to figure out how to login and find out where the email files are located. For example based on your posts, you should see something similar to the following:

Code:
# grep domain.dk /etc/virtual/domains
domain.dk
# grep domain.dk /etc/virtual/domainowners
domain.dk: testuser
# grep testmail /etc/virtual/domain.dk/passwd
testmail:18.fJ4Dvbjjuk:508:12::/home/testuser/imap/domain.dk/testmail:/bin/false
 
Complete server restart made.

do you use complete email for login username? Have you tryed restart dovecot and exim?

I have made a complete server restart. But later today i will try all the above buildings and settings once again - and then reboot.
 
Yes - tested and worked

Does the user testmail exist in the file /etc/virtual/domain.dk/passwd and does there exist an entry in /etc/virtual/domains that contains domain.dk and an entry in /etc/virtual/domainowners that contains domain.dk and an actual UNIX userid?

Those are the three files used by dovecot to figure out how to login and find out where the email files are located. For example based on your posts, you should see something similar to the following:

Code:
# grep domain.dk /etc/virtual/domains
domain.dk
# grep domain.dk /etc/virtual/domainowners
domain.dk: testuser
# grep testmail /etc/virtual/domain.dk/passwd
testmail:18.fJ4Dvbjjuk:508:12::/home/testuser/imap/domain.dk/testmail:/bin/false

The above exixsts, but should newly made email accounts be on the list domainowner.

Ex. i create a new domain with the user domainadmin - then i can see both the domain and the user domainadmin. And as i described - this one email account works fine, since it have been created along with the domain.

But the added new email on the domain test@domain does not figure in the domainowner list. Should it ?
 
The above exixsts, but should newly made email accounts be on the list domainowner.

Ex. i create a new domain with the user domainadmin - then i can see both the domain and the user domainadmin. And as i described - this one email account works fine, since it have been created along with the domain.

But the added new email on the domain test@domain does not figure in the domainowner list. Should it ?

I the example I gave, there are three things listed, since you didn't give real data, I had to give you fake data back. The first thing listed in the /etc/virtual/domains is the domain name domain.dk, the second item from the /etc/virtual/domainowners shows that domain.dk is owned by the UNIX user testuser. Finally a virtual email user testuser for the domain domain.dk is found in the /etc/virtual/domain.dk/passwd file, the UID and GID associated for that user should match the domainowner, in this case testuser. And testuser is not in the domainowners file.
 
The only thing I can think of is that your dovecot.conf is the wrong version for the the dovecot binary you are using.

Try:

Code:
/usr/sbin/dovecot --version

Make sure it says 2.0 something.

Then do:

Code:
head -1 /etc/dovecot/dovecot.conf

Make sure it says Dovecot 2.0 configuration file.


Make sure you didnt install dovecot from yum or apt-get and that you only installed it from custombuild.

Run:

Code:
/usr/local/directadmin/scripts/set_permissions.sh all

Other then that you probably will have to have someone look at your server.
 
Working now..

The issue was that the passwd file was not generated properly in
/etc/virtual/DOMAIN/passwd, though a passwd file was existing with some password in it for the current user with the problem.

Following did the trick :

Code:
1. Rebuild dovecot
2. Set dovecot=0 in /usr/local/directadmin/conf/directadmin.conf, 
3. Restarted directadmin.
4. After this i set dovecot=1 again in the directadmin.conf 
5. Restarted directadmin again to reload the config file.
6. Then the  command ./todovecot in /usr/local/directadmin/custombuild

This created the correct psswd files for all the users

Maybe the first time i dit this run, i am pretty sure i didn't set dovecot=0 before restarting directadmin.

Thanks to all the responses to my post.
 
Back
Top