Howto: fix DWmail's username glitch

clubhost

Verified User
Joined
Oct 28, 2004
Messages
46
Location
Sydney, Australia
I have just installed DWmail on my server. My server has a Direct Admin Control panel and I'm sure anyone who has install DWmail on an Direct Admin Server would most likely been annoyed how DWmail changes the username that has been entered.

Direct Admin uses a short username without the domain as the main email account on each domain, but then additional email accounts on those domains require the full email address as the username. DWmail handles it one way or the other not both. I have developed a way around this.

The second issue. if you install a single copy of DWmail on your server that can be used by each domain IE www.domain.com/webmail DWmail prefers the use of Localhost as the default domain or for you to use advanced login to enter it each time. I've included here a way to dynamically set the default domain depending on the url you used.

edit dologin.php - Line 32 - under the "require" lines
ADD
// Direct Admin username fix - record entry
if (isset($_POST['u'])) {
$orige = $_POST['u'] ;
}

edit dologin.php - Line 265
change from
$_SESSION['sess_u'] = $u;
to
$_SESSION['sess_u'] = $orige;

edit includes/config.inc.php - Line 189
change
$DefaultDomain = 'localhost';
to
//// DIRECT ADMIN - DYNAMIC DOMAIN NAME
$sn = $_SERVER['SERVER_NAME'] ;
$snlen = strlen($sn) ;
$DefaultDomain = (substr($sn,0,3)=="www")? substr($sn,4,($snlen-4)):$sn ;
//$DefaultDomain = 'localhost';

edit includes/config.inc.php - approx line 447
set
$DWmailMode = 1;

I hope this helps

Regards
Brian.
 
Have you found a way to get the expand/collapse to work? I have found there support to be uninterested in helping. It's always, "we can't replicate the problem".
 
It is under the area where the folders are on the left of the screen.
 
Back
Top