Dovecot connection imap/pop3 issue

dovecot

I've just installed postfix/dovecot on linux (last Debian), I've setup for starttls. I try to connect via imap or pop3 with thunderbird but I can't get the mails… No error message on thunderbird, all seems to be ok, on the server side I can't find logs giving me some usefull information… How can I proceed to know what's wrong please?

Some logs:

mail.info:

Feb 14 10:23:21 ns403668 postfix/smtpd[7324]: connect from AStrasbourg-151-1-41-254.w83-194.abo.wanadoo.fr[83.194.225.254]
Feb 14 10:23:21 ns403668 postfix/smtpd[7328]: connect from AStrasbourg-151-1-41-254.w83-194.abo.wanadoo.fr[83.194.225.254]
Feb 14 10:23:21 ns403668 postfix/smtpd[7324]: lost connection after CONNECT from AStrasbourg-151-1-41-254.w83-194.abo.wanadoo.fr[83.194.225.254]
Feb 14 10:23:21 ns403668 postfix/smtpd[7324]: disconnect from AStrasbourg-151-1-41-254.w83-194.abo.wanadoo.fr[83.194.225.254]
Feb 14 10:23:21 ns403668 postfix/smtpd[7328]: lost connection after CONNECT from AStrasbourg-151-1-41-254.w83-194.abo.wanadoo.fr[83.194.225.254]
Feb 14 10:23:21 ns403668 postfix/smtpd[7328]: disconnect from AStrasbourg-151-1-41-254.w83-194.abo.wanadoo.fr[83.194.225.254]

dovecot.log:

2014-02-14 10:35:18 lda(root): Error: user root: Initialization failed: Initializing mail storage from mail_location setting failed: stat(/root/Maildir) failed: Permission denied (euid=65534(nobody) egid=65534(nogroup) missing +x perm: /root, dir owned by 0:0 mode=0700)
2014-02-14 10:35:18 lda(root): Fatal: Invalid user settings. Refer to server log for more information.
2014-02-14 10:35:18 lda(root): Error: chdir(/root/) failed: Permission denied (euid=65534(nobody) egid=65534(nogroup) missing +x perm: /root, dir owned by 0:0 mode=0700)
2014-02-14 10:35:18 lda(root): Error: chdir(/root) failed: Permission denied
2014-02-14 10:35:18 lda(root): Error: user root: Initialization failed: Initializing mail storage from mail_location setting failed: stat(/root/Maildir) failed: Permission denied (euid=65534(nobody) egid=65534(nogroup) missing +x perm: /root, dir owned by 0:0 mode=0700)
2014-02-14 10:35:18 lda(root): Fatal: Invalid user settings. Refer to server log for more information.
2014-02-14 10:35:18 lda(root): Error: chdir(/root/) failed: Permission denied (euid=65534(nobody) egid=65534(nogroup) missing +x perm: /root, dir owned by 0:0 mode=0700)
2014-02-14 10:35:18 lda(root): Error: chdir(/root) failed: Permission denied
2014-02-14 10:35:18 lda(root): Error: user root: Initialization failed: Initializing mail storage from mail_location setting failed: stat(/root/Maildir) failed: Permission denied (euid=65534(nobody) egid=65534(nogroup) missing +x perm: /root, dir owned by 0:0 mode=0700)
2014-02-14 10:35:18 lda(root): Fatal: Invalid user settings. Refer to server log for more information.
2014-02-14 10:35:18 lda(root): Error: chdir(/root/) failed: Permission denied (euid=65534(nobody) egid=65534(nogroup) missing +x perm: /root, dir owned by 0:0 mode=0700)
2014-02-14 10:35:18 lda(root): Error: chdir(/root) failed: Permission denied
2014-02-14 10:35:18 lda(root): Error: user root: Initialization failed: Initializing mail storage from mail_location setting failed: stat(/root/Maildir) failed: Permission denied (euid=65534(nobody) egid=65534(nogroup) missing +x perm: /root, dir owned by 0:0 mode=0700)
2014-02-14 10:35:18 lda(root): Fatal: Invalid user settings. Refer to server log for more information.
2014-02-14 10:35:18 lda(root): Error: chdir(/root/) failed: Permission denied (euid=65534(nobody) egid=65534(nogroup) missing +x perm: /root, dir owned by 0:0 mode=0700)
2014-02-14 10:35:18 lda(root): Error: chdir(/root) failed: Permission denied
2014-02-14 10:35:18 lda(root): Error: user root: Initialization failed: Initializing mail storage from mail_location setting failed: stat(/root/Maildir) failed: Permission denied (euid=65534(nobody) egid=65534(nogroup) missing +x perm: /root, dir owned by 0:0 mode=0700)
2014-02-14 10:35:18 lda(root): Fatal: Invalid user settings. Refer to server log for more information.

Dovecot-info.log:

