Roudcube email FROM is always USER@localhost

ximian

Verified User
Joined
May 10, 2009
Messages
5
Hi all

I am a reseller and i have created a user 'OEC' with domain OEC.domain.tld.
I can access OEC.domain.tld and everything seems fine.

The problem is that, when the user wants to send a file, he goes to OEC.domain.tld/roundcube, enters roundcube, select compose email, but the FROM head is automatically defined as OEC@localhost.
My server is not 'localhost'!

Why roundcube defines the user account as OEC@localhost in roundcube if it's declared as 'oec' user with '[email protected]' in reseller users list?!

How can i fix this so that all future user accounts have the correct FROM email in roundcube? Where is rouncube searching for 'localhost' domain?

Thanks for your time
Francisco A
 
I've noticed this too.
It's annoying.

It's not right for all clients to have to set their settings first.
They should be emailing right out of the box.
 
@davewy
We are not talking about identities customization. I know users can create their own identities.
The problem is that the default identity is not correctly created because roundcube cannot see the user domain and always set it as 'localhost'. so, if you create a user (eg: john) and that user belongs to a new domain (eg: yourserver.com), roundcube incorrectly creates the john@localhost user identity, instead of the correct one [email protected].

@Duboux
I found a workaround for this, but note that:
1- only works for new user account creations (it does not affect already created user accounts).
2- users must enter webmail by their webmail address. i know this sounds strage but.. as you know, any user can access their email but any roundcube of any domain on same server. roundcube is the same instalation the only diference is the user. So, if you domain is test.com and xpto.com is a domain of that server, a user can access webmail by test.com/roundcube or by xpto.com/roundcube as long has it uses its username and password. This workaround will 'read' the url host and apply that on the identity. So the user should always access its email account by the read domain.

just edit the roundcube config
Code:
-bash-3.1# nano /var/www/html/roundcubemail-0.2.1/config/main.inc.php
... and hardcode the domain as a php variable
Code:
// replace $rcmail_config['mail_domain'] = '';   with:
$rcmail_config['mail_domain'] = preg_replace("/^www\./i", "", $_SERVER['HTTP_HOST']);

btw, maybe roundcube and directadmin experts could take a look to this BUG.

best regards
Francisco A
 
Hello,

Thanks, that does sound reasonable. I googled this roundcube config option, and found this, which basically says the exact same thing:
http://www.roundcubeforum.net/roundcube-discussion/1202-auto-mail_domain-when-adding-new-users.html

I remember this bit of code was added to do something similar to squirrelmail in the config.php (Added via per regex in squirrelmail.sh):
Code:
$domain = $_SERVER['HTTP_HOST'];
while (sizeof(explode('.', $domain)) > 2) {
        $domain = substr($domain, strpos($domain, '.') + 1);
}
Which is basically the same idea.

Both of these assume the user is accessing the webmail clients using their own domain name.. which isn't always a great assumption, but it's better than nothing.

In any case, we'll test out the change that ximian recommended. If anyone else wants to also give it a try, once we get a few "works ok" reports, we can add it in.

Thanks!

John
 
Both of these assume the user is accessing the webmail clients using their own domain name.. which isn't always a great assumption, but it's better than nothing.
We never login using our domain name; we always log in our servername so we can do a secure login without needing a separate IP# for each domain.

But that's just us, and we don't use our login names for outgoing email.

Jeff
 
Hi, but tell me why when I login to roundcube using DA user, e-mails are send as user@localhost? How to change it to user@use-main-domain?
 
Under RoundCube settings you can set the outgoing email address for the default identity and for any additional identities you create.

Jeff
 
Back
Top