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


RE: [HowTo] Replace courier with dovecot - JCD - 03-08-2010 02:42 AM

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/;



RE: [HowTo] Replace courier with dovecot - merykonil - 03-08-2010 03:46 PM

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.


RE: [HowTo] Replace courier with dovecot - rbtux - 03-08-2010 07:31 PM

(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 ;-))


RE: [HowTo] Replace courier with dovecot - aseques - 03-08-2010 07:59 PM

@ 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?


RE: [HowTo] Replace courier with dovecot - aseques - 03-08-2010 09:50 PM

(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


RE: [HowTo] Replace courier with dovecot - bodysplit - 03-30-2010 01:57 AM

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.


RE: [HowTo] Replace courier with dovecot - Mazga - 04-04-2010 03:16 AM

Hi!
The attachment link http://www.isp-control.net/forum/attachment.php?aid=1009 is not available, maybe the HowTo should be updated to http://www.isp-control.net/forum/attachment.php?aid=1185

regards Martin


RE: [HowTo] Replace courier with dovecot - aseques - 04-04-2010 07:55 AM

(04-04-2010 03:16 AM)Mazga Wrote:  Hi!
The attachment link http://www.isp-control.net/forum/attachment.php?aid=1009 is not available, maybe the HowTo should be updated to http://www.isp-control.net/forum/attachment.php?aid=1185

regards Martin
Ok, fixed


RE: [HowTo] Replace courier with dovecot - edeis - 05-06-2010 10:54 AM

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?


RE: [HowTo] Replace courier with dovecot - aseques - 05-06-2010 07:51 PM

(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