IMP is PHP3.. SquirrelMail PHP4.
There is a beta version of IMP in PHP4 but I went with SquirrelMail and did 
some simple modifying to meet my needs. 
   
The main part of it is this

    $pos = strpos( $HTTP_HOST, '.' );
    $host = substr( $HTTP_HOST, $pos + 1 );

    $username .= "@" . $host;

Here are the two files I modified to make this work correctly.
Just install SquirrelMail and replace these two files
Then users can login to  webmail.virtualdomain.com and only use their 
popname and password to login. No more user%virtualdomain.com
There are a few other modifications to be made but you should get the idea 
from these to files.Feel free to email me if you need help.

-rick

./webmail/src/webmail.php

<?php
   /**
    **  webmail.php
    **
    **  This simply creates the frames.
    **
    **/


    $pos = strpos( $HTTP_HOST, '.' );
    $host = substr( $HTTP_HOST, $pos + 1 );

    $username .= "@" . $host;


   session_start();

   if(!isset($username)) {
      echo _("You need a valid user and password to access this page!");
      exit;
   }

   setcookie("username", $username, 0, "/");
   setcookie("key", $key, 0, "/");
   setcookie("logged_in", 1, 0, "/");

   // Refresh the language cookie.
   if (isset($squirrelmail_language)) {
      setcookie("squirrelmail_language", $squirrelmail_language, time()
+2592000);
   }
?>
<HTML><HEAD>
<?php
   include ("../config/config.php");
   include ("../functions/prefs.php");
   include ("../functions/imap.php");

   // verify that username and password are correct
   $imapConnection = sqimap_login($username, $key, $imapServerAddress, 
$imapPort, 0);

   include ("../src/load_prefs.php");

   echo "<TITLE>";
   echo "$org_title";
   echo "</TITLE>";
   echo "<FRAMESET COLS=\"$left_size, *\" NORESIZE BORDER=0>";

/**
    There are three ways to call webmail.php
    1.  webmail.php
         - this just loads the default entry screen.
    2.  
webmail.php?right_frame=right_main.php&sort=X&startMessage=X&mailbox=XXXX
         - This loads the frames starting at the given values.
    3.  webmail.php?right_frame=folders.php
         - Loads the frames with the Folder options in the right frame.

    This was done to create a pure HTML way of refreshing the folder list 
since
    we would like to use as little Javascript as possible.
**/
   if ($right_frame == "right_main.php") {
      $urlMailbox = urlencode($mailbox);
      echo "<FRAME SRC=\"left_main.php\" NAME=\"left\">";
      echo "<FRAME SRC=\"right_main.php?mailbox=$urlMailbox&sort=
$sort&startMessage=$startMessage\" NA$
   } else if ($right_frame == "folders.php") {
      $urlMailbox = urlencode($mailbox);
      echo "<FRAME SRC=\"left_main.php\" NAME=\"left\">";
      echo "<FRAME SRC=\"folders.php\" NAME=\"right\">";
   } else {
      echo "<FRAME SRC=\"left_main.php\" NAME=\"left\">";
      echo "<FRAME SRC=\"right_main.php\" NAME=\"right\">";
   }
?>
</FRAMESET>
</HEAD></HTML>


_____________________________________________________________

./webmail/src/webmail.php

<?php
        /** SquirrelMail configuration
         ** Created using the configure script, conf.pl
         **/

        $pos = strpos( $HTTP_HOST, '.' );
        $host = substr( $HTTP_HOST, $pos + 1 );

        $org_name   = "$host";
        $org_logo   = "../images/$HTTP_HOST.png";
        $org_title  = "$host";

        $domain               = "";
        $imapServerAddress    = "localhost";
        $imapPort             =  143;
        $useSendmail          =  false;
        $smtpServerAddress    = "localhost";
        $smtpPort             =  25;
        $sendmailPath         = "/usr/sbin/sendmail";
        $imap_server_type     = "courier";

        $default_folder_prefix            = "";
        $trash_folder                     = "INBOX.Trash";
        $sent_folder                      = "INBOX.Sent";
        $default_move_to_trash            =  true;
        $default_move_to_sent             =  true;
        $show_prefix_option               =  false;
        $list_special_folders_first       =  true;
        $use_special_folder_color         =  true;
        $auto_expunge                     =  true;
        $default_sub_of_inbox             =  true;
        $show_contain_subfolders_option   =  false;

        $default_charset   = "iso-8859-1";
        $auto_forward      =  true;
        $data_dir          = "../data/";
        $attachment_dir    = "$data_dir";
        $default_left_size =  200;

        $theme[0]["PATH"] = "../config/default_theme.php";
        $theme[0]["NAME"] = "Default";
        $theme[1]["PATH"] = "../config/sandstorm_theme.php";
        $theme[1]["NAME"] = "Sand Storm";
        $theme[2]["PATH"] = "../config/deepocean_theme.php";
        $theme[2]["NAME"] = "Deep Ocean";
        $theme[3]["PATH"] = "../config/slashdot_theme.php";
        $theme[3]["NAME"] = "Slashdot";
        $theme[4]["PATH"] = "../config/purple_theme.php";
        $theme[4]["NAME"] = "Purple";
        $theme[5]["PATH"] = "../config/forest_theme.php";
        $theme[5]["NAME"] = "Forest";
        $theme[6]["PATH"] = "../config/ice_theme.php";
        $theme[6]["NAME"] = "Ice";
        $theme[7]["PATH"] = "../config/seaspray_theme.php";
        $theme[7]["NAME"] = "Sea Spray";
        $theme[8]["PATH"] = "../config/plain_blue_theme.php";
        $theme[8]["NAME"] = "Plain Blue";

        $default_use_javascript_addr_book = false;
        $ldap_server[0] = Array(
                        "host" => "memberdir.netscape.com",
                        "base" => "ou=member_directory,o=netcenter.com",
                        "name" => "Netcenter Member Directory");

        $ldap_server[1] = Array(
                        "host" => "ldap.bigfoot.com",
                        "base" => "",
                        "name" => "Bigfoot Directory",
                        "charset" => "iso8859-1");

        $motd = "";
