Disable "Webmail Home" icon in webmail toolbar

swbrains

Well-Known Member
Sep 13, 2006
217
28
178
Hi,

In the cPanel 84.0.19 webmail interface, I want to disable/hide the "Webmail Home" ("CP") icon/link in the upper-right corner of the webmail UI for all accounts/users. How can I do this?

In a related question, I can disable Forwarders in the webmail UI if I disable it in the Feature Manager, but then it's also not available to my scripts that call the API for forwarder functions. Is it possible to have forwarding available on the account but not accessible in webmail (i.e. just hidden/disabled for webmail only)? I have a UI for managing forwarders that I present to my users. I don't want them to change anything by circumventing it by modifying forwarders through webmail.

I guess if I can disable or hide the Webmail Home (CP) icon on the toolbar, question #2 is a moot point as it seems you need to use that icon/link to get to the Forwarder setup in webmail. Help with either question is appreciated.

Thanks!
 
Last edited:

swbrains

Well-Known Member
Sep 13, 2006
217
28
178
I found my answer on the web. I'm updating here with what I found so it will be available to others who search the same question. With regard to customizing the Roundcube user interface:

To remove the cPanel icon/link from the webmail header toolbar that allows returning back to the webmail home page:
FOLDER: /usr/local/cpanel/base/3rdparty/roundcube/config
FILE: config.inc.php
CHANGE LINE: $config['plugins'] = array('cpanellogin','cpanellogout','archive','calendar');
MODIFICATION: remove "return_to_webmail" plugin from list

To modify the logo
FOLDER: /usr/local/cpanel/base/3rdparty/roundcube/config
FILE: config.inc.php
CHANGE LINE: $config['skin_logo'] = "[relative path to your_logo_image.png]";
 

swbrains

Well-Known Member
Sep 13, 2006
217
28
178
Ok, so while the above changes work in Roundcube, there's still an issue with the first-time webmail login taking the user to the cPanel webmail home page. I'd like webmail login to take the user directly to Roundcube after successful login, but I can't figure out how to do that. There appears to be a "goto_uri" variable being passed around as the location to direct to after login but I can't see where to set it to a default value that somehow points to the Roundcube app.
 
  • Like
Reactions: Arvy

Arvy

Well-Known Member
Oct 3, 2006
139
10
168
Brazil
cPanel Access Level
Root Administrator
Twitter
Ok, so while the above changes work in Roundcube, there's still an issue with the first-time webmail login taking the user to the cPanel webmail home page. I'd like webmail login to take the user directly to Roundcube after successful login, but I can't figure out how to do that. There appears to be a "goto_uri" variable being passed around as the location to direct to after login but I can't see where to set it to a default value that somehow points to the Roundcube app.
Looking for a way to do this too. And disable Plus Addressing.
I need to create 271 accounts (using /scripts/addpop in a script), but I need users go directly to Roundcube to avoid support tickets flood (migrating from Sentora).
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,296
1,271
313
Houston
Hi @swbrains

That method will work and I'm glad you found the solution you were looking for, for the most part, but may I ask why you wanted it removed?

You can also remove horde if you don't use it by going to WHM>>Server Configuration>>Tweak Settings -> Enable Horde Webmail

This thread discusses setting the default : skip "choose a default webmail application" screen - log directly into webmail

as well as this one: Choose a Default Webmail Application

This one discusses setting it for all users: Mass Update Default Webmail

There was a feature request for this completed here: https://features.cpanel.net/topic/default-webmail-without-prompt - though it only completes it from the user standpoint, not for the provider wanting to eliminate the choice from the beginning
 

swbrains

Well-Known Member
Sep 13, 2006
217
28
178
Hi,

The reason I want it removed is our websites provide our own user interface to create forwarders, and we don't want our customers using forwarders from the cPanel interface for POP accounts. I tried disabling the Forwarding Manager in the account package, but it also disabled forwarders from being used via our scripts, which we need in order to provide our own user interface for managing them. We really just need them disabled or hidden from the POP account webmail page. Hiding the entire cPanel "home" page for webmail is actually perfect for us -- we just want them to see the webmail client (Roundcube) after login.

I had previously disabled Horde, so only Roundcube shows on the cPanel webmail home page. But it still shows that page which allows the user access the other function(s).

I will check out the thread you linked to about creating/modifying that special file that configures a default webmail app for each POP account. That may work for us as we already use a custom script to create POP accounts from our own user interface.

Thanks!

UPDATE: Created the '_default_webmail_app' file in my script when adding/updating a POP account and it works great... defaults right into roundcube now upon login. Thanks again!
 
Last edited:
  • Like
Reactions: cPanelLauren

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,296
1,271
313
Houston
Hey @swbrains

