Current time: 11-23-2024, 03:49 AM Hello There, Guest! (LoginRegister)


Post Reply 
[HowTo] Replace courier with dovecot
Author Message
JCD Offline
Junior Member
*

Posts: 22
Joined: Aug 2007
Reputation: 1
Post: #41
RE: [HowTo] Replace courier with dovecot
The ispcp-dovecot-mngr script works very well, thanks for your work!
But I discovered a malfunction. If one user tries to login using his username in mixed upper and lowercase the script throws an "User not found" error. Say he enters Foo@bar.org, but in the database the mail address is saved as foo@bar.org, he cannot login. Outlook, Thunderbird and Squirrelmail don't convert the username to lowercase. Roundcube does.

To fix this issue, the username should be converted into lowercase before the database lookup takes place. Simply add the following after line 46 and it works:
Code:
$username =~ tr/A-Z/a-z/;
03-08-2010 02:42 AM
Find all posts by this user Quote this message in a reply
merykonil Offline


Posts: 4
Joined: Feb 2010
Reputation: 0
Post: #42
RE: [HowTo] Replace courier with dovecot
PostgreSQL is a possibility. I’ve looked at this, even more after the takeover of Sun by Oracle, and we could replace MySQL. But this is more of a ‘religious’ dilemma then compared to the improvements posed by switching to Dovecot.
Currently I would be more inclined to have PostgreSQL as a separate install option.
03-08-2010 03:46 PM
Find all posts by this user Quote this message in a reply
rbtux Offline
Moderator
*****
Moderators

Posts: 1,847
Joined: Feb 2007
Reputation: 33
Post: #43
RE: [HowTo] Replace courier with dovecot
(03-08-2010 02:42 AM)JCD Wrote:  The ispcp-dovecot-mngr script works very well, thanks for your work!
But I discovered a malfunction. If one user tries to login using his username in mixed upper and lowercase the script throws an "User not found" error. Say he enters Foo@bar.org, but in the database the mail address is saved as foo@bar.org, he cannot login. Outlook, Thunderbird and Squirrelmail don't convert the username to lowercase. Roundcube does.

To fix this issue, the username should be converted into lowercase before the database lookup takes place. Simply add the following after line 46 and it works:
Code:
$username =~ tr/A-Z/a-z/;

If you do that you should change:

mail_location = maildir:/var/mail/virtual/%d/%n
to
mail_location = maildir:/var/mail/virtual/%Ld/%Ln

(this should be changed anyway ;-))
03-08-2010 07:31 PM
Visit this user's website 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: #44
RE: [HowTo] Replace courier with dovecot
@ merykonil
This is certainly not a mysql issue, mysql data in this case already has the _ci collation, so the select would be case insensitive.

It's failing for this check (on line 40)
if ($username =~ /^(([a-z0-9\-_]+\.?)+)@(([a-z0-9\-]+\.?)+)$/) {

So we could change that and it would work straight out of the box, I'd like to know the opinion of the dev guys, because this is probably done to mimic courier auth (wich reads the info from files and probably doesn't work either).
Also what happens with postfix and auth to send mail, does it work with caps there?
03-08-2010 07:59 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: #45
RE: [HowTo] Replace courier with dovecot
(03-08-2010 07:31 PM)rbtux Wrote:  If you do that you should change:

mail_location = maildir:/var/mail/virtual/%d/%n
to
mail_location = maildir:/var/mail/virtual/%Ld/%Ln

(this should be changed anyway ;-))
Updated the wiki to reflect this change, it seems good to me.
I'll change the other one to, doesn't seem to introduce problems of any way to me.

Cheers
03-08-2010 09:50 PM
Find all posts by this user Quote this message in a reply
bodysplit Offline
Junior Member
*

Posts: 45
Joined: Nov 2007
Reputation: 1
Post: #46
RE: [HowTo] Replace courier with dovecot
Just ran through the howto and found out that something is missing the SQL statement for Quota.

Changes in dovecot-sql-domain.conf - add "and" (red):
user_query = SELECT concat('/var/mail/virtual/', domain.domain_name, '/',mail_acc) as home, '1001' as uid, '8' as gid, concat('maildir:storage=', floor(quota/1024)) AS quota FROM mail_users inner join domain on mail_users.domain_id = domain.domain_id WHERE mail_acc='%n' and domain.domain_name='%d' and (mail_type='normal_mail' OR mail_type='normal_mail,normal_forward');

else the select will fail and nobody can access it's mailbox.

Also, to me it seems that this value is updated only after new mail arrives. My box was changed from unlimited to 100 MB and is still written as Unlimited.
03-30-2010 01:57 AM
Find all posts by this user Quote this message in a reply
Mazga Offline
Junior Member
*

Posts: 16
Joined: Mar 2010
Reputation: 0
Post: #47
RE: [HowTo] Replace courier with dovecot
Hi!
The attachment link http://www.isp-control.net/forum/attachm...p?aid=1009 is not available, maybe the HowTo should be updated to http://www.isp-control.net/forum/attachm...p?aid=1185

regards Martin
04-04-2010 03:16 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: #48
RE: [HowTo] Replace courier with dovecot
(04-04-2010 03:16 AM)Mazga Wrote:  Hi!
The attachment link http://www.isp-control.net/forum/attachm...p?aid=1009 is not available, maybe the HowTo should be updated to http://www.isp-control.net/forum/attachm...p?aid=1185

regards Martin
Ok, fixed
04-04-2010 07:55 AM
Find all posts by this user Quote this message in a reply
edeis Offline
Junior Member
*

Posts: 34
Joined: May 2010
Reputation: 0
Post: #49
RE: [HowTo] Replace courier with dovecot
Hi, I am running CentOS5.4. Latest version of ISPcp, dovecot, postfix, etc. Having troubles with postfix as per wiki.

Mail fails to send when using:
virtual_transport = dovecot

I changed it to:
virtual_transport = virtual

and it works. Is there any reason why I should be using dovecot for the virtual transport, security issue, spam, etc?
05-06-2010 10:54 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: #50
RE: [HowTo] Replace courier with dovecot
(05-06-2010 10:54 AM)edeis Wrote:  Hi, I am running CentOS5.4. Latest version of ISPcp, dovecot, postfix, etc. Having troubles with postfix as per wiki.

Mail fails to send when using:
virtual_transport = dovecot

I changed it to:
virtual_transport = virtual

and it works. Is there any reason why I should be using dovecot for the virtual transport, security issue, spam, etc?
This is needed so the configuration only depends on dovecot (no courier), with that, you get as a bonus the sieve and quota.

You have to be sure that your master.cf can find deliver on your system
Quote:dovecot unix - n n - - pipe
flags=DRhu user=vmail:mail argv=/usr/lib/dovecot/deliver -f ${sender} -d ${recipient} -s
05-06-2010 07:51 PM
Find all posts by this user Quote this message in a reply
Post Reply 


Forum Jump:


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