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 ([email protected]) 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

This post has one comment

  1. theregkid 19/02/2012 at 06:12

    OMG TYSM TYSM TYSM ive been trying to get this to work ALL DAY and i fixed it in less than 5 minutes with this. TY

 

Leave a comment

Allowed tags are: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>