Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 2 > Tips/Tricks/Mods

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #11  
Old 1st October 2007, 23:45
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 35,446
Thanks: 813
Thanked 5,214 Times in 4,089 Posts
Default

Do you use dovecot with a configuration to allow pop3 / imap logins with the email address?
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
Sponsored Links
  #12  
Old 1st October 2007, 23:53
CaptainBalou CaptainBalou is offline
Junior Member
 
Join Date: Aug 2007
Posts: 29
Thanks: 8
Thanked 1 Time in 1 Post
Default

I allowed only imap and imaps at the beginning - that works fine with "username@domain.com". In dovecot I set "auth_username_format ="%Ld_%Ln". Then I've seen that you use pop3 for https://www.domain.com:81/maildir so activated pop3 too.

Marco
Reply With Quote
  #13  
Old 2nd October 2007, 00:05
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 35,446
Thanks: 813
Thanked 5,214 Times in 4,089 Posts
Default

The mailuser login has never been tested with this hack, so I guess that the mailuser login has to be rewritten. The mysql database table that is used to lookup the username in the database does not contain a username in the form of username@domain.com.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #14  
Old 2nd October 2007, 00:09
CaptainBalou CaptainBalou is offline
Junior Member
 
Join Date: Aug 2007
Posts: 29
Thanks: 8
Thanked 1 Time in 1 Post
Default

Ah, ok. That "quick and dirty"-hack was the only one I've seen to establish a working "username@domain.com" authentication. Is there a "official" way? Perhaps then the mailuser-login would work too as you mentioned.
Reply With Quote
  #15  
Old 2nd October 2007, 00:56
CaptainBalou CaptainBalou is offline
Junior Member
 
Join Date: Aug 2007
Posts: 29
Thanks: 8
Thanked 1 Time in 1 Post
Default

As you mentioned I tried to hack the login php code.

I just modified it for testing purposes. I deactivated the check of the username in the ispconfig database. It's now possible to login via the email address without any problem. So you were correct with your idea - it's the dovecot-hack.

I think I would have to change many things to get all details of the mailuser-menu working. So still my question: Is there a standard way to do the things I did with the hack?

I got to bed now - it's late in the night. ;-) See you tomorrow.
Marco
Reply With Quote
  #16  
Old 2nd October 2007, 10:18
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 35,446
Thanks: 813
Thanked 5,214 Times in 4,089 Posts
Default

Quote:
Is there a standard way to do the things I did with the hack?
No, usernames with a @ inside are not officially supported by ISPConfig 2.x. They will be supported with ISPConfig 3.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #17  
Old 2nd October 2007, 11:40
CaptainBalou CaptainBalou is offline
Junior Member
 
Join Date: Aug 2007
Posts: 29
Thanks: 8
Thanked 1 Time in 1 Post
Default

Ok. But what do others do with their users? Do they let them login with their real username, like "domain.com_username" in Roundcube? I nearly can't belive that. Hmm. Ok, so I try to get it working for me - hacking some scripts and wait for release 3. ;-)

Marco
Reply With Quote
  #18  
Old 3rd October 2007, 01:24
CaptainBalou CaptainBalou is offline
Junior Member
 
Join Date: Aug 2007
Posts: 29
Thanks: 8
Thanked 1 Time in 1 Post
Thumbs up

Hi Till,

I've found the problem. It's the conversion of the login name of dovecot (dovecot.conf parameter 'auth_username_format ="%Ld_%Ln"'). I'm converting "username@domain.com" to "domain.com_username", so the users are able to login with their email addresses. The problem while logging in with the real username is that there is no "@" in the string. Dovecot tries to convert the string the same way like the email address. "strip anything behind the '@' as domain and everything before the '@' as the username; switch the order and add a underscore in between". But there is no '@' so the username results in "_domain.com_username" which is not a valid username.

I hacked the login/index.php a bit and it seems that everything works fine for me now.

Code:
changed line 38:

$username     = $_POST["username"];

to 

$pop3username     = $_POST["username"];
Code:
added line 41 and 42:

list ($loginusername, $logindomain) = split('[/@-]', $pop3username);
$username = "${logindomain}_$loginusername";
Code:
changed line 65:

$res = $app->pop3->Login($username,$passwort,0);

to 

$res = $app->pop3->Login($pop3username,$passwort,0);
So the user get's authenticated against ISPconfig with "domain.com_username" and against dovecot with "username@domain.com". Everything looks fine now. I hope some others can use this hack too if the want to use this "email address alias login in dovecot" with https://www.domain.com:81/mailuser.

Regards
Marco
Reply With Quote
The Following User Says Thank You to CaptainBalou For This Useful Post:
till (3rd October 2007)
  #19  
Old 3rd October 2007, 13:35
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 35,446
Thanks: 813
Thanked 5,214 Times in 4,089 Posts
Default

Thanks for finding a solution for this problem. I moved the thread to the tipps & Tricks forum.

Update:

I added your patch to the bugtracker.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.

Last edited by till; 3rd October 2007 at 19:20.
Reply With Quote
  #20  
Old 9th October 2007, 22:18
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 35,446
Thanks: 813
Thanked 5,214 Times in 4,089 Posts
 
Default

I've added a patch for usernames with @ in the 2.2.18 release.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
The Following User Says Thank You to till For This Useful Post:
CaptainBalou (9th October 2007)
Reply

Bookmarks

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
Unable to authenticate to SMTP server ashkev Installation/Configuration 15 6th February 2007 17:46
Mail Login: mailuser or mailuser@domain.com, not webX_mailuser... VMartins General 3 7th November 2006 11:47
kann keine mails empfangen odin1 Installation/Configuration 5 6th July 2006 12:13
MailUser Login suman General 1 9th May 2006 17:03
Total Frustration-HELP palkat Installation/Configuration 17 3rd September 2005 17:28


All times are GMT +2. The time now is 22:56.


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