SOLVED Configure two vhosts with different Horde preferences?

timesurfer

Well-Known Member
Apr 16, 2019
60
13
8
Portugal
cPanel Access Level
Root Administrator
Hi,

I have a VPS with Centos 7 64 bit, cPanel, WHM and root access.

I have two email domains on this server:
- domain1.com
- domain2.com

I need to set some default preferences for domain2.com, so I created the prefs.local.php files inside the config directory of Horde, Imp, Turba, etc:
- /usr/local/cpanel/base/horde/config/
- /usr/local/cpanel/base/horde/imp/config
- /usr/local/cpanel/base/horde/kronolith/config
- /usr/local/cpanel/base/horde/trean/config
- /usr/local/cpanel/base/horde/turba/config

And I have put inside them the snippets of code with the changes and it works well.

However, those changes affect also domain1.com.

So, I googled and found out that I should domain prefferences, and I must not use:
- prefs.local.php
But instead, I must use:
- prefs-domain1.com.php
- prefs-domain2.com.php

Also I must edit:
- /usr/local/cpanel/base/horde/config/conf.php
And change:
$conf['vhosts'] = false;
to:
$conf['vhosts'] = true;
And afterwards restart Apache:
systemctl restart httpd.service

However, this is not working in neither one of the domains.

What am I missing or doing wrong?
Can anybody tell me is the correct way of making this work?
 

timesurfer

Well-Known Member
Apr 16, 2019
60
13
8
Portugal
cPanel Access Level
Root Administrator
After many hours, I've reached a solution, which is to login using a cPanel Horde bridge:

as posted here:

and here:


The reason it didn't work was because my WHM/cPanel server hostname domain is not the same to the email domain I was using to login.

Imagine this example:
A VPS with WHM/cPanel and a server hostname domain url like this:
domain3.com

email domains hosted in this VPS:
domain1.com
domain2.com
etc

URL usually used to access webmail from this domains to login to Horde (or Roundcube):


example of emails from domain1.com:
[email protected]
[email protected]


example of emails from domain2.com:
[email protected]
[email protected]


When:
[email protected]
[email protected]
and
[email protected]
[email protected]

log into Horde using this domain:

the customized settings inside files:
- prefs-domain1.com.php
- prefs-domain2.com.php
won't work.
But instead, the default ones set in prefs.php (or the global ones set in prefs.local.php) will be presented to all this email users.

In order to
[email protected]
[email protected]
log into Horde and have the customized settings inside file:
- prefs-domain1.com.php
they have to use the url:

and
[email protected]
[email protected]
log into Horde and have the customized settings inside file:
- prefs-domain2.com.php
they have to use the url:

That's when the cPanel Horde bridge mentioned at the beginning of this post is useful

I hope this helps someone.
 

timesurfer

Well-Known Member
Apr 16, 2019
60
13
8
Portugal
cPanel Access Level
Root Administrator
One curious thing I have noticed is this:
- the first time I log in (after restarting the browser) using the cPanel Horde bridge, the cPanel webmail top menu is missing
see image 1

- I have to log out, and then log in again (without closing the browser), in order to see it
see image 2

This is relevante because this menu has important links
see image 3

I think cPanel team should take a look at this, because it may confuse some webmail users

20191009-004354.jpg

20191009-004403.jpg

20191009-013547.jpg
 

timesurfer

Well-Known Member
Apr 16, 2019
60
13
8
Portugal
cPanel Access Level
Root Administrator
Just to add the following:
- webmail.domain.tld is already configured by default to work as a bridge in cpanel

So, just create the file:
prefs-webmail.domain.tld.php
and put the desired preferences inside it and it works
 

timesurfer

Well-Known Member
Apr 16, 2019
60
13
8
Portugal
cPanel Access Level
Root Administrator
One curious thing I have noticed is this:
- the first time I log in (after restarting the browser) using the cPanel Horde bridge, the cPanel webmail top menu is missing
see image 1

- I have to log out, and then log in again (without closing the browser), in order to see it
see image 2

This is relevante because this menu has important links
see image 3

I think cPanel team should take a look at this, because it may confuse some webmail users

View attachment 61453

View attachment 61457

View attachment 61461
I've seen this was now fixed. The webmail top menu was replaced by a new link directly in the Horde menu named:
"cPanel Webmail Home"

This is good because:
- is solves the stated issue
- and because the removal of the webmail top menu now gives more free vertical space in the computer monitor.

However, it has one bad thing:
- before, we could see the user just looking at in the right upper corner
- now, we can't see it
- I think this could easily be solved just by adding the user information again

This user information is very useful for people that use cpanel horde webmail for checking email on multiple domains and sometimes multiple users in the same email domain, like I do.
A quick glance ate the top upper left corner immediately enables us to see the currently logged in user and may prevent mistakes.
If this could be done, it would be nice.



20191116-072616.jpg

20191116-072656.jpg

20191116-073053.jpg
 
Last edited: