SquirrelMail Login Without Domain

April 29, 2011 | PHP | ,

squirrelmailI was figuring out how to login to SquirrelMail without typing domain.

I got information that I could use a plugin named Vlogin and I also need to install Compatibility plugin in order to make Vlogin working.

After some minutes enabling both plugins, I still dunno how to login without typing my domain name in Squirrelmail. I did some RTFMs but still lost in the jungle. Yes I’m a lazy man, so I decided to do a little hack on Squirrelmail source code.

The only file I need to edit is redirect.php, located in src directory. I inserted following lines of code on line 57:

< ?php
if(!eregi('@',$login_username)){
      $login_username = $login_username.'@sandalian.com';
}
?>

Here’s the screenshoot of file src/redirect.php:
squirrelmail hack

And it’s working! And login with complete username (username@domain.com) is still possible.

If you try this method, please remember that this quick hack has some limitations:

  • It won’t work on SquirrelMail with multi-domain/subdomain installation.
  • Function ereg()/eregi() is deprecated! Use preg_match() instead.

Last but not least, use this hack at your own risk.

1 comment