Author Topic: Roundcube hide headers from user  (Read 1042 times)

Offline pikington

  • Newbie
  • *
  • Posts: 1
Roundcube hide headers from user
« on: March 11, 2022, 09:18:45 AM »
Hi guys ,

I hope you're all well, I was wondering if it was possible to remove the "headers" button from the users profile?

I don't want them to have the ability to view the headers on the emails which they receive and it have to be administrators to view them


Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,735
Re: Roundcube hide headers from user
« Reply #1 on: March 12, 2022, 03:05:07 AM »
I think you have two choices
1) create a custom skin/extend an existing one and leave they button out of the template
2) use the `render_page` hook to modify the HTML before its sent to the client with something like (for the elastic skin):
Code: [Select]
if ($args['template'] == 'message') {
  $args['content'] = preg_replace('/<a href="#all-headers" class="headers-all" onclick="return UI.headers_dialog\(\)">(.+?)<\/a>/', '', $args['content']);
return $args;
The plugin approach would give you the option to choose which users the button appears for.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and moreā€¦