Remove options shown in webmail page after login ?

tfcservices

Member
May 22, 2003
23
0
151
Alabama
When somone logs in to webmail , after login they are shown a page with the Horde icon and some options under it. The options shown on that page are listed as follows;

[Change Password] [Forwarding Options] [Autoresponder Options] [Aging] [Logout]

Can someone tell me if there is anyway to remove any or all of these options server wide?

I would greatly appreciate it.

Thanks
Darryl
 

tfcservices

Member
May 22, 2003
23
0
151
Alabama
I actually figured this out. You modify the following file:

/usr/local/cpanel/base/webmaillogin.cgi

by removing the following lines:

if ($webmail->{envuser} =~ /\@/) {
print qq{[<a href="$webmail->{urlbase}/webmailpasswd.cgi">Change Password</a>]\n};
if ($Cpanel::CPDATA{'FEATURE-FORWARDERS'} ne 0) {
print qq{[<a href="$webmail->{urlbase}/webmailforward.cgi">Forwarding Options</a>]\n};
}
print qq{[<a href="$webmail->{urlbase}/webmailautorespond.cgi">Autoresponder Options</a>]\n};
}


if (! $Cpanel::CONF{'skipboxtrapper'} && $Cpanel::CPDATA{'FEATURE-BOXTRAPPER'} ne '0') {
print qq{[<a href="$webmail->{urlbase}/webmailboxtrapper.cgi">BoxTrapper</a>]\n};
}

if (-e 'webmailaging.cgi') {
print qq{[<a href="$webmail->{urlbase}/webmailaging.cgi">Aging</a>]\n};
}


This will remove the "Change Password", "Autoresponder", "Boxtrapper", and "Aging" Options but leave the "logout" options.

Hope this helps someone.
 

freedman

Well-Known Member
Feb 13, 2005
314
5
168
I actually figured this out. You modify the following file:

/usr/local/cpanel/base/webmaillogin.cgi .
This file will likely get overwritten whenever /scripts/upcp is run.
you may wish to create a /scripts/postupcp to copy back your version.
you may also want to periodically check the cpanel version to see if they made any changes which you'd have to re-incorporate into your version.
 

tfcservices

Member
May 22, 2003
23
0
151
Alabama
Thank you.

I will keep that in mind. I have been trying to figure this out for awhile. I just don't want my customers to be able to add forwarders, responders etc... when they check webmail. I do not give my clients access to Cpanel.

How would I create the script to automatically put back my version? or how do I make it permanent?

Thanks for responding.

Darryl
 

freedman

Well-Known Member
Feb 13, 2005
314
5
168
Thank you.

I will keep that in mind. I have been trying to figure this out for awhile. I just don't want my customers to be able to add forwarders, responders etc... when they check webmail. I do not give my clients access to Cpanel.

How would I create the script to automatically put back my version? or how do I make it permanent?

Thanks for responding.

Darryl
here's one option:
http://www.cyberciti.biz/faq/how-to...ble-unalterable-so-that-no-one-can-modify-it/

the other is to keep your version and a copy of cpanels version in a separate folder. in upcp, look for if the file's Mod time is newer than your original version (or you can do a diff on them, or whatever).. if so, copy the one cpanel stuck there to your cpanel saved version, and copy your modified version back.
in this case, you can do a diff on the new cpanel version and the saved cpanel version before you copy it, --if they're different, send yourself an email so you can look manually and see if you need to re-incorporate any of the cpanel changes into your version.

the chattr approach is less work, but I'm guessing theres a high liklihood the file will change as cpanel 11 rolls out, so you'll have to do more work to fix it later.
 

tfcservices

Member
May 22, 2003
23
0
151
Alabama
Well, it looks like the new upgrade (CP 11) messed me up. This file no longer contains the same data to edit.

Does anyone know what file I need to edit now to disable these features?

Thanks for any help.

Darryl
 

rafaelmussi

Registered
Jul 24, 2006
2
0
151
Brazil
Well, it looks like the new upgrade (CP 11) messed me up. This file no longer contains the same data to edit.

Does anyone know what file I need to edit now to disable these features?

Thanks for any help.

Darryl
You can edit the webmail login page for X3 theme at /usr/local/cpanel/base/webmail/x3/index.html

I mixed some old webmaillogin.cgi codes with the index.html and it works fine!

Hope this can help you!

Att.,

--
Rafael Mussi @ Brazil
 

freedman

Well-Known Member
Feb 13, 2005
314
5
168
Thank you.. worked great. I just have to keep editing it each time cpanel is upgraded.... but it works great.

Thanks,
DF
you have several options.

one is to use 'chmod +i " on the file (I think it's T.. can't remember off the top of my head)...but that will prevent the file from being over-written.

The other, and better, option, is to write a little script and call it from /scripts/postupcp
this script should do one of 2 things.
Either, copy your modified file over to the right place,
OR, even better, keep a copy of cpanels version and yours, do a diff on the file against yours, if it differs, do a diff on the file against the cpanel version, if it's the same, then copy your file, if it's different, email you the diffs so you can look and incorporate the new cpanel changes manually.
 
Last edited:

rafaelmussi

Registered
Jul 24, 2006
2
0
151
Brazil
Thank you.. worked great. I just have to keep editing it each time cpanel is upgraded.... but it works great.

Thanks,
DF
You can set the index.html immutable, then the upgrades won't affect it.
To do so, run this:
chattr +i /usr/local/cpanel/base/webmail/x3/index.html

Once, if you want to unset the immutable flag, just run the following command:
chattr -i /usr/local/cpanel/base/webmail/x3/index.html

I did it with webmaillogin.cgi and the upgrades from version 10 didn't affected the file.

Att.,

--
Rafael Mussi @ Brazil