?>





> 
> Rick,
> 
> I'd love to see it.  Also, any reason that you use SquirrelMail over IMP?
> 
> Thanks,
> 
> Bill
> 
> Rick Griffith writes:
> 
> > My solution to not having to use user%virtualdomain.com was to only 
offer 
> > web-based email. I use Squirrel-Mail which I have modified the php to 
> > determine how to login and which %virtualdomain to use based on the 
domain 
> > they typed to get there. So basically every user types 
> > webmail.virtualdomain.com and the php reads after the first dot, then 
when 
> > he types his user name and password and hits enter. the php calls back 
up 
> > the hostname and adds it to the user when it logs into the IMAP server. 
The 
> > was the solution I came up with.. For me most all my user are roaming 
and 
> > check mail from different machines. There are a few that I had to set 
up in 
> > Outlook.. But this a a solution if you want to go webbased. I can let 
you 
> > look at my modified code for Squirrel-Mail if you want..
> > 
> > -Rick
> > 
> > > i just think the administrator should have more control over pop 
> > usernames.
> > > if your email address was [EMAIL PROTECTED] with the current naming
> > > convention, your pop username would be brad%theinternet.com. but if 
you 
> > had
> > > control over the naming system you could shorten it to something 
> > like 'bfp'
> > > or 'bfp1' if 'bfp' is already taken. you tell me which is easier on 
the
> > > user. not to mention how many email clients would choke on the 
previous. 
> > why
> > > should i have to tell a client, "well, if you're using netscape 
messenger,
> > > use this delimiter, and if your using hotmail use this delimiter, and 
if
> > > your using outlook express version facafooey, use this delimiter."
> > > 
> > > 
> > > -----Original Message-----
> > > From: Chris Fankhauser [mailto:[EMAIL PROTECTED]]
> > > Sent: Friday, August 25, 2000 9:11 AM
> > > To: Mark Chesney
> > > Cc: vpopmail; qmailadmin
> > > Subject: Re: feature request
> > > 
> > > 
> > > I think that is even more obscure than the user%somedomain.com naming
> > > scheme.  Imagine how much trouble you'd have telling users "you 
receive
> > > email at [EMAIL PROTECTED], but when you login, use the pop account 
name
> > > 'bjs4$2.00'.."  What kind of problems are you having with the current
> > > naming scheme (besides that hotmail seems to hate it)?
> > > 
> > > ------------------------------
> > > Chris "CryptoMasta" Fankhauser
> > > Bitstream Underground
> > > 
> > > 
> > > 
> > > 
> > > 
> > > bomb internet anarchy weaver hacker pentagon china violent
> > > 
> > > On Fri, 25 Aug 2000, Mark Chesney wrote:
> > > 
> > > > currently, in order to avoid the %domain pop user naming scheme, 
the 
> > only
> > > > choice is ip aliasing, which requires an ip for each and every 
domain.
> > > > sometimes this is unrealistic or unachievable. why not create a 
system
> > > where
> > > > pop usernames can be unique, but not so clunky. there are many ways 
to 
> > do
> > > > this, but it should be left up to the administrator. i can think of
> > > several
> > > > examples:
> > > >
> > > > pop name  email address
> > > >
> > > > pop0001   [EMAIL PROTECTED]
> > > > pop0002   [EMAIL PROTECTED]
> > > > ...
> > > > pop9999   [EMAIL PROTECTED]
> > > >
> > > > or
> > > >
> > > > bgs       [EMAIL PROTECTED] (brad g. smith)
> > > > bgs1      [EMAIL PROTECTED]      (bert g. simeone)
> > > > bgs2      ...
> > > > jks       [EMAIL PROTECTED]  (jud k. smith)
> > > > jks1      ...
> > > > ...
> > > >
> > > > etc...
> > > >
> > > > most of these changes would have to take place in vpopmail but some 
> > would
> > > be
> > > > required in qmailadmin to remain compatible. here is how i see 
vpopmail
> > > > changing:
> > > >
> > > > vadduser accepts an extra argument, popname.
> > > > vadduser creates a symbolic link from 
domains/somedomain.com/realname to
> > > > users/popname or vice versa.
> > > > vadduser updates users/vpasswd and users/vpasswd.cdb.
> > > >
> > > > hopefully this could be intermingled with ip aliasing to allow some
> > > domains
> > > > to have realname equal to popname and some domains with unique 
popnames.
> > > > just a thought. feedback appreciated!
> > > >
> > > > mark
> > > >
> > > >
> > > 
> > > 
> > > 
> > 
> > 
> 
> 
> 
> 


Reply via email to