Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 2 > Installation/Configuration

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 27th May 2008, 10:42
radim_h radim_h is offline
Senior Member
 
Join Date: Jan 2007
Location: Prague, Czech
Posts: 420
Thanks: 33
Thanked 24 Times in 19 Posts
Send a message via ICQ to radim_h
Unhappy mailuser login - how to log in with dovecot authentification

Hell-o !

I'm using loging to dovecot in my positfix main.cf
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth

then in dovecot.conf
auth_username_format ="%Ld_%Ln"

(which means that my users are logging with with their whole email adress , not using any kind of rewrite to virtusertable format.
Email adress is also set in their email clients and I also cannot use webmail packeges for ISPC as there are scripts to rewrite email adresses to system format)
and i'm getting then same error like in following...

My problem is: I cannot log into ISPConfig with mailuser login
( https://www.domain.com:81/mailuser/)
as i'm getting :
May 27 10:31:33 web1 dovecot: pop3-login: Disconnected: user=<_domain.tld_test>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, secured

I have no idea why the underscore in front of user name is appearing

IMHO it is caused because
/home/admispconfig/ispconfig/web/mailuser/lib/classes/pop3.inc.php

is using some kind of rewrite for email addresses user@domain.tld to system users format domain.tld_user


Does anyone has please idea hot to change
/home/admispconfig/ispconfig/web/mailuser/lib/classes/pop3.inc.php

to not rewrite email adress into _domain.tld_user ?

Format domain.tld_user can be used, but i have no idea what is causing that underscore in front of user name ..

Last edited by radim_h; 27th May 2008 at 10:45.
Reply With Quote
Sponsored Links
  #2  
Old 28th May 2008, 10:23
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 36,034
Thanks: 826
Thanked 5,382 Times in 4,229 Posts
Default

Please try to replace the content of the file /home/admispconfig/ispconfig/web/mailuser/login/index.php with this:

Code:
<?php
/*
Copyright (c) 2005, projektfarm Gmbh, Till Brehm, Falko Timme
All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

    * Redistributions of source code must retain the above copyright notice,
      this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright notice,
      this list of conditions and the following disclaimer in the documentation
      and/or other materials provided with the distribution.
    * Neither the name of ISPConfig nor the names of its contributors
      may be used to endorse or promote products derived from this software without
      specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
require_once('../../../lib/config.inc.php');
require_once('../lib/app.inc.php');

$app->uses('tpl,pop3');
$app->tpl->newTemplate("login.tpl.htm");

if(count($_POST) > 1) {
        if($_POST["username"] != '' and $_POST["passwort"] != '') {

                $username         = $_POST["username"];
                $passwort         = $_POST["passwort"];
				
				$orig_username = $username;
				
				// Dovecot @ username hack
				if(stristr($username, '@')) {
					list ($loginusername, $logindomain) = split('[/@-]', $username);
					$username = "${logindomain}_$loginusername";
				}

                // Checke, ob es den User in ISPConfig DB gibt
                $user = $app->db->queryOneRecord("SELECT * FROM isp_isp_user WHERE user_username = '".addslashes($username)."'");

                if($user["doc_id"] > 0) {
                  // Hole das Web des Users
                  $web = $app->db->queryOneRecord("SELECT isp_isp_web.web_mailuser_login FROM isp_isp_web, isp_dep WHERE isp_isp_web.doc_id = isp_dep.parent_doc_id AND isp_isp_web.doctype_id = isp_dep.parent_doctype_id AND isp_dep.child_doctype_id = 1014 AND isp_dep.child_doc_id = ".$user["doc_id"]);
                  $login_allowed = $web["web_mailuser_login"];
                  unset($web);

                  if($login_allowed == 1){
                        // for DEBUG Only
                        if($go_info["server"]["mode"] == 'demo') {
							$app->pop3->hostname = "ispconfig.org";
						} else {
							$app->pop3->hostname = "localhost";
						}

                        // ffne Pop3 Verbindung
                        $res = $app->pop3->Open();
                        if($res == '') {

                                // versuche Login
                                $res = $app->pop3->Login($orig_username,$passwort,0);
                                if($res == '') {

                                        // Login war erfolgreich
                                        $_SESSION["s"]["userid"] = $user["doc_id"];
                                        $_SESSION["s"]["user"]   = $user;
                                        $app->pop3->Close();
                                        header("Location: ../mail/index.php");
                                        exit;

                                } else {
                                        // Username oder PW falsch
                                        $error = $res;
                                        $app->pop3->Close();
                                }
                        } else {
                                // kein pop3 Login mglich
                                $error = $res;
                                $app->pop3->Close();
                        }
                  } else {
                    // Mailuser-Login fr das Web nicht zugelassen
                    $error = $app->lng("txt_no_mailuser_login");
                  }
                } else {
                        // User unbekannt in DB
                        $error = $app->lng("txt_user_unbekannt");
                }
        } else {
                $error = $app->lng("txt_email_passwort_leer");
        }
}

$app->tpl->setVar("error",$error);

$app->tpl_defaults();
$app->tpl->pparse();

?>
__________________
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:
radim_h (28th May 2008)
  #3  
Old 28th May 2008, 14:33
radim_h radim_h is offline
Senior Member
 
Join Date: Jan 2007
Location: Prague, Czech
Posts: 420
Thanks: 33
Thanked 24 Times in 19 Posts
Send a message via ICQ to radim_h
Default Thank You!

It is working instantly, many thanks!
Reply With Quote
  #4  
Old 28th May 2008, 15:55
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 36,034
Thanks: 826
Thanked 5,382 Times in 4,229 Posts
Default

Ok thanks, I will add the changes to SVN so they will be part of the next release..
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #5  
Old 6th June 2008, 02:17
radim_h radim_h is offline
Senior Member
 
Join Date: Jan 2007
Location: Prague, Czech
Posts: 420
Thanks: 33
Thanked 24 Times in 19 Posts
Send a message via ICQ to radim_h
Default one small bug

I have discovered one small bug on mailuser page

when you log in on https://ispcdomain.tld/mailuser/
In "User & Email" in Field "Name:" you can input name with any diacritics
as characters ěščřž

which is actually not allowed
as you can try do this in ISPConfig https://ispcdomain.tld/ you'll get message:

Field: Real Name
Only the following signs are allowed: a-z A-Z 0-9 - _ .

These characters are saved an you can see them later in ISPConfig
(but again - cannot save them in ISPC and must correct it)

There is no problem with functionality as in /etc/passwd the Real name is simply not saved

IT should be good add allowed characters checking also at mailuser page..
Reply With Quote
  #6  
Old 6th June 2008, 10:34
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 36,034
Thanks: 826
Thanked 5,382 Times in 4,229 Posts
Default

Thanks for reporting this. I added it to the bugtracker.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
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
Webmail problems with only one domain? compner Installation/Configuration 14 16th February 2010 16:59
slow download through webserver problem snewp Technical 14 9th May 2008 05:25
dovecot problem sojic Server Operation 21 23rd March 2008 18:22
No ftp login for ispconfig-webuser agri Installation/Configuration 12 19th March 2007 10:06


All times are GMT +2. The time now is 23:54.


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