Courier to Dovecot migration

Discussion in 'Installation/Configuration' started by goebelmeier, Mar 12, 2010.

  1. goebelmeier

    goebelmeier ISPConfig Developer ISPConfig Developer


    is there already a migration path / best practice, to change imapd from courier to dovecot. I'm running ISPConfig 3.0.2 on Debian Lenny.

    Thanks in advance,

  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Courier and dovecot implementations use a different maildir layou, so you can not simply switch the imap daemon. If you want to migrate your server to dovecot, you will have to create a new "Maildir" subfolder in every ecisting maildir and copy all the contents of the existing maildir into this new subfolder. Exa,ple:

    Courier layout:


    Dovecot Layout:


    If your users have created any mailfilters, then these filters will get lost as they are written in maildrop syntax and not sieve as required by dovecot.
  3. goebelmeier

    goebelmeier ISPConfig Developer ISPConfig Developer

  4. djtremors

    djtremors ISPConfig Developer ISPConfig Developer

    I've got a successful migration working on my config with sieve filtering and managesieve for squirrelmail rule editing and so on.

    the only thing that doesnt work is updating the ispconfig_mailsize file in each homedir as it's processed by maildrop rules.

    I'm currently working on a dovecot solution using global sieve script to process mail for each user. only problem i'm still trying to fix is that it's not running as vmail:vmail user causing me grief and for some reason the ispc dev guys didnt use db tables to populate the counts so atm i'm trying to make it use dovecot transport which is suppose to run as vmail:vmail but still doesn't..

    getting there.....
  5. till

    till Super Moderator Staff Member ISPConfig Developer

    Yes, thats not implemented yet as sieve lacks some functions that maildrop has. It is planned to implement a different solution for dovecot that is based on the dovecot binlog.

    Not sure what you mean with that.
  6. goebelmeier

    goebelmeier ISPConfig Developer ISPConfig Developer

    Could you please shortly post a list of steps what you currently did for that successful migration? Maybe we can avoid some obstacles you had while your migration.
  7. radim_h

    radim_h Member HowtoForge Supporter

    In 1.2.9 (Ubuntu 10.04) is directive in /etc/dovecot.conf
    mail_location , which should be set to
    mail_location = maildir:/var/vmail/%d/%n

    Assuming i have to stay with mail_location = maildir:/var/vmail/%d/%n/Maildir as ISPC3 dovecot mail plugin is expecting this location ?
  8. till

    till Super Moderator Staff Member ISPConfig Developer

    The dovecot mail location is read directly from the ispconfig database. Please see dovecot-sql.conf file. The mail_location setting in dovecot.conf is not used, so do not alter it.
  9. radim_h

    radim_h Member HowtoForge Supporter

    the mail_location setting must be set, or dovecot will not start..
    i spent couple hours yeasterday with setting up dovecot in Ubuntu 10.04
    and here is my config, may be useful for someone..
    Be Aware, that Sieve settings are not included, as i was not able to set sieve correctly yet. I'm also not sure quota works as Roundcubemail doensn't show quota as it does for courier :((

    Dovecot config Ubuntu 10.04:

    protocols = imap imaps pop3 pop3s
    disable_plaintext_auth = no
    log_timestamp = "%Y-%m-%d %H:%M:%S "

    ssl_cert_file = /etc/ssl/_.mydomain.tld/_.mydomain.tld.crt
    ssl_key_file = /etc/ssl/_.mydomain.tld/_.mydomain.tld.key

    mail_privileged_group = mail

    ## IMAP specific settings
    protocol imap {
    mail_executable = /usr/lib/dovecot/rawlog /usr/lib/dovecot/imap
    # Support for dynamically loadable plugins. mail_plugins is a space separated
    # list of plugins to load.
    mail_plugins = quota
    #mail_plugin_dir = /usr/lib/dovecot/modules/imap

    ## POP3 specific settings
    protocol pop3 {
    mail_executable = /usr/lib/dovecot/rawlog /usr/lib/dovecot/pop3
    pop3_uidl_format = %08Xu%08Xv
    mail_plugins = quota

    ## LDA specific settings

    protocol lda {
    # Address to use when sending rejection mails.
    postmaster_address = [email protected]

    # Hostname to use in various parts of sent mails, eg. in Message-Id.
    # Default is the system's real hostname.
    #hostname =

    # Support for dynamically loadable plugins. mail_plugins is a space separated
    # list of plugins to load.
    mail_plugin_dir = /usr/lib/dovecot/modules/lda

    # Binary to use for sending mails.
    #sendmail_path = /usr/lib/sendmail

    # UNIX socket path to master authentication server to find users.
    auth_socket_path = /var/run/dovecot/auth-master

    # Enabling Sieve plugin for server-side mail filtering
    mail_plugins = sieve quota

    ## Authentication processes

    # Executable location
    #auth_executable = /usr/lib/dovecot/dovecot-auth
    auth default {
    mechanisms = plain login
    passdb pam {

    # SQL database <doc/wiki/AuthDatabase.SQL.txt>
    passdb sql {
    # Path for SQL configuration file
    args = /etc/dovecot/dovecot-sql.conf

    ## dovecot-lda specific settings
    socket listen {
    master {
    path = /var/run/dovecot/auth-master
    mode = 0600
    user = vmail # User running Dovecot LDA
    #group = vmail # Or alternatively mode 0660 + LDA user in this group
    client {
    path = /var/spool/postfix/private/auth
    mode = 0660
    user = postfix
    group = postfix


    dict {
    #quota = mysql:/etc/dovecot-dict-quota.conf

    ## Plugin settings
    plugin {
    quota = maildir


    mail_uid = 5000
    mail_gid = 5000

    mail_location = maildir:/var/vmail/%d/%n/Maildir
  10. barbarab

    barbarab New Member

    Hi Till,
    sorry for exhuming such an old thread but after having read many posts and howto I remain confused about what to do. Do your lines above mean that to migrate from Courier to Dovecot I could just create the account in ispconfig (and therefore its Maildir subfolder) and then copy inside the Courier mails, without using the script? Or would it be definitely too reckless? Thank you.

Share This Page