Opened 3 years ago

Closed 3 years ago

#1486802 closed Feature Requests (fixed)

Roundcube should attempt to create Sent/Draft/Trash folders when it needs them

Reported by: markedwards Owned by:
Priority: 5 Milestone: 0.4-stable
Component: Core functionality Version: 0.4-beta
Severity: major Keywords:
Cc: mark@…

Description

I have a user that lost several weeks of sent mail because his Sent folder was not in the proper location (I think it got moved in another mail client accidentally). Most modern mail clients that I have used will attempt to create a special folder if it doesn't exist when its needed.

I suggest Roundcube needs this functionality. Mail should never evaporate if there is any way to avoid it. I would be willing to take a crack at creating a patch for this if it will help.

Thanks.

Attachments (1)

compose-create-folder.patch (999 bytes) - added by markedwards 3 years ago.
Proposed patch to fix issue

Download all attachments as: .zip

Change History (16)

comment:1 Changed 3 years ago by alec

Actually draft/sent folders are created if they are configured and aren't exists.

comment:2 Changed 3 years ago by markedwards

I was under the impression that this only occurs on first login. It certainly isn't happening otherwise on my installation. I'm talking about this occurring any time these folders are needed. If they don't exist, the should be created.

comment:3 Changed 3 years ago by alec

This occurs also when message is sended/saved, See sendmail.inc ca. line 590.

comment:4 Changed 3 years ago by markedwards

Huh, I searched up several places in the forums claiming this only happens on first login. Folders are certainly not being created when messages are saved in my installation. I'll see if I can trace the source of the issue.

comment:5 Changed 3 years ago by alec

Check you have default folders configured in Settings->Preferences->Special Folders.

comment:6 Changed 3 years ago by markedwards

Special Folders are configured in main.inc.php:

$rcmail_configdefault_imap_folders? = array('INBOX', 'Drafts', 'Sent Messages', 'Junk', 'Deleted Messages');

and this is reflected in Settings->Preferences->Special Folders.

Create default folder is set to true in main.inc.php:

$rcmail_configcreate_default_folders? = true;

Mail is correctly being saved in the Sent Messages folder. If I then rename Sent Messages to something else outside of Roundcube, fire Roundcube up, and send a message, a new Sent Messages folder is never created and Roundcube sends the message without saving a copy of it or issuing any warning.

comment:7 Changed 3 years ago by alec

Probably because in this situation you've got an other folder selected in compose form.

comment:8 Changed 3 years ago by alec

Sorry, I mean, you've got "don't save" position selected in compose form.

comment:9 Changed 3 years ago by markedwards

So what you're saying is that, in fact, Roundcube does not create the Sent folder when it needs it, it recognizes that the selected Sent folder is missing and puts "don't save" in the little menu.

What I'm saying is that, if a default folder is designated and "create_default_folders" is true, Roundcube should create that folder if it is missing when it needs to save to it.

comment:10 Changed 3 years ago by alec

  • Milestone changed from later to 0.4-stable

So, maybe we should add a check also in compose.inc.

comment:11 Changed 3 years ago by markedwards

I think this is what I'm getting at. It seems to me that the behavior should be:

create_default_folders = true


Create default folders whenever they are needed, such as when opening a compose window and populating the "Save message in" menu, or when saving a Draft, or what have you.

create_default_folders = false


Folders should not ever be created, and the user should be given some kind of warning that a message will not be saved.

The only case where I see these rules are not being followed is in the Compose window example we have here, so perhaps it just comes down to this single case. But I haven't tested all cases, so maybe there are others.

Thanks! I'm happy to come up with a patch if that helps.

comment:12 Changed 3 years ago by alec

Patches are always welcome.

Changed 3 years ago by markedwards

Proposed patch to fix issue

comment:13 Changed 3 years ago by markedwards

This may not be the most elegant place for this (I don't know the code very well) but this solves the issue on my installation. I adapted code from sendmail.inc which you pointed to.

comment:14 Changed 3 years ago by markedwards

  • Cc mark@… added

Should I do anything else on this? Do I need to submit that patch anywhere else? The fix seems to work well for me.

comment:15 Changed 3 years ago by thomasb

  • Resolution set to fixed
  • Status changed from new to closed

Fixed in [90e7080d]

Note: See TracTickets for help on using tickets.