Hello everyone, I've come to save the day...
I ran into the same issue. I am on shared hosting, and my server is set to put all junk mail into a folder called spam, but my webmail wouldn't read the spam folder, so i thought, what about renaming Junk to spam when users clicked on it? and low and behold i found a request for this. I created a mod to do just that... Ok, this is how you do it.
Files affected:
config/main.inc.php
program/include/rcube_imap.inc
Open config/main.inc.php
Find
?>Add before
$rcmail_config['mailbox_rename'] = array( "Junk" => "spam" );Open program/include/rcube_imap.inc
Find
function set_mailbox($new_mbox)
{Add after
global $CONFIG;
$new_mbox = $CONFIG['mailbox_rename'][$new_mbox] ? $CONFIG['mailbox_rename'][$new_mbox] : $new_mbox;Find
function _mod_mailbox($mbox_name, $mode='in')
{Add after
global $CONFIG;Find a few lines bellow
if (!empty($this->root_dir) && $mode=='in')
$mbox_name = $this->root_dir.$this->delimiter.$mbox_name;
else if (strlen($this->root_dir) && $mode=='out')
$mbox_name = substr($mbox_name, strlen($this->root_dir)+1);Replace with
if (!empty($this->root_dir) && $mode=='in')
$mbox_name = $this->root_dir.$this->delimiter.($CONFIG['mailbox_rename'][$mbox_name] ? $CONFIG['mailbox_rename'][$mbox_name] : $mbox_name);
else if (strlen($this->root_dir) && $mode=='out') {
$mbox_name = substr($mbox_name, strlen($this->root_dir)+1);
$mbox_name = array_search($mbox_name,$CONFIG['mailbox_rename']) === false ? $mbox_name : array_search($mbox_name,$CONFIG['mailbox_rename']);
}You are DONE!!!
Now, if you would like to rename other folders... modify the $rcmail_config['mailbox_rename'] in the config file.
For example:
$rcmail_config['mailbox_rename'] = array( "Junk" => "spam", "College" => "Porn");The above example will redirect the Junk folder to a folder called spam and the College folder to a folder called Porn.
ENJOY!!