## HOWTO: Log on SquirrelMail using only username (no domain)

Use this forum if you have installed hMailServer and want to ask a question related to a production release of hMailServer. Before posting, please read the troubleshooting guide. A large part of all reported issues are already described in detail here.
SiC_Goat
New user
Posts: 7
Joined: 2004-10-14 06:44

### HOWTO: Log on SquirrelMail using only username (no domain)

1) navigate to drive:\path\to\squirrelmail\src
2) Locate redirect.php
3) Open it with wordpad (dreamweaver if you've got it)
4) Do a find on

Code: Select all

/* Verify that username and password are correct. */
That should be over something that looks like this

Code: Select all

    if ($force_username_lowercase) {$login_username = strtolower($login_username); }  Below the } add this Code: Select all $at = array("@");
foreach ($at as$val) {
if (stristr(trim($login_username),$val)) {
$domains += 1; } } if($domains < 1){
}

This will check to see if the user had the @domain.net in his username, if he did it will do nothing, but if he didn't, it will add the @domain.net to the end of it before checking / loggin in.

I took the freedom to edit this post a bit and moving it to howto's / Martin

FAWTS
Normal user
Posts: 74
Joined: 2005-06-18 15:25
Location: Paris
Contact:
Another solution is using the login_alias plugin. That can help a lot if there is several domains and users feel happy to be able to change the login, use accents or special caracters...
Apache 1.3.33 PHP Version 4.4 hMailServer 4.1-B136 OS : Win XP SP2 AV : ClamAV 0.86.1

fsdfdg
there is a slight issue with this modification...

this turns up on the apache logs:

[client 128.195.95.163] PHP Notice: Undefined variable: domains in C:\\Program Files\\Apache Group\\Apache2\\htdocs\\mail\\src\\redirect.php on line 95, referer: http://www.nocloud.hopto.org/mail/src/login.php

a coding error perhaps?

martin
Developer
Posts: 6837
Joined: 2003-11-21 01:09
Location: Sweden
Contact:
You have notices turned on in php.ini (error_reporting). This isn't an error, just a notice from PHP that it uses an undefined variable.

cgountanis
Normal user
Posts: 105
Joined: 2005-07-01 00:54
Location: USA
why cant you read the domain in the url? for example http://www.someonedomain.com:8383 and use that for domain. i have all my customers use thier domain name since it points to same ip. same can be done for global headers mail.something.com always goes to SM. i dont know php well enought to do this but should be easy.

martin
Developer
Posts: 6837
Joined: 2003-11-21 01:09
Location: Sweden
Contact:
> why cant you read the domain in the url

Ask the developers of SquirrelMail. This isn't an official squirrelmail forum in any way. It contains howto's. I will delete this and your message in a few days since it hasn't got anything to do with the HOWTO...