Author Topic: Rename spam folder  (Read 4004 times)

Offline calande

  • Jr. Member
  • **
  • Posts: 64
Rename spam folder
« 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');
:)

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,638
    • http://SKaero.com/
Re: Rename spam folder
« Reply #1 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.

Offline dano

  • Full Member
  • ***
  • Posts: 124
Re: Rename spam folder
« Reply #2 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.

Offline tony2

  • Newbie
  • *
  • Posts: 1
Re: Rename spam folder
« Reply #3 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.

Offline Nemesis02

  • Jr. Member
  • **
  • Posts: 30
Rename spam folder
« Reply #4 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_namestrlen($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_namestrlen($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!! :)

Offline rickrom

  • Newbie
  • *
  • Posts: 1
Rename spam folder
« Reply #5 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.