dovecot

Discussion in 'Installation/Configuration' started by gring, May 11, 2009.

  1. gring

    gring Member HowtoForge Supporter

    Hi!

    Has anyone managed to run Ispconfig with Dovecot?

    Will it work by only modifying /etc/dovecot/dovecot-sql.conf to match Ispconfig's mysql tables, or are there other things to modify? ( like /etc/postfix/master.cf )

    Any documentation is welcome.

    Thx!
     
  2. gring

    gring Member HowtoForge Supporter

    Here is what I figured out:

    first, you have to modify /etc/dovecot/dovecot.conf
    look for "passdb sql", you should find

    Code:
    # SQL database <doc/wiki/AuthDatabase.SQL.txt>
      #passdb sql {
      # Path for SQL configuration file
      #args = /etc/dovecot/dovecot-sql.conf
    #}
    
    Uncomment it to allow password authentification from the mysql database.

    Then, we have to do the same thing for dovecot to get the other fields.
    look for "userdb prefetch" and uncomment it.

    It means we're gonna check the password and get the other infos in a single sql query, instead of two.

    Then, we have to configure the access to the database. Edit /etc/dovecot/dovecot-sql.conf

    It is very well documented, and it seems we should add something like:

    Code:
    driver = mysql
    connect = host=localhost dbname=dbispconfig user=ispconfig password=<ispconfig_password>
    default_pass_scheme = CRYPT
    password_query = SELECT email AS user, password, uid AS userdb_uid, gid AS userdb_gid, homedir AS userdb_home, maildir AS userdb_mail FROM mail_user WHERE email = '%u'
    
    I figured out the ispconfig password from the courier conf file, it should be findable elsewhere.

    I haven't tested it yet, and in the courier config file there is a support for quotas.
     
    Last edited: May 13, 2009
  3. gring

    gring Member HowtoForge Supporter

    Hi

    I've tested the above, and imap consultation works.

    Now I've got another problem. Outgoing mail works, but receiving mail doesn't (I tried to send mail to myself, and to other local mailboxes).

    I think I misunderstand how Ispconfig configures postfix:

    Does Postfix directly writes the incoming mail into the user mailboxes, as it seems in the configuration files, or does it pass the incoming mail to the IMAP / POP 's server LDA, in which case should be configured?

    thanks.
     
  4. gring

    gring Member HowtoForge Supporter

    this is what I get in /var/log/mail.log when I try to send a mail to myself:

    Code:
    
    May 15 20:03:51 <hostname> postfix/smtpd[1704]: connect from localhost.localdomain[127.0.0.1]
    May 15 20:03:51 <hostname> postfix/smtpd[1704]: 66D492320: client=localhost.localdomain[127.0.0.1]
    May 15 20:03:51 <hostname> postfix/cleanup[1686]: 66D492320: message-id=<5ae3cf331e9545e7417805635e70edbe@localhost>
    May 15 20:03:51 <hostname> postfix/smtpd[1704]: disconnect from localhost.localdomain[127.0.0.1]
    May 15 20:03:51 <hostname> postfix/qmgr[3687]: 66D492320: from=<[email protected]>, size=1297, nrcpt=1 (queue active)
    May 15 20:03:51 <hostname> amavis[3898]: (03898-07) Passed CLEAN, LOCAL [127.0.0.1] [127.0.0.1] <[email protected]> -> <[email protected]>, Message-ID: <5ae3cf331e9545e7417805635e70edbe@localhost>, mail_id: YJwnNtwps5d6, Hits: 2.987, size: 842, queued_as: 66D492320, 1577 ms
    May 15 20:03:51 <hostname> postfix/smtp[1687]: CF9B71EC5: to=<[email protected]>, relay=127.0.0.1[127.0.0.1]:10024, delay=1.6, delays=0.02/0.01/0/1.6, dsn=2.0.0, status=sent (250 2.0.0 Ok, id=03898-07, from MTA([127.0.0.1]:10025): 250 2.0.0 Ok: queued as 66D492320)
    May 15 20:03:51 <hostname> postfix/qmgr[3687]: CF9B71EC5: removed
    May 15 20:03:51 <hostname> postfix/pipe[1705]: 66D492320: to=<[email protected]>, relay=maildrop, delay=0.03, delays=0.01/0.01/0/0.02, dsn=2.0.0, status=sent (delivered via maildrop service)
    May 15 20:03:51 <hostname> postfix/qmgr[3687]: 66D492320: removed
    
    
    the line which says "delivered via maildrop service" proves postfix is receiving mail, right?
     
  5. Rune

    Rune New Member

    I've used dovecot before, but I'm a complete and total ispconfig n00b who has just installed ispconfig and can't even log into it

    But these show postfix receiving the mail (I think I'm correct on this, I'm sure someone will point it out soon enough if I'm not)

    Code:
    May 15 20:03:51 <hostname> postfix/smtpd[1704]: connect from localhost.localdomain[127.0.0.1]
    May 15 20:03:51 <hostname> postfix/smtpd[1704]: 66D492320: client=localhost.localdomain[127.0.0.1]
    May 15 20:03:51 <hostname> postfix/cleanup[1686]: 66D492320: message-id=<5ae3cf331e9545e7417805635e70edbe@localhost>
    May 15 20:03:51 <hostname> postfix/smtpd[1704]: disconnect from localhost.localdomain[127.0.0.1]

    At this point it's entered the mail queue and then these lines here:

    Code:
    May 15 20:03:51 <hostname> postfix/qmgr[3687]: 66D492320: from=<[email protected]>, size=1297, nrcpt=1 (queue active)
    May 15 20:03:51 <hostname> amavis[3898]: (03898-07) Passed CLEAN, LOCAL [127.0.0.1] [127.0.0.1] <[email protected]> -> <[email protected]>, Message-ID: <5ae3cf331e9545e7417805635e70edbe@localhost>, mail_id: YJwnNtwps5d6, Hits: 2.987, size: 842, queued_as: 66D492320, 1577 ms
    May 15 20:03:51 <hostname> postfix/smtp[1687]: CF9B71EC5: to=<[email protected]>, relay=127.0.0.1[127.0.0.1]:10024, delay=1.6, delays=0.02/0.01/0/1.6, dsn=2.0.0, status=sent (250 2.0.0 Ok, id=03898-07, from MTA([127.0.0.1]:10025): 250 2.0.0 Ok: queued as 66D492320)
    May 15 20:03:51 <hostname> postfix/qmgr[3687]: CF9B71EC5: removed
    Show the server's processed it to see if it's a legitimate mail according to the server's restrictions and accepted it,

    May 15 20:03:51 <hostname> postfix/pipe[1705]: 66D492320: to=<[email protected]>, relay=maildrop, delay=0.03, delays=0.01/0.01/0/0.02, dsn=2.0.0, status=sent (delivered via maildrop service)
    May 15 20:03:51 <hostname> postfix/qmgr[3687]: 66D492320: removed

    It's been successfully processed by postfix and handed over to maildrop

    So I'd guess that something's either going wrong in maildrop as it's picking the mail up, or maildrop isn't able to transport it to the destination it's meant to end up at

    Two things I've had cause those sort of problems with dovecot before are permissions and socket path errors, might be worth checking out

    I don't have a dovecot installation any more that I can look at to give you much info on what to check for those, it was on opensuse anyway and that's what I've wiped off to install this debian/ispconfig combo I can't log into :confused:

    I also don't know enough about debian or ispconfig to know where the paths in dovecot.conf should be pointing, but checking whether the files dovecot.conf refers to actually exist or not should be a good starting point

    Hope that helps you at least eliminate some possibilities
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    Dovecot is not supported by ispconfig 3 and you should not use it if you dont really know what you are doing. So if you are not a long time linux sysadmin and you dont know the ispconfig sources and dont know how everything exactly works then do not use dovecot.
     
  7. gring

    gring Member HowtoForge Supporter

    Hi

    Thanks for you help. I'm in migration hell for months now, and it seems I'm finally seing the end of the tunnel :)

    I tried to stick to the installation guide, but never managed to migrate existing mailboxes to Courier, while Dovecot is very well documented and there is a convertion script that works perfectly. Anyway, I'll have to learn how to make it work with ispconfig.

    Till, are you saying that because there are reasons I don't know about that make Dovecot unusable with Ispconfig? (I don't need quota support)

    Sorry, it must be frustrating to have people asking around about things that you haven't had time to work on, but hey, I just means that Ispconfig is really good.

    I wrote the user_query line in case it would turn out to be useful, dovecot-sql should now look like this:

    Code:
    driver = mysql
    connect = host=localhost dbname=dbispconfig user=ispconfig password=<ispconfig_password>
    default_pass_scheme = CRYPT
    password_query = SELECT email AS user, password, uid AS userdb_uid, gid AS userdb_gid, homedir AS userdb_home, maildir AS userdb_mail FROM mail_user WHERE email = '%u'
    user_query = SELECT uid, gid, homedir AS home, maildir AS mail FROM mailÃ_user WHERE email = '%u'
    
     
  8. till

    till Super Moderator Staff Member ISPConfig Developer

    The mailbox format for courier and dovecot is basically the same in ispconfig 3. As you have to migrate just the mail files, both courier and dovecot will built their own index files when you access the mailboxes automatically then.

    As long as you dont use dovecot deliver as delievery agent then dovecot works fine. In ispconfig 3 you will have to use courier-maildrop as lda as the mail delivery scripts are built in its syntax. courier-maildrop is available independantly from courier imap and pop3 and it works fine with dovecot. If you dont use courier-maildrop, several functions like autoresponders, email filters etc. will not work. Also the mail quota is handled by maildrop, so as long as you install it your setup will work with dovecot as pop3 and imap server.

    @gring. This answer was not meant to you. I'am just saying this because it is not possible to to switch to another pop3 / imap daemon which is not supported without good linux admin knowledge and without knowing what they are doing and if someone nevr debugged a mailsystem and is not familar with setting up mailservers from the basics even without ispconfig then he should stick with the supported software.
     
  9. gring

    gring Member HowtoForge Supporter

    Hi, I took another server, and it works now, seems my problems were related to the distribution itself
     

Share This Page