Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rcube_imap.delete_folder(): proper sequence #5466

Closed
Andrei-Pozolotin opened this issue Oct 9, 2016 · 5 comments
Closed

rcube_imap.delete_folder(): proper sequence #5466

Andrei-Pozolotin opened this issue Oct 9, 2016 · 5 comments
Milestone

Comments

@Andrei-Pozolotin
Copy link

currently rcube_imap.delete_folder():
https://github.com/roundcube/roundcubemail/blob/master/program/lib/Roundcube/rcube_imap.php#L3295

when used for deleting in the middle of the branch, produces errors with dovecot v 2.2.25, and leaves empty 'lost' directories in server file system hierarchy, due to leaf delete happening after stem delete;

proper sequence is "recursive delete tree bottom up" or leaf before stem, i.e.:
https://github.com/random-cuber/contextmenu_folder/blob/master/contextmenu_folder.php#L595

@alecpl
Copy link
Member

alecpl commented Oct 10, 2016

Actually RFC says precissely:

      The DELETE command MUST NOT remove inferior hierarchical names.
      For example, if a mailbox "foo" has an inferior "foo.bar"
      (assuming "." is the hierarchy delimiter character), removing
      "foo" MUST NOT remove "foo.bar".  It is an error to attempt to
      delete a name that has inferior hierarchical names and also has
      the \Noselect mailbox name attribute (see the description of the
      LIST response for more details).

      It is permitted to delete a name that has inferior hierarchical
      names and does not have the \Noselect mailbox name attribute.  In
      this case, all messages in that mailbox are removed, and the name
      will acquire the \Noselect mailbox name attribute.

So, it looks that there's more than just the order.

@alecpl alecpl added this to the 1.2.3 milestone Oct 10, 2016
@Andrei-Pozolotin
Copy link
Author

sure. and the "recursive delete tree bottom up" approach allows to avoid various misinterpretations of the "RFC command DELETE inferior case" altogether

@alecpl
Copy link
Member

alecpl commented Oct 14, 2016

Fixed.

@alecpl alecpl closed this as completed Oct 14, 2016
@Andrei-Pozolotin
Copy link
Author

it seems there is still a problem (did not test):
conn->unsubscribe happens after 'conn->deleteFolder'
https://github.com/roundcube/roundcubemail/blob/master/program/lib/Roundcube/rcube_imap.php#L3322

@alecpl
Copy link
Member

alecpl commented Oct 16, 2016

That should not be a problem.

ZiBiS added a commit to ZiBiS/roundcubemail that referenced this issue Oct 17, 2016
* upstream/master:
  Fix bug where it wasn't possible to store more that 2MB objects in memcache/apc (roundcube#5452) Added memcache_max_allowed_packet and apc_max_allowed_packet settings
  assword: Added possibility to nicely handle password epiration from other plugins (roundcube#5468)
  Fix bug where IMAP password could be exposed via error message (roundcube#5472)
  Fix bug where deleting folders with subfolders could fail in some cases (roundcube#5466)
  Support HTML input to rcube_text_editor.replace() (roundcube#5456)
  Set smtp options in sample config as they are required now
  Optimize image size
  Bump database version
  Better icon and CSS styles for PGP-related attachments (roundcube#5301 and roundcube#5279)
  Add icons for pgp-keys and php-encrypted attachments (roundcube#5301 and roundcube#5279)
  Update changelog
  Fix flickering of header topline in min-mode (roundcube#5426)
  Do not show inline images of unsupported mimetype (roundcube#5463)
  SQL, upgrade: increase session table ip field size for IPv6 addresses
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants