ispCP - Board - Support
[HowTo] Replace courier with dovecot - Printable Version

+- ispCP - Board - Support (http://www.isp-control.net/forum)
+-- Forum: ispCP Omega Contributions Area (/forum-40.html)
+--- Forum: Howtos (/forum-41.html)
+--- Thread: [HowTo] Replace courier with dovecot (/thread-6088.html)

Pages: 1 2 3 4 5 6 7 8


[HowTo] Replace courier with dovecot - aseques - 03-17-2009 12:23 AM

There are two different guides to install dovecot and migrate from courier.
.- The guide for 1.2 + quota on db (recomended) at here
.- The (unsupported) guide for dovecot < 1.2 here

Also I will try to keep here an updated copy of the ispcp-dovecot-mngr (mandatory for anything newer than 1.0.0RC7 due to changes in password encryption) in this thread so It's easy to find and reference from other places.
There use to be a thread about the migration from courier to dovecot in here, but it has been closed.

Known issues

None at the moment

Fixed issues

ispcp-dovecot-mngr should be in trunk
The script to validate users should be in the main source tree instead of this forum page, so all the users could download it alltogether with ispcp.
icket 2569
Fixed in r3861


UPDATE: The script allows now to use usernames in capitals (some users would enter Test@example.com instead of test@example.com), remember that your mail_location should be something like
Code:
mail_location = maildir:%h
so it will retieve the home from database and bypass the case sensitivity problems.
Updated file: [attachment=1185]


RE: [HowTo] Replace courier with dovecot - Master One - 06-29-2009 06:59 AM

I was just wondering, if there is a way to have dovecot instead of courier right from the beginning when doing a fresh installation, which would eliminate the need of first installing and then uninstalling the courier related stuff.


RE: [HowTo] Replace courier with dovecot - aseques - 06-29-2009 05:23 PM

(06-29-2009 06:59 AM)Master One Wrote:  I was just wondering, if there is a way to have dovecot instead of courier right from the beginning when doing a fresh installation, which would eliminate the need of first installing and then uninstalling the courier related stuff.
Not at the moment, the developers aren't against it, and some of the moderators have dovecot installed on their systems, but someone should adapt the installer to give you the choice and the ability to remember it when upgrading.
Other than that dovecot works perfectly, and the per-user stats are adapted to be friendly with dovecot too.
As always, if someone steps up and does the job, it think that it would probably get adopted into mainstream when it's mature enough (something like blondak dns patch), at least I would adopt it.

Cheers


RE: [HowTo] Replace courier with dovecot - Master One - 06-29-2009 05:38 PM

So will the upgrade to the next version (ispCP Omega 1.0.1) cause troubles, when using dovecot instead of courier?

I'll do my first installation today, and I'm in favor of using dovecot, but do not want to have too much hassle, when 1.0.1 is ready.


RE: [HowTo] Replace courier with dovecot - aseques - 06-29-2009 08:30 PM

(06-29-2009 05:38 PM)Master One Wrote:  So will the upgrade to the next version (ispCP Omega 1.0.1) cause troubles, when using dovecot instead of courier?

I'll do my first installation today, and I'm in favor of using dovecot, but do not want to have too much hassle, when 1.0.1 is ready.

No, not exactly, but since the installer expect to have courier installed, you might get some warnings during the update, nothing to worry about.
I successfully upgrade from rc6 to 1.0.0 without problems.
It's good to have a backup just in case too, you never know what can go wrong.


RE: [HowTo] Replace courier with dovecot - Master One - 06-29-2009 09:19 PM

Ok, convinced, I was quite unsure, if it is better to stick with with the standard setup, of if I should start with all these nice mods...


RE: [HowTo] Replace courier with dovecot - sulio - 07-17-2009 05:02 PM

Hi,

new to ispcp, not very good in perl, experienced with dovecot setups though.

My notes:

1. The ispcp-dovecot-mngr script does no check if the user exists in the SQL db at all, and exits with temp error in such a case, while I feel it should exit as if the password is wrong.

To fix it, I added this block:

my $sql = "SELECT count(mail_pass) FROM mail_users WHERE mail_pass != '_no_' AND mail_addr='$username'";
my ($rs, $rows) = doSQL($sql);
if ($rs != 0){
syslog('err', 'Can`t execute sql "%s"! during attempt for %s from %s, protocol %s', $sql, $username, $ip, $server);
exit($tempErr);
}
my $line = @$rows[0];
if ( @$line[0] eq 0 ) {
syslog('err', 'User not found! during attempt for %s from %s, protocol %s', $username, $ip, $server);
exit($Err);
}

just before the block where the password is being checked.

2. There is no need of password_query line in the dovecot-sql-xxxx.conf files, as this is used as userdb, so not for any password checks (the query will return wrong password anyways).

Thank you sir, for your efforts to make dovecot an alternative in ispcp.
Really appreciate that!


RE: [HowTo] Replace courier with dovecot - aseques - 07-17-2009 10:45 PM

(07-17-2009 05:02 PM)sulio Wrote:  Hi,

new to ispcp, not very good in perl, experienced with dovecot setups though.

My notes:
[quote='sulio' pid='57085' dateline='1247814155']
1. The ispcp-dovecot-mngr script does no check if the user exists in the SQL db at all, and exits with temp error in such a case, while I feel it should exit as if the password is wrong.

To fix it, I added this block:

my $sql = "SELECT count(mail_pass) FROM mail_users WHERE mail_pass != '_no_' AND mail_addr='$username'";
my ($rs, $rows) = doSQL($sql);
if ($rs != 0){
syslog('err', 'Can`t execute sql "%s"! during attempt for %s from %s, protocol %s', $sql, $username, $ip, $server);
exit($tempErr);
}
my $line = @$rows[0];
if ( @$line[0] eq 0 ) {
syslog('err', 'User not found! during attempt for %s from %s, protocol %s', $username, $ip, $server);
exit($Err);
}

just before the block where the password is being checked.
It seems fine to me, only thing is the extra mysql query being done, but since it's only called on logins, it shouldn't be a problem. I'm updating the one in the post.
Opinions ?
(07-17-2009 05:02 PM)sulio Wrote:  2. There is no need of password_query line in the dovecot-sql-xxxx.conf files, as this is used as userdb, so not for any password checks (the query will return wrong password anyways).
Ok, I applied this to my servers and also to the documentation, it makes sense not have this.


RE: [HowTo] Replace courier with dovecot - monotek - 09-21-2009 10:12 PM

Is this still needed or is dovecot support integrated in ISPCP in the meantime?


RE: [HowTo] Replace courier with dovecot - aseques - 09-22-2009 02:04 AM

(09-21-2009 10:12 PM)monotek Wrote:  Is this still needed or is dovecot support integrated in ISPCP in the meantime?

Still needed Sad
Fortunately some of the developers like dovecot too, so the wiki is uptodate and there are the needed tools to make it work.
Moving from courier to dovecot will be a bit more difficult for existant installs, so it will probably take some time.

For any help just post around.