The Community Forums

Interact with an entire community of cPanel & WHM users.
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Remove options shown in webmail page after login ?

Discussion in 'E-mail Discussions' started by tfcservices, May 1, 2007.

  1. tfcservices

    tfcservices Member

    Joined:
    May 22, 2003
    Messages:
    23
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    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
     
  2. tfcservices

    tfcservices Member

    Joined:
    May 22, 2003
    Messages:
    23
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    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.
     
  3. freedman

    freedman Well-Known Member

    Joined:
    Feb 13, 2005
    Messages:
    312
    Likes Received:
    1
    Trophy Points:
    18
    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.
     
  4. tfcservices

    tfcservices Member

    Joined:
    May 22, 2003
    Messages:
    23
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    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
     
  5. freedman

    freedman Well-Known Member

    Joined:
    Feb 13, 2005
    Messages:
    312
    Likes Received:
    1
    Trophy Points:
    18
    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.
     
  6. tfcservices

    tfcservices Member

    Joined:
    May 22, 2003
    Messages:
    23
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Alabama
    Thank you very much, You have been very helpful
     
  7. tfcservices

    tfcservices Member

    Joined:
    May 22, 2003
    Messages:
    23
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    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
     
  8. rafaelmussi

    rafaelmussi Registered

    Joined:
    Jul 24, 2006
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Brazil
    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
     
  9. tfcservices

    tfcservices Member

    Joined:
    May 22, 2003
    Messages:
    23
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Alabama
    Thank you.. worked great. I just have to keep editing it each time cpanel is upgraded.... but it works great.

    Thanks,
    DF
     
  10. freedman

    freedman Well-Known Member

    Joined:
    Feb 13, 2005
    Messages:
    312
    Likes Received:
    1
    Trophy Points:
    18
    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.
     
    #10 freedman, Jun 13, 2007
    Last edited: Jun 13, 2007
  11. rafaelmussi

    rafaelmussi Registered

    Joined:
    Jul 24, 2006
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Brazil
    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
     
Loading...

Share This Page