2014-02-14 07:53:39 pop3-login: Info: Disconnected (no auth attempts in 59 secs): user=<>, rip=186.215.187.166, lip=135.189.135.219, session=<orsNRFjyKAC617um>
2014-02-14 07:53:40 pop3-login: Info: Aborted login (auth failed, 1 attempts in 19 secs): user=<admin>, method=PLAIN, rip=186.215.187.166, lip=135.189.135.219, session=<Fvj+QljyjwC617um>
2014-02-14 07:53:44 pop3-login: Info: Aborted login (auth failed, 1 attempts in 19 secs): user=<admin>, method=PLAIN, rip=186.215.187.166, lip=135.189.135.219, session=<xJo3Q1jyMQC617um>
2014-02-14 07:53:48 pop3-login: Info: Aborted login (auth failed, 1 attempts in 19 secs): user=<admin>, method=PLAIN, rip=186.215.187.166, lip=135.189.135.219, session=<Q7ZvQ1jyxgC617um>
2014-02-14 07:53:51 pop3-login: Info: Aborted login (auth failed, 1 attempts in 19 secs): user=<admin>, method=PLAIN, rip=186.215.187.166, lip=135.189.135.219, session=<jxuoQ1jy7gC617um>
2014-02-14 07:53:55 pop3-login: Info: Aborted login (auth failed, 1 attempts in 19 secs): user=<admin>, method=PLAIN, rip=186.215.187.166, lip=135.189.135.219, session=<FhTgQ1jyNAC617um>
2014-02-14 10:20:47 lda(service.conception-site-web): Info: msgid=<20140214092047.04181E18A3@ns403668.ip-37-187-135.eu>: saved mail to INBOX
2014-02-14 10:23:21 pop3-login: Info: Aborted login (no auth attempts in 0 secs): user=<>, rip=83.194.225.254, lip=135.189.135.219, session=<Nc1lW1ryzQBTwuH+>
2014-02-14 10:23:21 imap-login: Info: Aborted login (no auth attempts in 0 secs): user=<>, rip=83.194.225.254, lip=135.189.135.219, session=<NdNlW1ryyQBTwuH+>
2014-02-14 10:23:21 pop3-login: Info: Aborted login (no auth attempts in 0 secs): user=<>, rip=83.194.225.254, lip=135.189.135.219, session=<sN5lW1ry0gBTwuH+>
2014-02-14 10:23:21 imap-login: Info: Aborted login (no auth attempts in 0 secs): user=<>, rip=83.194.225.254, lip=135.189.135.219, session=<iBtmW1ry0ABTwuH+>

And my dovecot.conf:

# 2.1.7: /etc/dovecot/dovecot.conf
# OS: Linux 3.10.9-xxxx-grs-ipv6-64 x86_64
auth_mechanisms = plain login
base_dir = /var/run/dovecot/
disable_plaintext_auth = no
info_log_path = /var/log/dovecot/dovecot-info.log
log_path = /var/log/dovecot/dovecot.log
log_timestamp = "%Y-%m-%d %H:%M:%S "
mail_location = maildir:~/Maildir
passdb {
  args = failure_show_msg=yes
  driver = pam
}
plugin {
  sieve = ~/.dovecot.sieve
  sieve_dir = ~/.Sieve
}
protocols = imap pop3
service auth {
  unix_listener /var/spool/postfix/private/auth {
    group = postfix
    mode = 0666
    user = postfix
  }
  unix_listener auth-master {
    mode = 0666
  }
}
service imap-login {
  executable = /usr/lib/dovecot/imap-login
  inet_listener imap {
    address = 135.189.135.219
    port = 143
  }
  inet_listener imaps {
    address = 135.189.135.219
    port = 993
  }
}
service imap {
  executable = /usr/lib/dovecot/imap
}
service pop3-login {
  executable = /usr/lib/dovecot/pop3-login
  inet_listener pop3 {
    address = *
    port = 110
  }
  inet_listener pop3s {
    address = *
    port = 995
  }
}
service pop3 {
  executable = /usr/lib/dovecot/pop3
}
ssl_ca = </etc/dovecot/ssl_keys/ca.crt
ssl_cert = </etc/dovecot/ssl_keys/imap.crt
ssl_cipher_list = ALL:!LOW:!SSLv2
ssl_key = </etc/dovecot/ssl_keys/imap.key
userdb {
  driver = passwd
}
verbose_ssl = yes
protocol imap {
  imap_logout_format = bytes ( in=%i : out=%o )
  mail_plugin_dir = /usr/lib/dovecot/imap
}
protocol pop3 {
  mail_plugin_dir = /usr/lib/dovecot/pop3
  pop3_enable_last = no
  pop3_logout_format = top=%t/%p, retr=%r/%b, del=%d/%m, size=%s
}

Best Answer

Your problem is this:

mail_location = maildir:~/Maildir

Dovecot in your case runs as nobody:nogroup and this user cannot change to the /root (which is how should be anyway).

2014-02-14 10:35:18 lda(root): Error: chdir(/root/) failed: Permission denied (euid=65534(nobody) egid=65534(nogroup) missing +x perm: /root, dir owned by 0:0 mode=0700)

You should never have email delivered straight to user "root", use aliases instead and direct it to your user account on the machine. Check documentation of how to do this.

This whole approach is a little oldschool to be honest, unless you intend to use this server for testing purposes or just for fun.

Related Topic