Author Topic: Subdomain or WWW attached to sender address (QUICK FIX)  (Read 4872 times)

Offline caedmon

  • Newbie
  • *
  • Posts: 0
Subdomain or WWW attached to sender address (QUICK FIX)
« on: April 23, 2007, 12:43:08 PM »
RoundCube Version: 0.1 Beta 2

DESC: This quick fix applies to the sender address issue and only supports one domain name.

ISSUE: When clicking the reply button, the sender address domain contains either the subdomain or WWW in the domain name (EX: test.user@www.server.com when it should be test.user@server.com).

FIX:

1) Open the /roundcube/program/include/main.inc file.
2) Move to line #472 (approx.) where the following code is found:

 $sql_result = $DB->query("SELECT user_id, username, language, preferences
              FROM ".get_table_name('users')."
              WHERE mail_host=? AND (username=? OR alias=?)",
              "server.com",
              $user,
              $user);

...and modify the code. Change the $host variable and insert your domain name (like above).

3) Move to line #556 (approx.) where the following code is found:

 $DB->query("INSERT INTO ".get_table_name('users')."
       (created, last_login, username, mail_host, alias, language)
       VALUES (now(), now(), ?, ?, ?, ?)",
       $user,
       "server.com",
       $user_email,
       $_SESSION['user_lang']);

...and modify the code. Change the $host variable and insert your domain name (like above).

4) Update the 'users' table in the database. Modify the mail_host field to match your domain name, as well.

5) Upload your modified main.inc file to your server.

All should be well.

This is a quick fix until they correct the bug. Perhaps there's a better way to fix this, but I haven't found it.