Weird sender in emails (squirrelmail)

Invader Zim

Verified User
Joined
Sep 4, 2004
Messages
177
We've got a bunch of servers, all are hunky-dory. Except for 1. When someone sends an email, the sender is listed as

$domain, strpos($domain, ) + 1 <USERNAME@substr>

Where USERNAME is the hostingaccount's username. This happens with real users (admin) and with virtual ones.

I copied an installation from a server that worked fine over to the server that did not. The problem remains. Weird thing is, it kind of resembles line 30 in config/config.php, but replacing all the squirrelmail files with those from another server where it works fine does not yield sought result.
 
Hello,

Looking at custombuild, I can see this code in the doSquirrelmail() function:
Code:
/usr/bin/perl -pi -e "s/\'example.com\';/\\$\_SERVER\[\'HTTP_HOST\'\];\nwhile \(sizeof\(explode\(\'\.\', \\$\domain\)\) \> 2) {\n\t\\$\domain = substr(\\$\domain, strpos\(\\$\domain, \'\.\'\) \+ 1\);\n\}/" ${CONFIG}
which might be playing a role.

Check the config.php:
/var/www/html/squirrelmail/config/config.php

I'm seeing this code, which might be incorrect:
Code:
$domain                 = 'substr($domain, strpos($domain, '.') + 1)';
I believe it should be:
Code:
$domain                 = substr($domain, strpos($domain, '.') + 1);
meaning there are an extra set of 'quotes' that don't belong there.

John
 
Looking at it more, try moving your config.php to config.php.moved, and re-install squirrelmail with CB, eg:
Code:
cd /var/www/html/squirrelmail/config
mv config.php config.php.moved
cd /usr/local/directadmin/custombuild
./build squirrelmail
it updated the $domain variable to a totally different value, which is likely what's needed.
Code:
$domain = $_SERVER['HTTP_HOST'];while (sizeof(explode('.', $domain)) > 2) {
        $domain = substr($domain, strpos($domain, '.') + 1);
}
John
 
Removing the '-s around did the trick, which I find kind of odd, since it works fine on the other servers like this. At least it works so my customers are happy. :)
 
Back
Top