Set roundcube as default email box and always open inbox even first login

Ramon Pego

Well-Known Member
Mar 12, 2019
62
11
8
Brazil
cPanel Access Level
Root Administrator
Twitter
Hello, one thing we have seen receiving some complaints from customers is when the email box is new it opens by default that "home page" where it displays some account configuration options including the option to choose the default email box as "Horde" or "Roundcube".
The problem is that our company is located in Brazil and our customers in the vast majority (due to work) do not speak English.
So they always ask for help in this step.
There is some way to skip this page and by default already come with Roundcube as a box and open it right in the inbox, since this screen is also accessible later if the customer wants to.
As set Roundcube to default,but i can't remove Horde, cause some users may use the, but if its the only option maybe it will be a valid choice
the "home page" I mention is this

1614601311731.png
 
Last edited by a moderator:

kodeslogic

Well-Known Member
PartnerNOC
Apr 26, 2020
454
218
118
IN
cPanel Access Level
Root Administrator
The manual workaround is to ask such client to checkmark "Open my inbox when I log in" option so from next time they won't get choose webmail client page.
 

Attachments

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
11,119
1,755
363
cPanel Access Level
Root Administrator
This setting is stored for each individual email address in the following file:

/home/username/.cpanel/nvdata/[email protected]_default_webmail_app

The file will either say just horde or roundcube to determine the default. Since this is set up for each email account, there isn't a global way to enable this. There is a custom script one of my coworkers created a while back that you may want to experiment with:


If the user checks the "Open my inbox when I log in" box, all future log ins will go directly to the default client and the webmail page, without the splash page loading. I don't have an automated way to do that work though, so I'd recommend submitting a feature request through the link in my signature.
 

Ramon Pego

Well-Known Member
Mar 12, 2019
62
11
8
Brazil
cPanel Access Level
Root Administrator
Twitter
This setting is stored for each individual email address in the following file:

/home/username/.cpanel/nvdata/[email protected]_default_webmail_app

The file will either say just horde or roundcube to determine the default. Since this is set up for each email account, there isn't a global way to enable this. There is a custom script one of my coworkers created a while back that you may want to experiment with:
I see, the possibility of placing the default email via API is wonderful thank you very much I will use it.

If the user checks the "Open my inbox when I log in" box, all future log ins will go directly to the default client and the webmail page, without the splash page loading. I don't have an automated way to do that work though, so I'd recommend submitting a feature request through the link in my signature.
Do you know what behavior happens when I choose "Open my inbox when I log in"?
Does this create any files with any value?
Knowing this, I can think of a way to automate this.


The manual workaround is to ask such client to checkmark "Open my inbox when I log in" option so from next time they won't get choose webmail client page.
We already tried that, but there are people who still ask for help as if they didn't know.
Just for being in English or something.
It is almost a habitude of some positions here in Brazil, people not interested in work hahaha
 

Ramon Pego

Well-Known Member
Mar 12, 2019
62
11
8
Brazil
cPanel Access Level
Root Administrator
Twitter
Hi just for update
Reading these topics helped me:


how we created an application that consumes your APIs
I just needed to make one more call on NVdata and it's okay, now if we create the email via CPANEL the step is still manual but we instruct you to avoid creating via CPanel and using our application.

However, reading the documentation says that it is depreciated.
And the new one, to tell you the truth i didn’t understand how it works
I don't know what that code would look like in the new function.
PHP:
$query = [
            'cpanel_jsonapi_user' => $parameters['username'],
            'cpanel_jsonapi_module' => 'NVData',
            'cpanel_jsonapi_func' => 'set',
            'cpanel_jsonapi_apiversion' => 3,
            'names' => $parameters['email_with_domain'].'_default_webmail_app',
            $parameters['email_with_domain'].'_default_webmail_app' => 'roundcube',
        ];
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
11,119
1,755
363
cPanel Access Level
Root Administrator
I did some testing with this and found you have to specify the full file name for the user. Here is an example using the username "cptest" and domain of "domain.com"

