Unable to undelete emails from roundcubemail

Lance Charette lcharette at slingshottech.net
Wed Sep 20 14:11:45 CEST 2017


On 9/20/2017 1:51 AM, Timotheus Pokorra wrote:
> Hello Homer,
>
>
>> The issue is that they want to un-delete these emails and I have read
>> that there is suppose to be a way to do this within roundcubemail by
>> right clicking on the folder and selecting 'un-delete' however this
>> option does not exist in either of two different Kolab 3.4
>> installations.  (I will add that I have done recent (withing last 2
>> weeks) updates of both services for the Kolab environment.
>
> I have looked at https://github.com/roundcube/roundcubemail/issues/1635
> and was able to recover a deleted email like this in Kolab 3.4:
>
> Just click into the space, where there is usually the star for marking 
> an email as read or unread.
> Once you click there, the email changes from grey to black, and I 
> assume it is undeleted.
>
> Does this work for you?
>
> It does not work for multiple emails though.
> Ok, here is an open request for that functionality: 
> https://github.com/roundcube/roundcubemail/issues/5133
>
> I looked at cyrus unexpunge as well.
> According to 
> https://serverfault.com/questions/377748/how-deleted-flag-can-be-unset-for-all-mails-in-cyrus-imapd-mailbox 
> Roundcube sets a silent flag with the name Deleted: -FLAGS.SILENT 
> (\Deleted)
> see also https://www.cyrusimap.org/2.5/imap/admin/sop/deleting.html
> and 
> https://cyrusimap.org/imap/reference/faqs/o-deleted-expired-expunged-purged.html
> It seems that the mails marked for deletion are not expunged yet, and 
> therefore cannot be unexpunged.
> We need to unset the Deleted flag somehow different.
>
> I found the imap_undelete function in PHP:
> http://php.net/manual/en/function.imap-undelete.php
> You could write yourself or ask someone to write a little PHP script 
> that opens the mailbox, and then calls imap_undelete on each message.
>
> Timotheus
>
> ----------------------------------------------------------------
> Diese Nachricht wurde versandt mit Webmail von www.tbits.net.
> This message was sent using webmail of www.tbits.net.
>
Ok....

I seem to have stumbled on a possible solution, albeit and extremely 
obscure solution, to the un-delete issue of multiple messages in 
roundcubemail mistakenly marked for deletion by a user.  I have 
'discovered' that if you 'select' 'All' emails (in my example a user 
mistakenly deleted 1000's of emails in particular folders) and then 
click the 'select' box again to get the additional options,  there is an 
'invert' option in the drop down menu.  Selecting this 'invert' option 
toggled the delete flag on all the messages selected.  In my case, I 
selected 3,371 messages that were mistakenly marked for deletion and 
then selected 'invert' from the 'Select' drop down menu and all messages 
had their delete flag toggled.

This doesn't fully make sense that it would work as you can not select 
only some of the messages and than click on the 'invert' option from the 
'Select' pull down menu and have it un-delete those selected messages.  
Instead, it simply toggles the selected messages from the ones 
originally selected to those not selected and vice versa.  Further, for 
the un-mark for deletion to work all the messages in the folder had to 
be selected.  Weird?

Now here is the kicker.  It worked one time for all folders that had 
deleted messages.  I went through, once I seen it work on one folder, 
and performed the same action on all the other messages in other folders 
that had been marked to delete and was able to mass un-mark them as 
well... BUT.... in an attempt to duplicate the process a 2nd time, i.e. 
marking for deletion all the messages in a folder, I was not able to 
repeat the un-mark process I just described.  Weirder?

This process is ify at best.  Got it to do it again... but it is hit and 
miss on when it will actually toggle the marked for deletion flag.  I 
haven't figured out a combination of keystrokes that actually are 
consistent for this process.  Can any one else confirm this?

Test:

1. Select mailbox (folder) in roundcubemail that has a dozen or so 
emails in it.
2. Select all the messages from this mailbox and mark them for deletions.
3. Now use the 'Select' drop down menu to reselect 'all' the messages 
which now should be grayed out as they are marked for deletion (if 
roundcubemail is configured to not hide them)
4. From the 'Select' drop down menu and click on 'invert'.

Sometimes it 'un-marks' them and most the times it does not. It's quite 
unpredictable.  As it is... I have successfully un-marked all the marked 
for delete messages in question (again, 1000's of them through a bulk 
'un-mark' process) but can not nail down the sequence that actually is 
consistent in making it happen.

My apology if I have made this even more confusing.


More information about the users mailing list