Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have installed Postfix and Dovecot on my VPS running CentOS 6 x86. I am trying to make them work with the virtual domains set up using Virtualmin, but the user cannot login.

When testing imap with telnet, I get:

a1 LOGIN user@virtualdomain.tld password    
a1 NO [AUTHENTICATIONFAILED] Authentication failed.

The user exists in /etc/passwd. I'm sure I'm missing some little stupid setting, but I've been struggling for more than 5 days without luck.

Here's some settings that I have come to so far, please tell me if you need more.

postconf -n

alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
debug_peer_level = 2
html_directory = no
inet_interfaces = all
inet_protocols = all
local_recipient_maps =
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
mydestination = $myhostname, localhost.$mydomain, $mydomain, localhost
mydomain = [main.vps.domain.tld]
myhostname = [main.vps.domain.tld]
myorigin = $mydomain
newaliases_path = /usr/bin/newaliases.postfix
readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES
sample_directory = /usr/share/doc/postfix-2.6.6/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
unknown_local_recipient_reject_code = 550
virtual_alias_maps = hash:/etc/postfix/virtual

/etc/postfix/master.cf

smtp      inet  n       -       n       -       -       smtpd
submission      inet    n       -       n       -       -       smtpd -o-smtpd_tls_security_level=e$
smtps   inet    n       -       n       -       -       smtpd -o smtpd_tls_wrappermode=yes -o smtpd$
[other default settings]
smtp      unix  -       -       n       -       -       smtp
[other default settings]

doveconf -n

disable_plaintext_auth = no
listen = *
login_greeting = Mail ready.
mail_location = maildir:~/Maildir
managesieve_notify_capability = mailto
managesieve_sieve_capability = fileinto reject envelope encoded-character vacation subaddress comparator-i;ascii-numeric relational regex imap4flags copy include variables body enotify environment mailbox date
mbox_write_locks = fcntl
passdb {
  driver = passwd
}
passdb {
  driver = passwd
}
plugin {
  sieve = ~/.dovecot.sieve
  sieve_dir = ~/sieve
}
service pop3-login {
  inet_listener pop3 {
    port = 110
  }
  inet_listener pop3s {
    address = *
    port = 995
    ssl = yes
  }
}
ssl_cert = </etc/pki/dovecot/certs/dovecot.pem
ssl_key = </etc/pki/dovecot/private/dovecot.pem
userdb {
  driver = passwd
}
protocol pop3 {
  pop3_uidl_format = %08Xv%08Xu
}

/etc/dovecot/conf.d/10-auth.conf (all other comments removed for shortness)

disable_plaintext_auth = no
auth_username_chars = abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890.-_@
#!include auth-deny.conf.ext
#!include auth-master.conf.ext

!include auth-system.conf.ext
#!include auth-sql.conf.ext
#!include auth-ldap.conf.ext
#!include auth-passwdfile.conf.ext
#!include auth-checkpassword.conf.ext
#!include auth-vpopmail.conf.ext
#!include auth-static.conf.ext

/etc/dovecot/conf.d/10-mail.conf (all comments removed)

mail_location = maildir:~/Maildir
mbox_write_locks = fcntl

/etc/dovecot/conf.d/10-master.conf (all comments removed)

service imap-login {
  inet_listener imap {
    port = 143
  }
  inet_listener imaps {
    port = 993
    ssl = yes
  }
service pop3-login {
  inet_listener pop3 {
    port = 110
  }
  inet_listener pop3s {
    port = 995
    ssl = yes
  }
}

service lmtp {
  unix_listener lmtp {
    #mode = 0666
  }
}
service auth {
  unix_listener auth-userdb {
    #mode = 0600
    user = postfix
    group = postfix
  }
}
service auth-worker {
}
service dict {
   unix_listener dict {
  }
}

/etc/dovecot/conf.d/auth-system.conf.ext (all comments removed)

passdb {
  driver = passwd
}
userdb {
  driver = passwd
}
share|improve this question
    
What is in your virtual_alias_maps? –  NickW Jun 19 '13 at 15:52
    
virtual_alias_maps points to /etc/postfix/virtual, and in that file there are a few settings in the form: user@virtualdomain.tld user-virtualdomain.tld –  Marius Stuparu Jun 19 '13 at 19:36
    
And where are those user-virtualdom.tld users configured? If they are virtual users, you may need to add maildir location, among other things.. –  NickW Jun 20 '13 at 8:27
    
The users are added via Virtualmin, and they appear in the /etc/passwd and Dovecot has the setting mail_location = maildir:~/Maildir. The major problem is not that the user doesn't receive mail (did't get there yet), but he can't even authenticate in imap. –  Marius Stuparu Jun 20 '13 at 9:42
    
Well, you need to map the users in the virtual_alias_maps file to the local users. So joe@yourdomain.tld joe where joe is the unix system account. –  NickW Jun 20 '13 at 9:44

1 Answer 1

After two weeks of headache, I've given it up with Postfix and Dovecot, and installed a complete and easier to manage solution: Axigen.

It works like a charm.

Thanks for anyone who searched for a solution.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.