Hello,

I wrote a similar patch a few weeks ago (see attached file).  The main benefit with my implementation is if you're servicing multiple domains, it will generate a pull down box for you with the domains for the user to choose.

Regards,
Stephen


On 11/25/05, Wojtek <subs@donkoyote.net> wrote:
Hi

There was a question on that list a while ago, about how to login
without all this @domain.foo stuff. I'm puting this patch once again,
becouse of  some problems with implementation by some of you. I don't
say that it's the most secure version of resolving this little
inconvenience, but you can try it and judge yourself.

How it works?

Just apply patches, and make one change to main.inc.php file:

- variable $rcmail_config['pass_domain_name'] should be set with your
webmails prefix ended with .




regards
--
Wojtek



--- index.php   Fri Nov 25 17:48:10 2005
+++ index.php   Fri Nov 25 17:48:18 2005
@@ -116,13 +116,18 @@
if ($_action=='login' && $_task=='mail')
   {
   $host = $_POST['_host'] ? $_POST['_host'] : $CONFIG['default_host'];
+
+  if (eregi("@", $_POST['_user']))
+   $userdn = $_POST['_user'];
+   else
+   $userdn = $_POST['_user'] . '@' . '' . str_replace($CONFIG['bypass_domain_name'], "", $_SERVER['HTTP_HOST']);

   // check if client supports cookies
   if (empty($_COOKIE))
     {
     show_message("cookiesdisabled", 'warning');
     }
-  else if (isset($_POST['_user']) && isset($_POST['_pass']) && rcmail_login($_POST['_user'], $_POST['_pass'], $host))
+  else if (isset($_POST['_user']) && isset($_POST['_pass']) && rcmail_login($userdn, $_POST['_pass'], $host))
     {
     // send redirect
     header("Location: $COMM_PATH");



--- config/main.inc.php         Fri Nov 25 17:47:54 2005
+++ config/main.inc.php         Fri Nov 25 17:56:34 2005
@@ -27,6 +27,11 @@
// set to false if only registered users can use this service
$rcmail_config['auto_create_user'] = TRUE;

+// removes prefix of domain name that is used before webmail server
+// for example, for http://mail.domain.foo/ type 'mail.'
+// this allows you as an option to log without typing @domain.foo
+$rcmail_config['bypass_domain_name'] = '';
+
// the mail host chosen to perform the log-in
// leave blank to show a textbox at login, give a list of hosts
// to display a pulldown menu or set one host as string.