Migrating courier to dovecot

Patrick Lion devnull at ehwat.de
Fri Aug 29 15:32:10 UTC 2014


Hi,

i want to migrate the following setup:

postfix / courier-{imap/s,pop3/s,authlib} / maildrop / mysql

I´m using the maildir format and quotas as well.

My target is the following setup:

postfix / dovecot / some sort of quota respecting lda / mysql


What i`ve done already:

SQL-Implementation for dovecot, login process and also sending mails via
auth-userdb is already working. Quotas are read out from database and
working.

Before i mention my problems while implementing, here is the config im
using at this time:


# 2.2.13: /etc/dovecot/dovecot.conf
# OS: Linux 3.14.14-gentoo x86_64 Gentoo Base System release 2.2
auth_mechanisms = plain login
auth_socket_path = /var/run/dovecot/auth-userdb
auth_verbose = yes
disable_plaintext_auth = no
info_log_path = syslog
login_log_format_elements = user=<%u> method=%m ip=%r mpid=%e
mail_debug = yes
mail_location = maildir:.maildir
mail_plugins = quota
namespace inbox {
  inbox = yes
  location = .maildir
  mailbox Drafts {
    special_use = \Drafts
  }
  mailbox Junk {
    special_use = \Junk
  }
  mailbox Sent {
    special_use = \Sent
  }
  mailbox "Sent Messages" {
    special_use = \Sent
  }
  mailbox Trash {
    special_use = \Trash
  }
  prefix = INBOX.
  separator = .
}
passdb {
  args = /etc/dovecot/dovecot-sql.conf.ext
  driver = sql
}
plugin {
  args = /etc/dovecot/dovecot-sql.conf.ext
  quota = maildir:User quota
  quota_rule = %u
  quota_rule2 = trash:storage=+150M
  quota_warning = storage=95%% quota-warning 95 %u
  quota_warning2 = storage=80%% quota-warning 80 %u
}
service auth {
  unix_listener /var/spool/postfix/private/auth {
    group = mail
    mode = 0660
    user = postfix
  }
  unix_listener auth-userdb {
    group = mail
    mode = 0660
    user = postfix
  }
}
service lmtp {
  unix_listener /var/spool/postfix/private/dovecot-lmtp {
    group = postfix
    mode = 0666
    user = postfix
  }
}
ssl_cert = </etc/ssl/dovecot/server.pem
ssl_key = </etc/ssl/dovecot/server.key
userdb {
  args = /etc/dovecot/dovecot-sql.conf.ext
  driver = sql
}
protocol imap {
  mail_plugins = quota imap_quota
}
protocol pop3 {
  mail_plugins = quota
}


grep -v '^ *\(#.*\)\?$' dovecot-sql.conf.ext
driver = mysql
connect = host=127.0.0.1 dbname=postfix user=postfix password=thereisone
default_pass_scheme = MD5-CRYPT
password_query = \
  SELECT username, password \
  FROM mailbox WHERE username = '%u'
user_query = \
  SELECT concat('/', home, user, '/', destinationname) AS home, uid, gid, \
  concat('*:storage=', round(quota / 1000 * 1.024)) AS quota_rule \
  FROM mailbox WHERE username = '%u'

Where user is the row where the admin-panel user is stored and username is
the mbox-user.


My problem is the LDA, with dovecot-lda im having the uid / gid trouble and
i really dont want to suid oder sudo it. dovecot-lmtp just gives me

status=deferred (host xx.xx[/var/run/dovecot/lmtp] said: 451 4.3.0
<box at xx.xx> Temporary internal error (in reply to end of DATA command))

Postfix virtual is working as well as maildrop, but no
dovecot-implementation wants to, i also didnt find anything about the error
above, except a bug in v2.2.2 and a google groups thread where users are
just blaming each others for nothing ..

I want to use a dovecot lda/lmtp because the quota settings for
trash-folders are very nice and reducing my support times but im stuck at
getting one of the dovecot-LDAs to work.

Let me know if you need any additional information.

Any help is greatly appreciated!


-- 
Viele Grüße / Best regards

Patrick


More information about the dovecot mailing list