Code:
echo '{"personalization":{"[email protected]_default_webmail_app":"roundcube"}}' | uapi --user=cptest --input=json --output=json Personalization set
That will create the necessary file in the correct directory with the roundcube value in place so you don't get the splash screen when logging in. Can you try that?
 

Ramon Pego

Well-Known Member
Mar 12, 2019
62
11
8
Brazil
cPanel Access Level
Root Administrator
Twitter
thanksss
but I see here that it is not compatible with PHP, I will wait for the release of php, since we only use PHP for now, I will save this solution if I need it in the future

since we are here
I have another demand, I wanted to define when writing messages in the email the writer already comes as html by default as always

I saw in this topic something similar but it is with the horde, following a structure of folders I did not find with the roundcube

 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
11,119
1,755
363
cPanel Access Level
Root Administrator
That setting is even further down in the mail client configuration for each individual mail account. Can you let me know what specific change you're making in Roundcube to solve this? Once I know that, I may be able to find the file that gets written.
 

MotazHakim

Member
Oct 12, 2021
22
3
3
Egypt
cPanel Access Level
Root Administrator
That setting is even further down in the mail client configuration for each individual mail account. Can you let me know what specific change you're making in Roundcube to solve this? Once I know that, I may be able to find the file that gets written.
Hello @cPRex
I hope you help me on this matter too
I'm just moved to cPanel and created 100 Emails and i need your help creating that script file to loop in all email folders (if it possible) and set the option to directly open Roundcube inbox without seeing the Splash screen of webmail

i think @cPLevey did it on that tread

but i don't know how to run it

it will help us a lot if you helped me on creating this loop script
our account name is: super
default webmail is: Roundcube

Thanks
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
11,119
1,755
363
cPanel Access Level
Root Administrator
@MotazHakim - I'm wondering if you linked the wrong thread as I don't see that Levey posted in the thread you linked.

The API command I posted above does work to create the correct file to load Roundcube by default, but it would need to be formatted to loop through all the accounts on the system. We don't normally write custom code, but I put this together and confirmed it works on a test machine:

Code:
for i in `cat /etc/trueuserdomains | awk {'print $2'}` ; do echo '{"personalization":{"[email protected]_default_webmail_app":"roundcube"}}' | uapi --user=$i --input=json --output=json Personalization set ; done
 

MotazHakim

Member
Oct 12, 2021
22
3
3
Egypt
cPanel Access Level
Root Administrator
@MotazHakim - I'm wondering if you linked the wrong thread as I don't see that Levey posted in the thread you linked.

The API command I posted above does work to create the correct file to load Roundcube by default, but it would need to be formatted to loop through all the accounts on the system. We don't normally write custom code, but I put this together and confirmed it works on a test machine:

Code:
for i in `cat /etc/trueuserdomains | awk {'print $2'}` ; do echo '{"personalization":{"[email protected]_default_webmail_app":"roundcube"}}' | uapi --user=$i --input=json --output=json Personalization set ; done
Thanks for your reply @cPRex

I'm so sorry i've linked a wrong post
the right post is :
and i'm quoting his reply

Hello Patrick,

Our loop would need to gather a list of all email accounts for a cPanel account (Email::list_pops) and then set the desired default webmail app for each of those email accounts (NVData::set).

I threw together the following, which worked as expected in my testing environment.

Code:
cpanelaccount="forumuser";
webmailapp="roundcube";

for emailaccount in $(uapi --user=$cpanelaccount Email list_pops |grep email: |awk '{print $2}' |sed 's/@/%40/g'); do uapi --user="$cpanelaccount" NVData set names="$emailaccount"_default_webmail_app "$emailaccount"_default_webmail_app="$webmailapp"; done
You will need to replace "forumuser" with your desired cPanel account, and replace "roundcube" with your desired webmail app.

I hope this helps!
maybe you can help me with @cPLevey loop code, and tell me how to excute it, since i'm new to linux World and i don't know how to use this API code .

Thanks.