You are not logged in.

#1 2008-12-31 17:30:48

nuclearsandwich
Member
Registered: 2008-10-12
Posts: 16

Dovecot configuration woes

I've been trying to set up a small office server using the SOHO Postfix guide in the arch wiki here: http://wiki.archlinux.org/index.php/SOHO_Postfix
I've managed to massage most of the kinks out of it but one issue still baffles me. When I attempt to login to dovecot via telnet I get an "OK logged in" message immediately followed by connection closed by foreign host.
/var/log/mail.log:

Dec 31 09:21:40 ArchLAMP dovecot: auth(default): new auth connection: pid=3387
Dec 31 09:21:49 ArchLAMP dovecot: auth(default): client in: AUTH    1    PLAIN    service=imap    secured    lip=127.0.0.1    rip=127.0.0.1    lport=143    rport=59758    resp=AHRlc3QxQHBlcmZlY3RwaG9uZXMuY29tAHRlc3Rlcg==
Dec 31 09:21:49 ArchLAMP dovecot: auth(default): client out: OK    1    user=test1@domain.com
Dec 31 09:21:49 ArchLAMP dovecot: auth-worker(default): mysql: Connected to localhost (postfix)
Dec 31 09:21:49 ArchLAMP dovecot: auth-worker(default): sql(test1@domain.com,127.0.0.1): query: SELECT password FROM mailbox WHERE username = 'test1@domain.com' AND active = '1'
Dec 31 09:21:49 ArchLAMP dovecot: auth(default): master in: REQUEST    2    3249    1
Dec 31 09:21:49 ArchLAMP dovecot: auth(default): master out: USER    2    test1@domain.com    mail=test1@domain.com/    uid=5000    gid=5000home=/srv/vmail
Dec 31 09:21:49 ArchLAMP dovecot: auth-worker(default): sql(test1@domain.com,127.0.0.1): SELECT maildir AS mail, 5000 AS uid, 5000 AS gid, "/srv/vmail" AS home FROM mailbox WHERE username = 'test1@domain.com' AND active = '1'
Dec 31 09:21:49 ArchLAMP dovecot: IMAP(test1@domain.com): Namespace 'INBOX.': Ambiguous mail location setting, don't know what to do with it: test1@domain.com/ (try prefixing it with mbox: or maildir:)
Dec 31 09:21:49 ArchLAMP dovecot: Fatal: IMAP(test1@domain.com): Namespace initialization failed
Dec 31 09:21:49 ArchLAMP dovecot: imap-login: Login: user=<test1@domain.com>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, secured

Here's my /etc/dovecot.conf

protocols = imap imaps
auth_verbose = yes
auth_debug = yes
auth_debug_passwords = yes
ssl_disable = yes
ssl_cert_file = /etc/ssl/certs/server.crt
ssl_key_file = /etc/ssl/private/server.key
first_valid_uid = 5000
first_valid_gid = 5000
listen = *
disable_plaintext_auth = no
auth_username_chars = abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890.-_@
namespace private {
    separator = .
    prefix = INBOX.
    inbox = yes
    hidden = yes
}
protocol imap {
    imap_client_workarounds = delay-newmail outlook-idle tb-extra-mailbox-sep
}
protocol lda {
    postmaster_address = postmaster@domain.com
    hostname = ArchServer
    sendmail_path = /usr/sbin/sendmail
}
auth default {
    passdb sql {
        args = /etc/dovecot/dovecot-sql.conf
    }
    userdb sql {
        args = /etc/dovecot/dovecot-sql.conf
    }
}

and /etc/dovecot/dovecot-sql.conf

driver = mysql
connect = host=localhost dbname=postfix user=postfix password=password
default_pass_scheme = CRYPT

password_query = SELECT password FROM mailbox WHERE username = '%u' AND active = '1'
user_query = SELECT maildir AS mail, 5000 AS uid, 5000 AS gid, "/srv/vmail" AS home FROM mailbox WHERE username = '%u' AND active = '1'

I haven't the foggiest idea how to procede. Thanks in advance for help.

Last edited by nuclearsandwich (2008-12-31 17:32:33)

Offline

#2 2008-12-31 19:55:41

panecillo
Member
From: Spain
Registered: 2007-07-21
Posts: 44

Re: Dovecot configuration woes

Hi,

it seems that setting a "mail_location" would fix this.

In my dovecot.conf I don't have any namespaces, so I have a global defined mail_location:

mail_location = maildir:/var/mailboxes/%u/

Note that my mailboxes directory is /var/mailboxes, yours may vary. If you followed the guide from the wiki, your mailboxes directory should be /home/vmail (check main.cf from Postfix).

You could also set this location inside your namespace block (by using 'location = ...) :-)

Offline

#3 2009-01-03 05:24:06

nuclearsandwich
Member
Registered: 2008-10-12
Posts: 16

Re: Dovecot configuration woes

You sir, are a hero.
That got IMAP working properly. Thanks very much.

Last edited by nuclearsandwich (2009-01-03 05:25:04)

Offline

#4 2013-02-09 15:42:38

lfxgroove
Member
Registered: 2012-05-10
Posts: 13

Re: Dovecot configuration woes

I too want to extend my sincerest thanks!

Very nice of you to add this small piece, will update the wiki with this information.

Thanks again!

Offline

Board footer

Powered by FluxBB