Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 3 > Developers' Forum

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 20th April 2011, 16:01
Croydon Croydon is offline
ISPConfig Developer
 
Join Date: Jul 2007
Location: Koblenz, Germany
Posts: 932
Thanks: 16
Thanked 264 Times in 208 Posts
Post alternative mailbox login as optional field

Currently ispconfig3 uses the email address of a mailbox as the login when using imap/pop3.
This is my preferred option, but other control panels have a different aproach like using "web1p34" or even custom login names.

Currently I think about migrating a server with quite a few users, webs and mail addresses from a customer-built controlpanel (similar to confixx) to ispc.
Unfortunately the control panel uses custom email logins like web1p1 and sending each customer new access data is not really an option.

So my idea is:
Implementing an additional (and optional) field in ispconfig3 in the mailbox form allowing the admin (and customer?) to set a custom login for the mailbox.

1.) This would require an additional db field "login" in the email database table. If no optional login name is given the email address is put into that field.
2.) The courier authmysqlrc MYSQL_LOGIN_FIELD would change to "login" instead of "email"

My question is if you (especially till and falko) think this is an option that should make it's way into the main ispconfig branch or should I just implement it for our own use?
Are there any problems you think that will occur by doing these changes?

Thank you

Last edited by Croydon; 20th April 2011 at 17:49.
Reply With Quote
Sponsored Links
  #2  
Old 20th April 2011, 19:47
Croydon Croydon is offline
ISPConfig Developer
 
Join Date: Jul 2007
Location: Koblenz, Germany
Posts: 932
Thanks: 16
Thanked 264 Times in 208 Posts
Default

I just completed changing my local repository copy of ispconfig the way I mentioned above.

There are a lot of files that needed to be changed, so I did not want to commit to the svn repository without being sure to keep everything working.

At some points I was not sure whether to change a line or not:
Code:
user_query = SELECT email AS user, maildir AS home, CONCAT('*:storage=', quota , 'B') AS quota_rule FROM mail_user WHERE login = '%u' AND disable%Ls = 'n'
I changed the WHERE column from email to login but I left the SELECT column as is.
Is that correct or do I have to change it to "SELECT login AS user" ?
I do not exactly know what the user_query user column is used for.


The diffstat program states the following files as changed on my local copy:

config/courier/authmysqlrc
install/sql/ispconfig3.sql
install/sql/incremental/upd_0009.sql (new file)
install/tpl/authmysqlrc.master
install/tpl/debian6_dovecot-sql.conf.master
install/tpl/debian_dovecot-sql.conf.master
install/tpl/fedora_dovecot-sql.conf.master
install/tpl/mysql-virtual_mailboxes.cf.master
install/tpl/opensuse_dovecot-sql.conf.master
install/tpl/pamd_smtp.master
install/tpl/sasl_smtpd.conf.master
interface/web/mail/form/mail_user.tform.php
interface/web/mail/lib/lang/de_mail_user.lng
interface/web/mail/lib/lang/de_mail_user_list.lng
interface/web/mail/lib/lang/en_mail_user.lng
interface/web/mail/lib/lang/en_mail_user_list.lng
interface/web/mail/list/mail_user.list.php
interface/web/mail/mail_user_edit.php
interface/web/mail/templates/mail_user_list.htm
interface/web/mail/templates/mail_user_mailbox_edit.htm
19 files changed, 69 insertions(+), 25 deletions(-)

I only have a debian squeeze server with courier to test and on that server it works as intended.
Reply With Quote
  #3  
Old 20th April 2011, 21:01
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 37,001
Thanks: 840
Thanked 5,650 Times in 4,460 Posts
Default

You can commit the changes to SVN if you like.

There is one requirement though, the login field must be invisible by default so that it is not shown in the interface if this function is not explicitley activated in the server settings on the email tab. Otherwise it might confuse the existing users.

Quote:
Is that correct or do I have to change it to "SELECT login AS user" ?
I guess it has to be "SELECT login AS user", but I'am not 100% sure too.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #4  
Old 22nd April 2011, 11:03
Croydon Croydon is offline
ISPConfig Developer
 
Join Date: Jul 2007
Location: Koblenz, Germany
Posts: 932
Thanks: 16
Thanked 264 Times in 208 Posts
Default

Quote:
Originally Posted by till View Post
There is one requirement though, the login field must be invisible by default so that it is not shown in the interface if this function is not explicitley activated in the server settings on the email tab. Otherwise it might confuse the existing users.
I have never worked with the server config settings before. Can you give me a hint in what files to look how it can be used?
Reply With Quote
  #5  
Old 26th April 2011, 22:38
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 37,001
Thanks: 840
Thanked 5,650 Times in 4,460 Posts
Default

Add your config option the file interface/web/admin/form/server_config.tform.php and the corresponding template file. Then add it in install/tpl/server.ini.master

You dont have to extend the mysql database, as these settings are stored in ini format.

The server settings can be accessed then like this:

$app->uses("getconf");
$mail_config = $app->getconf->get_server_config($server_id,'mail');
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #6  
Old 27th April 2011, 16:31
Croydon Croydon is offline
ISPConfig Developer
 
Join Date: Jul 2007
Location: Koblenz, Germany
Posts: 932
Thanks: 16
Thanked 264 Times in 208 Posts
Default

Quote:
Originally Posted by till View Post
The server settings can be accessed then like this:

$app->uses("getconf");
$mail_config = $app->getconf->get_server_config($server_id,'mail');
Ok, I understand. But at the point of creating an email address I do not know on what server the address will be, so I cannot decide whether to show or to hide the additional field on a server-based config setting.
Shouldn't the setting be a global one for all (mail)servers? And how can I set/read this one?
Reply With Quote
  #7  
Old 1st May 2011, 18:00
Croydon Croydon is offline
ISPConfig Developer
 
Join Date: Jul 2007
Location: Koblenz, Germany
Posts: 932
Thanks: 16
Thanked 264 Times in 208 Posts
Default

Quote:
Originally Posted by till View Post
I guess it has to be "SELECT login AS user", but I'am not 100% sure too.
I tried to have a look in dovecot howtos and manual but i didn't find the "user" column mentioned anywhere.
Could it be, that there is no (used) "user" column in the user_query - so it doesn't matter what data it has?
Reply With Quote
  #8  
Old 2nd May 2011, 11:11
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 37,001
Thanks: 840
Thanked 5,650 Times in 4,460 Posts
Default

I dont remember where I've found that configuation. It might be that the filed is not used by all dovecot versions.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
Reply

Bookmarks

Tags
courier, ispconfig 3, login

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
F11 courier-imap fails. Nachogrande General 6 1st November 2010 18:55
Webmail problems with only one domain? compner Installation/Configuration 14 16th February 2010 17:59
squirrelmail and postfix witoszek General 12 1st December 2009 19:07
Postfix can't received email from exterior astra2000 Server Operation 5 18th October 2009 00:26
Logsize issue cryptic General 46 7th April 2008 23:29


All times are GMT +2. The time now is 02:36.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.