Also, if you don't want your users to be able to create forwarders, you can disable that feature from their package's feature list as well. These can be managed from WHM>>Packages>>Feature Manager -> Edit Feature List -> Forwarder Manager.
 

swbrains

Well-Known Member
Sep 13, 2006
217
28
178
I tried disabling the Forwarding Manager in the account package, but it also disabled forwarders from being used via our scripts, which we need in order to provide our own user interface for managing them.
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,296
1,271
313
Houston
I tried disabling the Forwarding Manager in the account package, but it also disabled forwarders from being used via our scripts, which we need in order to provide our own user interface for managing them.
I don't believe it inhibits the function of forwarders as a whole but it would prevent that user from adding them, which if you're using a script such as the one you're noting it would cause an issue.
 

swbrains

Well-Known Member
Sep 13, 2006
217
28
178
One of the links above references using the NVData API which I would like to use rather than create files manually in case their location changes in future versions. However, the thread linked above provides an example using the NVData API which is now reported in the documentation as depricated. It refers to the Personalization API instead. However, I can't figure out how to set up the "personalization" parameter hash so it refers to the POP account (filename) and the data (roundcube) that I want to set. I understand how to create a hash in Perl, I'm just not sure how to implement the personalization API hash parameters in such a case where I want to set the default webmail app. Can you provide some clarity with regard to this usage? Thanks!
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,296
1,271
313
Houston
Hi @swbrains

I feel like this is unnecessarily complicated in that documentation. To set the default webmail app the personalization function should look like the following:

Code:
echo '{"personalization":{"[email protected]_default_webmail_app":"roundcube"}}' | uapi --user=lauren --input=json --output=json Personalization set
I tested this on my own account by creating [email protected], confirming that the default_webmail_app file didn't exist (to ensure it will automatically create it when it doesn't), and running the personalization::set function as follows:

Code:
[[email protected] nvdata]# echo '{"personalization":{"[email protected]_default_webmail_app":"roundcube"}}' | uapi --user=lauren --input=json --output=json Personalization set
[2020-01-21 15:47:45 -0600] info [uapi] ---debug_hooks---
[2020-01-21 15:47:45 -0600] info [uapi]             msg: No hooks found for 'pre' stage of context
[2020-01-21 15:47:45 -0600] info [uapi]         context: Cpanel::UAPI::Personalization::set
[2020-01-21 15:47:45 -0600] info [uapi]           stage: pre
[2020-01-21 15:47:45 -0600] info [uapi]          result: 0
[2020-01-21 15:47:45 -0600] info [uapi]            data: []
[2020-01-21 15:47:45 -0600] info [uapi] ---debug_hooks---
[2020-01-21 15:47:45 -0600] info [uapi]             msg: No hooks found for 'post' stage of context
[2020-01-21 15:47:45 -0600] info [uapi]         context: Cpanel::UAPI::Personalization::set
[2020-01-21 15:47:45 -0600] info [uapi]           stage: post
[2020-01-21 15:47:45 -0600] info [uapi]          result: 0
[2020-01-21 15:47:45 -0600] info [uapi]            data: []
{"apiversion":3,"module":"Personalization","func":"set","result":{"metadata":{},"messages":null,"data":{"personalization":{"[email protected]_default_webmail_app":{"reason":"OK","success":1,"value":"roundcube"}}},"errors":null,"status":1,"warnings":null}}[[email protected] nvdata]# ls -lah
total 92K
I confirmed it created the file and added roundcube to it:

Code:
[[email protected] nvdata]# stat test\@mydomain.us_default_webmail_app
  File: ‘[email protected]_default_webmail_app’
  Size: 9             Blocks: 8          IO Block: 4096   regular file
Device: fd01h/64769d    Inode: 2360515     Links: 1
Access: (0644/-rw-r--r--)  Uid: ( 1000/  lauren)   Gid: ( 1002/  lauren)
Access: 2020-01-21 15:47:45.725510506 -0600
Modify: 2020-01-21 15:47:45.725510506 -0600
Change: 2020-01-21 15:47:45.725510506 -0600
 Birth: -
Code:
[[email protected] nvdata]# cat test\@mydomain.us_default_webmail_app
roundcube

I hope this helps.
 

swbrains

Well-Known Member
Sep 13, 2006
217
28
178
Follow-up to this thread with regard to removing the "Webmail Home" icon from the webmail toolbar:

I was successful doing this earlier by removing the "return_to_webmail" plugin from the list in the file "config.inc.php", but it appears perhaps a Roundcube update may have occurred that overwrote my change since the "Webmail Home" icon has returned to the webmail page. I was able to remove it again following the same steps I used earlier, but I'm wondering if there's a way to make this type of configuration change such that it would persist through Roundcube updates.