You are not logged in.

#1 2012-06-22 21:51:05

KingX
Member
From: CA
Registered: 2010-03-24
Posts: 324

[SOLVED] Unable to access recieved emails using postfix/dovecot

Hello, smile

I setup a mailserver following this wiki. Everything is working fine as far as I can tell, Postfix is able to send emails and they reach their destination fine, emails are correctly being recieved and deposited into the 'new' directory under /home/vmail/domain/user@domain/new. But I am unable to access the received emails through webmail, using roundcube, or through Thunderbird.

One thing I thought might be an issue, in my dovecot.conf mail_home was set as /home/vmail/%u and a new directory was created, /home/vmail/user@domain, that contained a bunch of dovecot files like dovecot.index.log etc., but the recieved emails were in /home/vmail/domain/user@domain. So I changed the mail_home to /home/vmail/%d/%u and restarted both postfix and dovecot but no dice. It still doesn't pick up the emails sitting in the 'new' directory.

/etc/dovecot/dovecot.conf - I am merely posting the added stuff to the conf file rest of it is same as default.

# Protocols we want to be serving.
protocols = imap

dict {
  #quota = mysql:/etc/dovecot/dovecot-dict-sql.conf.ext
  #expire = sqlite:/etc/dovecot/dovecot-dict-sql.conf.ext
}

#!include conf.d/*.conf

!include_try local.conf

auth_mechanisms = plain
passdb {
    driver = sql
    args = /etc/dovecot/dovecot-sql.conf
}
userdb sql {
    driver = sql
    args = /etc/dovecot/dovecot-sql.conf
}

service auth {
    unix_listener auth-client {
        group = postfix
        mode = 0660
        user = postfix
    }
    user = root
}

mail_home = /home/vmail/%d/%u
mail_location = maildir:~

ssl_cert = </etc/ssl/private/mailserver.crt
ssl_key = </etc/ssl/private/mailserver.key

Last edited by KingX (2012-06-22 21:58:22)

Offline

#2 2012-06-22 21:57:00

KingX
Member
From: CA
Registered: 2010-03-24
Posts: 324

Re: [SOLVED] Unable to access recieved emails using postfix/dovecot

Ok, 30 seconds after making the post I realized I probably also need to make a change to dovecot-sql.conf file. And voila!! I see the new emails that were sitting in the 'new' directory. smile

So I changed the original dovecot-sql.conf file

driver = mysql
connect = host=localhost dbname=postfix_db user=postfix_user password=hunter2
# The new name for MD5 is MD5-CRYPT so you might need to change this depending on version
default_pass_scheme = MD5-CRYPT
# Get the mailbox
user_query = SELECT '/home/vmail/%u' as home, 'maildir:/home/vmail/%u' as mail, 5000 AS uid, 5000 AS gid, concat('dirsize:storage=',  quota) AS quota FROM mailbox WHERE username = '%u' AND active = '1'
# Get the password
password_query = SELECT username as user, password, '/home/vmail/%u' as userdb_home, 'maildir:/home/vmail/%u' as userdb_mail, 5000 as  userdb_uid, 5000 as userdb_gid FROM mailbox WHERE username = '%u' AND active = '1'

To the new one

driver = mysql
connect = host=localhost dbname=postfix_db user=postfix_user password=hunter2
# The new name for MD5 is MD5-CRYPT so you might need to change this depending on version
default_pass_scheme = MD5-CRYPT
# Get the mailbox
user_query = SELECT '/home/vmail/%d/%u' as home, 'maildir:/home/vmail/%d/%u' as mail, 5000 AS uid, 5000 AS gid, concat('dirsize:storage=',  quota) AS quota FROM mailbox WHERE username = '%u' AND active = '1'
# Get the password
password_query = SELECT username as user, password, '/home/vmail/%d/%u' as userdb_home, 'maildir:/home/vmail/%d/%u' as userdb_mail, 5000 as  userdb_uid, 5000 as userdb_gid FROM mailbox WHERE username = '%u' AND active = '1'

Edit: Is it safe to say that this change should also be reflected in the wiki? I'll go ahead and make the edit, if anyone objects please revert the change in the wiki. smile

Last edited by KingX (2012-06-22 21:58:05)

Offline

Board footer

Powered by FluxBB