sent_mbox preference is always resetted after login #4782

Closed
rcubetrac opened this Issue Mar 3, 2015 · 14 comments

Comments

Projects
None yet
3 participants
@rcubetrac

Reported by mufus on 3 Mar 2015 18:23 UTC as Trac ticket #1490300

After upgrading to 1.1.0 i noticed that the "sent_mbox" preference for each user is always being resetted after each login.

My dovecot config:

  mailbox Sent {
    special_use = \Sent
  }

Every time I log in to roundcube webmail, my

Settings > Preferences > Special Folders > Sent

is always resetted back to "Sent" (defined by Dovecot), even if I manually change it to, for example "Sent Messages" folder.

Migrated-From: http://trac.roundcube.net/ticket/1490300

@rcubetrac

This comment has been minimized.

Show comment
Hide comment
@rcubetrac

rcubetrac Mar 3, 2015

Comment by @alecpl on 3 Mar 2015 19:45 UTC

This is because server SPECIAL-USE setting has priority over Roundcube settings and because dovecot does not support SPECIAL-USE flag changes by METADATA. Or there's a bug... Please, enable imap_debug in Roundcube and provide the log. For more info see rcube_imap::set_special_folders() method.

Comment by @alecpl on 3 Mar 2015 19:45 UTC

This is because server SPECIAL-USE setting has priority over Roundcube settings and because dovecot does not support SPECIAL-USE flag changes by METADATA. Or there's a bug... Please, enable imap_debug in Roundcube and provide the log. For more info see rcube_imap::set_special_folders() method.

@rcubetrac

This comment has been minimized.

Show comment
Hide comment
@rcubetrac

rcubetrac Mar 3, 2015

Milestone changed by @alecpl on 3 Mar 2015 19:45 UTC

later => 1.1.1

Milestone changed by @alecpl on 3 Mar 2015 19:45 UTC

later => 1.1.1

@rcubetrac

This comment has been minimized.

Show comment
Hide comment
@rcubetrac

rcubetrac Mar 3, 2015

Comment by mufus on 3 Mar 2015 20:20 UTC

Aha, if Dovecot's SPECIAL-USE value always has priority, that explains why Roundcube's value is always being reset at login time.

The reason why I noticed this in the first place:
My Dovecot config had both "Sent" and "Sent Messages" in its config

  # For \Sent mailboxes there are two widely used names. We'll mark both of
  # them as \Sent. User typically deletes one of them if duplicates are created.
  mailbox Sent {
    special_use = \Sent
  }

  mailbox "Sent Messages" {
    special_use = \Sent
  }

I have always used the "Sent" folder in RC before, but with RC 1.1.0 the default Sent-folder in Roundcube was changed to "Sent Messages".

I have attached log of the imap.

Comment by mufus on 3 Mar 2015 20:20 UTC

Aha, if Dovecot's SPECIAL-USE value always has priority, that explains why Roundcube's value is always being reset at login time.

The reason why I noticed this in the first place:
My Dovecot config had both "Sent" and "Sent Messages" in its config

  # For \Sent mailboxes there are two widely used names. We'll mark both of
  # them as \Sent. User typically deletes one of them if duplicates are created.
  mailbox Sent {
    special_use = \Sent
  }

  mailbox "Sent Messages" {
    special_use = \Sent
  }

I have always used the "Sent" folder in RC before, but with RC 1.1.0 the default Sent-folder in Roundcube was changed to "Sent Messages".

I have attached log of the imap.

@rcubetrac

This comment has been minimized.

Show comment
Hide comment
@rcubetrac

rcubetrac Mar 4, 2015

Comment by @alecpl on 4 Mar 2015 07:26 UTC

I'm not sure if enabling METADATA in dovecot will fix that. I think dovecot does not support special-use flags updates yet. Anyway, this is intended behaviour and we'll not change that. If you don't like it you can set $config['imap_disabled_caps'] = array('SPECIAL-USE'); in Roundcube config.

