Roundcube Community Forum

Release Support => Requests => Topic started by: calande on November 15, 2007, 05:08:31 PM

Title: Rename spam folder
Post by: calande on November 15, 2007, 05:08:31 PM
What about renaming the default spam folder from "Junk" to "Spam" in main.inc.php?

Code: [Select]
$rcmail_config['junk_mbox'] = 'Junk';
It's more common, isn't it?

If we go this route, we need to modify slightly this variable as well:

Code: [Select]
$rcmail_config['default_imap_folders'] = array('INBOX', 'Drafts', 'Sent', 'Junk', 'Trash');
:)
Title: Re: Rename spam folder
Post by: SKaero on November 16, 2007, 05:21:35 AM
I think Junk is better, I put stuff in that folder that I don't what to read be had to give them my email, so its not all spam.
Title: Re: Rename spam folder
Post by: dano on November 20, 2007, 05:51:34 PM
I remove both of those completely from my install as Roundcube doesn't actually do anything with the spam anyways. The server does all that.
Title: Re: Rename spam folder
Post by: tony2 on March 31, 2008, 05:45:30 AM
Quote from: calande
What about renaming the default spam folder from "Junk" to "Spam" in main.inc.php?

Code: [Select]
$rcmail_config['junk_mbox'] = 'Junk';
It's more common, isn't it?

If we go this route, we need to modify slightly this variable as well:

Code: [Select]
$rcmail_config['default_imap_folders'] = array('INBOX', 'Drafts', 'Sent', 'Junk', 'Trash');
:)

Hi,

sorry if this is a common issue, I did some searching but couldn't find the answer...

I have my spam folder named as Spam on the IMAP server, so I tried to rename 'Junk' to 'Spam' in main.inc.php as instructed above (and restarted apache) but it didn't work. The Spam folder is not shown at all (neither in the left folder panel, nor in the list of folders in "Personal settings"). The Junk folder is still shown, but it is marked with a minus sign "-" (perhaps to indicate that the folder doesn't exist. Does someone have a clue what I am missing? Thanks.
Title: Rename spam folder
Post by: Nemesis02 on May 12, 2008, 11:41:46 PM
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!! :)
Title: Rename spam folder
Post by: rickrom on June 14, 2008, 09:26:44 AM
Hi

You can rename this folder in ../program/localization/en_US/labels.inc

Search for the string  $labels['junk']   = 'Junk';

and change to $labels['junk']   = 'Spam';

In my case works perfectly.