Current time: 11-22-2024, 05:10 AM Hello There, Guest! (LoginRegister)


Post Reply 
[HowTo] Replace courier with dovecot
Author Message
aseques Offline
Member
*****
Dev Team

Posts: 330
Joined: May 2008
Reputation: 4
Post: #1
[HowTo] Replace courier with dovecot
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:
.txt  ispcp-dovecot-mngr.txt (Size: 2.8 KB / Downloads: 1047)
(This post was last modified: 06-14-2011 05:39 AM by aseques.)
03-17-2009 12:23 AM
Find all posts by this user Quote this message in a reply
Master One Offline
Junior Member
*

Posts: 13
Joined: Jun 2009
Reputation: 0
Post: #2
RE: [HowTo] Replace courier with dovecot
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.
06-29-2009 06:59 AM
Find all posts by this user Quote this message in a reply
aseques Offline
Member
*****
Dev Team

Posts: 330
Joined: May 2008
Reputation: 4
Post: #3
RE: [HowTo] Replace courier with dovecot
(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
06-29-2009 05:23 PM
Find all posts by this user Quote this message in a reply
Master One Offline
Junior Member
*

Posts: 13
Joined: Jun 2009
Reputation: 0
Post: #4
RE: [HowTo] Replace courier with dovecot
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.
06-29-2009 05:38 PM
Find all posts by this user Quote this message in a reply
aseques Offline
Member
*****
Dev Team

Posts: 330
Joined: May 2008
Reputation: 4
Post: #5
RE: [HowTo] Replace courier with dovecot
(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.
06-29-2009 08:30 PM
Find all posts by this user Quote this message in a reply
Master One Offline
Junior Member
*

Posts: 13
Joined: Jun 2009
Reputation: 0
Post: #6
RE: [HowTo] Replace courier with dovecot
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...
06-29-2009 09:19 PM
Find all posts by this user Quote this message in a reply
sulio Offline


Posts: 1
Joined: Jul 2009
Reputation: 0
Post: #7
RE: [HowTo] Replace courier with dovecot
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!
(This post was last modified: 07-17-2009 05:04 PM by sulio.)
07-17-2009 05:02 PM
Find all posts by this user Quote this message in a reply
aseques Offline
Member
*****
Dev Team

Posts: 330
Joined: May 2008
Reputation: 4
Post: #8
RE: [HowTo] Replace courier with dovecot
(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.
07-17-2009 10:45 PM
Find all posts by this user Quote this message in a reply
monotek Offline
Junior Member
*

Posts: 65
Joined: Dec 2006
Reputation: 0
Post: #9
RE: [HowTo] Replace courier with dovecot
Is this still needed or is dovecot support integrated in ISPCP in the meantime?
09-21-2009 10:12 PM
Find all posts by this user Quote this message in a reply
aseques Offline
Member
*****
Dev Team

Posts: 330
Joined: May 2008
Reputation: 4
Post: #10
RE: [HowTo] Replace courier with dovecot
(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.
09-22-2009 02:04 AM
Find all posts by this user Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)