Ok, so I managed to find an answer.
Using the guide to build plugins for Roundcube, I set up a "no_forward_for_groupes" plugin, in the [roundcubeRoot]/plugin/no_forward_for_groupes
folder. I activated it in the [roundcubeRoot]/config/config.inc.php
file by wrtiting
$config['plugins'] = array('no_forward_for_groupes');
as any other plugin.
After a bit of reading and research in the [roundcubeRoot]/program/js/app.js
file (the core JS of Roundcube), I found the object I need to act with and the events to listen. The final code is just after. As you can see, I disabled a lot of other commands, as well as drag and drop. So basically I have a read-only folder, which you can't get any mails out of. I know it's kind of a specific use-case, but I hope it'll help some folks out there someday!
no_forward_for_groupes.php
<?php
/**
* No Forward For Groups
*
* This plugin disables the Send / Forward menus from the Mails_Groupes folder
*
* @version 0.1
* @author Remy Sanfeliu
*/
class no_forward_for_groupes extends rcube_plugin
{
public $task = 'mail';
function init(){
$this->include_script('no_forward_for_groupes.js');
}
}
no_forward_for_groupes.js
/**
* No Forward For Groups
*
* This plugin disables the Send / Forward menus from the Mails_Groupes folder
*
* @version 0.1
* @author Remy Sanfeliu
*/
window.rcmail.addEventListener('listupdate', function(folder, old) {
if (folder.folder=="SENT.Mails_Groupes"){
window.rcmail.message_list.addEventListener('select', select_msglist);
window.rcmail.message_list.addEventListener('dragstart', do_nothing);
window.rcmail.message_list.addEventListener('dragmove', do_nothing);
window.rcmail.message_list.addEventListener('dragend', do_nothing);
}else{
window.rcmail.message_list.removeEventListener('select', select_msglist);
window.rcmail.message_list.removeEventListener('dragstart', do_nothing);
window.rcmail.message_list.removeEventListener('dragmove', do_nothing);
window.rcmail.message_list.removeEventListener('dragend', do_nothing);
}
});
function select_msglist(list){
window.rcmail.enable_command( 'reply',
'reply-all',
'reply-list',
'move',
'copy',
'delete',
'mark',
'edit',
'forward',
'forward-attachment',
'forward-inline',
false);
}
function do_nothing(){
// DO NOTHING
}