Author Topic: Looking to Add our Inbox to the list of Special Folders that can be changed  (Read 4454 times)

Offline greavette

  • Jr. Member
  • **
  • Posts: 36
Hello,

Our Mail Server (Citadel.org) is hosted locally in our Office.  We have a shared folder on our mail server that retrieves mail (through POP) from our Internet Provider.  This means that our secretaries all use this shared folder to receive mail...no one uses their personal Inbox folder.

What I'd like to do on Roundcube is modify the Special Folders to allow the Inbox to be changed to this shared folder for all users.

So I've been searching through the Roundcube code and made the following changes:

func.inc:

I removed the INBOX exception:
    //load folders list only when needed
          'maxlength' => 30,));
      //    'maxlength' => 30, 'exceptions' => array('INBOX')));

I added an inbox_mbox to the list of options:
      if (!isset($no_override['inbox_mbox']))
        $blocks['main']['options']['inbox_mbox'] = array(
          'title' => Q(rcube_label('inbox')),
          'content' => $select->show($config['inbox_mbox'], array('name' => "_inbox_mbox")),
        );


main.inc:

I added a folder id for my new inbox_mbox and commented our the folder id of INBOX.
    else if ($folder['id'] == $CONFIG['inbox_mbox'])
      $classes[] = 'inbox';
   // else if ($folder['id'] == 'INBOX')
   //   $classes[] = 'inbox';

I also commented out the following:
//  if ($folder_id == 'INBOX')
//    return 'inbox';

I then updated the foreach line:

  // for these mailboxes we have localized labels and css classes
  foreach (array('sent', 'drafts', 'trash', 'junk', 'inbox') as $smbx)

main.inc.php:

I added my newly created inbox_mbox:
// store inbox messages in this mailbox
$rcmail_config['inbox_mbox'] = 'Inbox';


I can now see in Settings > Special Folders under Main Options my Inbox with - - - beside it which should allow me to update the Inbox with a new folder, but when I select our shared folder and save, the new Inbox folder I've selected is not saved.  My Main Options for Inbox still shows - - -.


Any help you can provide would be greatly appreciated.

Thank you.

Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,850
Looking to Add our Inbox to the list of Special Folders that can be changed
« Reply #1 on: November 15, 2011, 12:29:10 PM »
you should do this with a plugin rather than editing the core. you need to also add code where it does the saving else it doesnt know what to do with your new field.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more…

Offline greavette

  • Jr. Member
  • **
  • Posts: 36
Looking to Add our Inbox to the list of Special Folders that can be changed
« Reply #2 on: November 15, 2011, 08:12:06 PM »
Thank you JohnDoh for the reply.

So would you say I'm on the right track with my code changes?  I will look at making this a plugin instead.

As for the code to save, could you point me to where this code might be.

Thank you.

Offline greavette

  • Jr. Member
  • **
  • Posts: 36
Looking to Add our Inbox to the list of Special Folders that can be changed
« Reply #3 on: November 15, 2011, 08:12:48 PM »
Thank you JohnDoh for the reply.

So would you say I'm on the right track with my code changes?  I will look at making this a plugin instead.

As for the code to save, could you point me to where this code might be.

Thank you.

Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,850
Looking to Add our Inbox to the list of Special Folders that can be changed
« Reply #4 on: November 16, 2011, 05:54:11 AM »
Hi, Am I right in thinking that what you are trying to do is make it so that when a user logs in the first folder they see is not the Inbox? And to let the user select this folder from their settings? If so then this has come up before on the forum and whilst trying to help some one make a plugin to do it I made an example of my own. Its attached. It might not do exactly what you want but it does have code in it to add an option to the settings screen and save it as part of the user's preferences.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more…

Offline greavette

  • Jr. Member
  • **
  • Posts: 36
Looking to Add our Inbox to the list of Special Folders that can be changed
« Reply #5 on: November 20, 2011, 02:44:13 AM »
Hello JohnDoh,

Thanks very much for the plugin..this is exactly what we needed!  

Thank you.

Offline greavette

  • Jr. Member
  • **
  • Posts: 36
Forgive me for resurrecting a very old post, but Jon Doh made a comment in Post #4 that a file was attached.  I've lost that file and I'm looking to download it again.  I don't see a file to download on this post?  Where would an attachment be on a forum post?

Thank you.

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,879
    • SKaero - Custom Roundcube development
When the forum moved from vBulletin to SMF the post attachments didn't come across. I have the old attachments files but I'm not sure which one JohnDoh posted so I can't repost it.