Also, to disable Sent folder change in Roundcube settings you can add 'sent_mbox' to 'dont_override' array in the config.

Comment by @alecpl on 4 Mar 2015 07:26 UTC

I'm not sure if enabling METADATA in dovecot will fix that. I think dovecot does not support special-use flags updates yet. Anyway, this is intended behaviour and we'll not change that. If you don't like it you can set $config['imap_disabled_caps'] = array('SPECIAL-USE'); in Roundcube config.

Also, to disable Sent folder change in Roundcube settings you can add 'sent_mbox' to 'dont_override' array in the config.

@rcubetrac

This comment has been minimized.

Show comment
Hide comment
@rcubetrac

rcubetrac Mar 4, 2015

Status changed by @alecpl on 4 Mar 2015 07:26 UTC

new => closed

Status changed by @alecpl on 4 Mar 2015 07:26 UTC

new => closed

@rcubetrac

This comment has been minimized.

Show comment
Hide comment
@rcubetrac

rcubetrac Jun 4, 2015

Comment by jirand on 4 Jun 2015 12:57 UTC

We just stumbled across this and I have to re-open this bug.

IMHO special_use flag in IMAP is intended as advisory to the email client when it has not relevant information about what folder should be used.

If the email client already has this setting (moreover when it has been modified by the user) it should definitely have precedence before the special_use flag.

The default dovecot config is a good illustration as it says any of "Sent" and "Sent Messages" folders can be used for storing sent messages.

Comment by jirand on 4 Jun 2015 12:57 UTC

We just stumbled across this and I have to re-open this bug.

IMHO special_use flag in IMAP is intended as advisory to the email client when it has not relevant information about what folder should be used.

If the email client already has this setting (moreover when it has been modified by the user) it should definitely have precedence before the special_use flag.

The default dovecot config is a good illustration as it says any of "Sent" and "Sent Messages" folders can be used for storing sent messages.

@rcubetrac

This comment has been minimized.

Show comment
Hide comment
@rcubetrac

rcubetrac Jun 4, 2015

Status changed by jirand on 4 Jun 2015 12:57 UTC

closed => reopened

Status changed by jirand on 4 Jun 2015 12:57 UTC

closed => reopened

@rcubetrac

This comment has been minimized.

Show comment
Hide comment
@rcubetrac

rcubetrac Jun 4, 2015

Comment by @alecpl on 4 Jun 2015 14:52 UTC

I do not agree with that. The problem is that dovecot's special-use flags are read-only. There wouldn't be a problem if dovecot would allow special-use flag modification. So, to have the bahaviour you want just disable SPECIAL-USE capability in Roundcube as proposed above.

Assigned to Thomas for an opinion.

Comment by @alecpl on 4 Jun 2015 14:52 UTC

I do not agree with that. The problem is that dovecot's special-use flags are read-only. There wouldn't be a problem if dovecot would allow special-use flag modification. So, to have the bahaviour you want just disable SPECIAL-USE capability in Roundcube as proposed above.

Assigned to Thomas for an opinion.

@rcubetrac

This comment has been minimized.

Show comment
Hide comment
@rcubetrac

rcubetrac Jun 4, 2015

Status changed by @alecpl on 4 Jun 2015 14:52 UTC

reopened => new

Status changed by @alecpl on 4 Jun 2015 14:52 UTC

reopened => new

@rcubetrac

This comment has been minimized.

Show comment
Hide comment
@rcubetrac

rcubetrac Jun 4, 2015

Owner changed by @alecpl on 4 Jun 2015 14:52 UTC

=> thomasb

Owner changed by @alecpl on 4 Jun 2015 14:52 UTC

=> thomasb

@rcubetrac

This comment has been minimized.

Show comment
Hide comment
@rcubetrac

rcubetrac Jun 4, 2015

Milestone changed by @alecpl on 4 Jun 2015 14:52 UTC

1.1.1 => later

