Author Topic: Problem with filters and "INBOX." prefix  (Read 5132 times)

Offline Drakon

  • Jr. Member
  • **
  • Posts: 45
Problem with filters and "INBOX." prefix
« on: January 03, 2012, 07:53:45 AM »
Hi crew!

I have problems with filters to move e-mails to any folder. The rule was created correctly but when I receive an email, Roundcube automatically creates and subscribes "INBOX.folder" and not ".folder" and the folder appears within "INBOX". Physically, on the system files, I have a new folder "INBOX.folder" but the others folders are ".folder" only without "INBOX." prefix.

When I create the filter I select the destination folder but Roundcube creates the folder with "INBOX.prefix" but ignores de selection.

Roundcube version = 0.6 (stable)
I have Courier-imap.

My config file "main.inc.php" contains:
....
$rcmail_config['imap_ns_personal'] = NULL;
$rcmail_config['imap_ns_other'] = NULL;
$rcmail_config['imap_ns_shared'] = NULL;
...
$rcmail_config['drafts_mbox'] = 'INBOX.Drafts';
$rcmail_config['junk_mbox'] = 'INBOX.Junk';
$rcmail_config['sent_mbox'] = 'INBOX.Sent';
$rcmail_config['trash_mbox'] = 'INBOX.Trash';
...
$rcmail_config['default_imap_folders'] = array('INBOX', 'INBOX.Drafts', 'INBOX.Sent', 'INBOX.Junk', 'INBOX.Trash');


Regards,
Jose.

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,882
    • SKaero - Custom Roundcube development
Problem with filters and "INBOX." prefix
« Reply #1 on: January 03, 2012, 09:04:46 AM »
RoundCube itself doesn't do filtering so the problem would be with the system that does your filtering or possibly the RoundCube plugin that is used to write the rules for the email filter system.

Offline Drakon

  • Jr. Member
  • **
  • Posts: 45
Problem with filters and "INBOX." prefix
« Reply #2 on: January 03, 2012, 09:32:02 AM »
Hi Skaero,

    if the filter is applied manually the system works fine but if it is applied with Roundcube the rule was applied incorrectly on the system.

Regards,

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,882
    • SKaero - Custom Roundcube development
Problem with filters and "INBOX." prefix
« Reply #3 on: January 03, 2012, 08:36:39 PM »
Then it would be a problem with the filter plugin for RoundCube but you'll need to list which one since there are several that are for different filtering systems.

Offline Drakon

  • Jr. Member
  • **
  • Posts: 45
Problem with filters and "INBOX." prefix
« Reply #4 on: January 04, 2012, 02:13:26 AM »
Dear Skaero,

I have not a plugin, is the simple and default filter with 'roundcube 0.6' or is a plugin integrated with ISPConfig 3.0.3.2.

You know what is causing the problem and how I can fix it?

Thanks,
« Last Edit: January 04, 2012, 02:17:05 AM by Drakon »

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,882
    • SKaero - Custom Roundcube development
Problem with filters and "INBOX." prefix
« Reply #5 on: January 04, 2012, 04:19:12 AM »
Well RoundCube doesn't have a built in filtering system so it must be a mod or plugin that comes with ISPConfig version of RoundCube, I'm not sure what filtering system ISPConfig is using so I really help. Its probably best to ask of the How To Forge forums.

Offline Drakon

  • Jr. Member
  • **
  • Posts: 45
Problem with filters and "INBOX." prefix
« Reply #6 on: January 04, 2012, 07:43:13 AM »
Problem solved!

The problem comes from Roundcube version 0.6 and ISPConfig version 3.0.3.2.

It is necessary to modify the management plugin filters ISPConfig.

On the file "/plugins/ispconfig3_filter/ispconfig3_filter.php" must be modified:
--> after line:
$target     = get_input_value('_filtertarget', RCUBE_INPUT_POST);
--> insert this:
$target     = str_replace('INBOX.','',$target);

--> after line:
$filter = $this->soap->mail_user_filter_get($session_id, array('mailuser_id' => $mail_user[0]['mailuser_id']));
--> insert this:
$filter['target'] = 'INBOX.' . $filter['target'];

--> after line:
$filter = $this->soap->mail_user_filter_get($session_id, $id);
--> insert this:
$filter['target'] = 'INBOX.' . $filter['target'];

--> modify the line:
$string = $input_filteraction->show($filter[0]['action']).$input_filtertarget->show($filter[0]['target']);
--> replaced by:
$string = $input_filteraction->show($filter[0]['action']).$input_filtertarget->show('INBOX.' . $filter[0]['target']);


All I do is remove the "INBOX." text or add this when Roundcube load saved filters.

Thanks Skaero!
« Last Edit: January 09, 2012, 02:19:57 AM by Drakon »