Roundcube default user domain issue, once more

zmippie

Verified User
Joined
Apr 19, 2015
Messages
161
I know there's been a lot of talk about the fact that Roundcube doesn't append the correct domain to a new DA username (not an e-mail account), thus by default getting "@localhost" appended to his/her email address right after the first login into Roundcube. Apparantly, Roundcube has no way to figure this domain name out on its own (although Squirrelmail seems to be able to do it). Most notably, in this thread:

http://forum.directadmin.com/showthread.php?t=30873&p=156791#post156791

...John (five years ago!) acknowledges the problem and ends his post with:

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.

That was 2009, but AFAIK the problem is still there in 2015. Apparantly though, the Roundcube team has a "plugin" solution, but it needs to be implemented:

http://trac.roundcube.net/wiki/Howto_Config#Advancedconfigurations

I can't be too difficult for a DA-whiz to whip up a file somewhere that lists the usernames + initial (!) domains for all users on the server, which then gets fed into Roundcube's $config['virtuser_file'] configuration.

Testing is if things work is outlined in the Roundcube doc:

In order to test if virtuser is configured correctly, log in to roundcube with a user that does not exist yet. Compose a message, if you see the From address as user@correct_domain, then it worked. If you see user@localhost, something is wrong.

Of course, I could be totally wrong, and the dreaded "@localhost" problem was solved already. But I doubt it. I see it happen here on a completely fresh install and I've checked a few commercial hosting companies which deploy DA and I see the same problem there. The internets are scattered with questions about how to solve this, but I found no real answer (the standard answer is: "let your user change his/her identity once logged into Roundcube", but that's not very elegant, is it?).

Oh, and Roundcube's $config['mail_domain'] will *not* solve this problem for a new DA user account. Even is some of the options for this feature would add a valid domain, it would not be very foolproof (some options rely on the domain on which Roundcube runs, which isn't neccessarily the domain of the user in question).

Edit: another thing I noticed when testing, is that when you delete a DA user, the user/identities in the Roundcube database aren't discarded. It might be a good idea to wire this together some way.
 
Last edited:
Hello,

I guess your thread is not really reseller-level limited, so I've moved it to "Feedback & Feature Requests" subforum.
 
I just tested this and the From field was my actual email (using managesieve plugin btw, not sure if this makes a difference). Where does the localhost appear for you?

Tried 2 different domains, both sent from correct domains.
 
Last edited:
@Peter,

I guess the user zmippie was referring to system accounts (i.e. not virtual email accounts which you can create on a domain).
Here are steps on how to reproduce it:

1. Create a new account in Directadmin as reseller, let's say it will be userbob
2. Login into roundcube with userbob's actual password
3. You will see userbob@localhost as a from address when composing a new letter.

Of course you can go onto a preferences page in Roundcube and change your "from address", but still this will be required for every system account on your server.
 
I try to persuade my clients not to use the main account for various things, thus I assumed the OP was using this set up too.

I have to stop assuming!!
 
I guess your thread is not really reseller-level limited, so I've moved it to "Feedback & Feature Requests" subforum.

Thanks Alex. I noticed that a previous discussion on this topic was in the "Admin Level difficulties" forum, so I posted it there, although I didn't find it a particularly good fit.

I guess the user zmippie was referring to system accounts

Correct. Your explanation to Peter Laws is spot on. Although I agree with Peter Laws that it's a bad idea to use the main (system) account as an e-mail account, but it happens, and the Roundcube "@localhost" thing is making things more problematic than it should.

Alex, you write DA plugins so you have a good understanding of the inner workings of the DA system. Do you think it would be difficult to aggregrate a file somewhere with (system) account names and their primary domain name, as is required by Roundcube?
 
Alex, you write DA plugins so you have a good understanding of the inner workings of the DA system. Do you think it would be difficult to aggregrate a file somewhere with (system) account names and their primary domain name, as is required by Roundcube?

If you really need it there is always a chance to use POST scripts: user_create_post_confirmed.sh or user_create_post.sh. So that to update/add identities into MySQL DB da_roundcube.
 
If you really need it there is always a chance to use POST scripts: user_create_post_confirmed.sh or user_create_post.sh. So that to update/add identities into MySQL DB da_roundcube.

Thanks for the pointer Alex. I'm going to look into that.
 
Back
Top