I think a button to move messages to SPAM folder would be pretty good ;-)
This new button acts like "del button" that moves msg to "trash Folder".
It instantly moves the message to "Junk folder".
Howto RoundCube add "movetospam" button:
==========================================================
###1) COPY folder skin/default to skin/movespambutton
- we will not mess with default skin
- all "changes" below are marked as // START CHANGE and //END CHANGE
###2) EDIT /index.php
...
// map task/action to a certain include file
$action_map = array(
'mail' => array(
'preview' => 'show.inc',
'print' => 'show.inc',
'moveto' => 'move_del.inc',
'delete' => 'move_del.inc',
// START CHANGE
'movetospam' => 'move_del.inc',
// END CHANGE
'send' => 'sendmail.inc',
'expunge' => 'folders.inc',
'purge' => 'folders.inc',
'remove-attachment' => 'attachments.inc',
'display-attachment' => 'attachments.inc',
'upload' => 'attachments.inc',
),
...
###3) EDIT /skins/movespambutton/templates/mail.html
...
// START CHANGE
// END CHANGE
...
###4) EDIT /skins/movespambutton/templates/message/message.html
...
// START CHANGE
// END CHANGE
...
###5) EDIT /skins/movespambutton/mail.css
...
#messagetoolbar select.mboxlist
{
position: absolute;
// START CHANGE
left: 415px;
// END CHANGE
top: 8px;
}
###6) EDIT /program/steps/mail/move_del.in
...
// move messages
if ($RCMAIL->action=='moveto' && !empty($_POST['_uid']) && !empty($_POST['_target_mbox'])) {
$count = sizeof(explode(',', ($uids = get_input_value('_uid', RCUBE_INPUT_POST))));
$target = get_input_value('_target_mbox', RCUBE_INPUT_POST);
$mbox = get_input_value('_mbox', RCUBE_INPUT_POST);
// flag messages as read before moving them
if ($CONFIG['read_when_deleted'] && $target == $CONFIG['trash_mbox'])
$IMAP->set_flag($uids, 'SEEN');
$moved = $IMAP->move_message($uids, $target, $mbox);
if (!$moved) {
// send error message
$OUTPUT->command('list_mailbox');
$OUTPUT->show_message('errormoving', 'error');
$OUTPUT->send();
exit;
}
if (!$CONFIG['flag_for_deletion'])
$addrows = true;
}
//START CHANGE
// move to junk
else if ($RCMAIL->action=='movetospam' && !empty($_POST['_uid']) ) {
$count = sizeof(explode(',', ($uids = get_input_value('_uid', RCUBE_INPUT_POST))));
// set target=Junk
$target = $CONFIG['junk_mbox'];
$mbox = get_input_value('_mbox', RCUBE_INPUT_POST);
$moved = $IMAP->move_message($uids, $target, $mbox);
if (!$moved) {
// send error message
$OUTPUT->command('list_mailbox');
$OUTPUT->show_message('errormoving', 'error');
$OUTPUT->send();
exit;
}
if (!$CONFIG['flag_for_deletion'])
$addrows = true;
}
//END CHANGE
// delete messages
else if ($RCMAIL->action=='delete' && !empty($_POST['_uid'])) {
$count = sizeof(explode(',', ($uids = get_input_value('_uid', RCUBE_INPUT_POST))));
$mbox = get_input_value('_mbox', RCUBE_INPUT_POST);
$del = $IMAP->delete_message($uids, $mbox);
...
###7) EDIT /program/js/app.js
find: "moveto"
replace-with: "moveto","movetospam"
find: case "moveto","movetospam":
replace-with: case "moveto":
find: this.command("moveto","movetospam",_62[this.env.last_folder_target].id);
replace-with: this.command("moveto",_62[this.env.last_folder_target].id);
find: this._with_selected_messages("moveto","movetospam",_a8,_a9,(this.env.flag_for_deletion?false:true));
replace-with: this._with_selected_messages("moveto",_a8,_a9,(this.env.flag_for_deletion?false:true));
-----------------------------
...
break;
case "delete":
if(this.task=="mail"){
this.delete_messages();
}else{
if(this.task=="addressbook"){
this.delete_contacts();
}else{
if(this.task=="settings"){
this.delete_identity();
}
}
}
break;
// START CHANGE
case "movetospam":
if(this.task=="mail"){
this.move_messages('Junk');
}
break;
// END CHANGE
case "move":
case "moveto":
if(this.task=="mail"){
this.move_messages(_40);
}else{
if(this.task=="addressbook"&&this.drag_active){
this.copy_contact(null,_40);
}
}
break;
case "mark":
...
-----------------------------
...
switch(_20b.__action){
case "delete":
if(this.task=="addressbook"){
var uid=this.contact_list.get_selection();
this.enable_command("compose",(uid&&this.contact_list.rows[uid]));
this.enable_command("delete","EDIT",(uid&&this.contact_list.rows[uid]&&this.env.address_sources&&!this.env.address_sources[this.env.source].readonly));
this.enable_command("export",(this.contact_list&&this.contact_list.rowcount>0));
}
// START CHANGE
case "moveto":
case "movetospam":
// END CHANGE
if(this.env.action=="show"){
this.command("list");
}else{
if(this.message_list){
this.message_list.init();
}
}
break;
case "purge":
...
###8) EDIT /program/localization/enUS
add this line:
$labels['movemessagetospam'] = 'Move message to SPAM/JUNK';
###9) ON FOLDER: /skins/movespambutton/images/buttons
cp delete_act.png spam_act.png
cp delete_pas.png spam_pas.png
cp delete_sel.png spam_sel.png
USE AN IMAGE EDITOR ON:
spam_act.png, spam_pas.png and spam_sel.png
* here, we used the original "delete_xxx.png" as simbol to "move to spam"
* and we created a new "delete_xxx.png" with a "red X" simbol to represent "delete action"
==========================================================