Milestone changed by @alecpl on 4 Jun 2015 14:52 UTC

1.1.1 => later

@rcubetrac

This comment has been minimized.

Show comment
Hide comment
@rcubetrac

rcubetrac Jun 5, 2015

Comment by mufus on 5 Jun 2015 13:44 UTC

I don't see why Roundcube should not respect the users settings like all other email clients do.

Because of this issue, lots of users now ended up having one Sent-folder in their e-mail client (Apple Mail/iOS Mail/Thunderbird/Outlook), and another one when they access webmail through Roundcube.

Comment by mufus on 5 Jun 2015 13:44 UTC

I don't see why Roundcube should not respect the users settings like all other email clients do.

Because of this issue, lots of users now ended up having one Sent-folder in their e-mail client (Apple Mail/iOS Mail/Thunderbird/Outlook), and another one when they access webmail through Roundcube.

@rcubetrac

This comment has been minimized.

Show comment
Hide comment
@rcubetrac

rcubetrac Jun 20, 2015

Comment by @alecpl on 20 Jun 2015 15:22 UTC

That's the point behind SPECIAL-USE. Clients should ignore its config if server has special folders already configured. The problem here is on the imap server which does not allow to change these assignments. Normally, client should be able to change the assignment so other clients can apply this change automatically.

Really, if there's no way to change the assignment on the server I don't see much sense in using SPECIAL-USE. In such a case it can be disabled on server or in Roundcube config.

However, the behavior could be changed the way you propose. We'd need to detect if special folders settings were ever modified/saved and if so use config instead of special-use, but I call this a workaround.

Comment by @alecpl on 20 Jun 2015 15:22 UTC

That's the point behind SPECIAL-USE. Clients should ignore its config if server has special folders already configured. The problem here is on the imap server which does not allow to change these assignments. Normally, client should be able to change the assignment so other clients can apply this change automatically.

Really, if there's no way to change the assignment on the server I don't see much sense in using SPECIAL-USE. In such a case it can be disabled on server or in Roundcube config.

However, the behavior could be changed the way you propose. We'd need to detect if special folders settings were ever modified/saved and if so use config instead of special-use, but I call this a workaround.

@rcubetrac

This comment has been minimized.

Show comment
Hide comment
@rcubetrac

rcubetrac Mar 18, 2016

Comment by drdol on 18 Mar 2016 15:11 UTC

I run into the same issue. An customer reported this issue.

It's kind of confusing being able to define special folders in the settings but after a login the folders are reset. Would it be better to disable the possibility to change the special folder if the folder type was set by the SPECIAL-USE attribute and the server does not support a special folder attribute update.
Simple disable the select box.

Comment by drdol on 18 Mar 2016 15:11 UTC

I run into the same issue. An customer reported this issue.

It's kind of confusing being able to define special folders in the settings but after a login the folders are reset. Would it be better to disable the possibility to change the special folder if the folder type was set by the SPECIAL-USE attribute and the server does not support a special folder attribute update.
Simple disable the select box.

@rcubetrac rcubetrac added this to the later milestone Mar 20, 2016

@alecpl alecpl assigned alecpl and unassigned thomascube Apr 1, 2016

@alecpl alecpl modified the milestones: 1.1.5, later Apr 1, 2016

alecpl added a commit that referenced this issue Apr 2, 2016

Fix so SPECIAL-USE assignments are forced only until user sets specia…
…l folders (#4782)

The old behaviour where SPECIAL-USE has always a prio can be bringed back
by setting lock_special_folders=false and adding it to dont_override.

alecpl added a commit that referenced this issue Apr 2, 2016

Fix so SPECIAL-USE assignments are forced only until user sets specia…
…l folders (#4782)

The old behaviour where SPECIAL-USE has always a prio can be bringed back
by setting lock_special_folders=false and adding it to dont_override.

@alecpl alecpl closed this Apr 2, 2016

@alecpl alecpl added the fixed label Apr 2, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment