imap/2772: Patch imap_recent option to use RECENT instead of UNSEEN
>Number: 2772
>Notify-List:
>Category: imap
>Synopsis: Patch imap_recent option to use RECENT instead of UNSEEN
>Confidential: no
>Severity: normal
>Priority: medium
>Responsible: mutt-dev
>State: open
>Keywords:
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sat Feb 17 00:27:14 +0100 2007
>Originator: Jørgen H. Fjeld
>Release: 3.104
>Organization:
Fjeld Kurs og Konsulenttjenester
>Environment:
All platforms
>Description:
Imap specification states that UNSEEN is the number of unread messages,
and RECENT is the number of new messages since mailbox was last
selected.
It appears that previous versions of mutt have used RECENT, so I assume
that the current behavior is intentional.
The way I use imap, I have several folders where I have not read all the
messages, and I don't want the folder to be selected unless it has new
messages. Old and unread messages does not warrant my attention, only
new and unread.
To keep the old behavior I have made an option imap_recent that, when
true turns on usage of RECENT, and when false, which is the default,
UNSEEN is used.
>How-To-Repeat:
Use mutt to connect to imap server, and observe that it reports folders with
unread but not recent messages when choosing c (select folder) and space (cycle
through folders with unread email).
>Fix:
The imap recent feature is not available without the patch.
The attached patch creates the imap_recent option, to optionally use recent
instead of unseen.
>Add-To-Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/x-diff; name="mutt_recent.patch"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="mutt_recent.patch"
SW5kZXg6IGluaXQuaAo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09ClJDUyBmaWxlOiAvaG9tZS9yb2Vzc2xlci9jdnMvbXV0
dC9pbml0LmgsdgpyZXRyaWV2aW5nIHJldmlzaW9uIDMuMTA0CmRpZmYgLXUgLXIzLjEwNCBpbml0
LmgKLS0tIGluaXQuaAkyMCBOb3YgMjAwNiAxNzo0OTo1NiAtMDAwMAkzLjEwNAorKysgaW5pdC5o
CTI4IEphbiAyMDA3IDE1OjUyOjA3IC0wMDAwCkBAIC05MTYsNiArOTE2LDEyI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zdGF0dXMtPnVpZG5leHQpCiAgICAg
ICAgICAgewotICAgICAgICAgICAgaW5jLT5uZXcgPSBzdGF0dXMtPnVuc2VlbjsKKyAgICAgICAg
ICAgICAgaWYgb3B0aW9uIChPUFRJTUFQUkVDRU5UKSB7CisgICAgICAgICAgICAgICAgICBpbmMt
Pm5ldyA9IHN0YXR1cy0+cmVjZW50OworICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAg
ICAgICAgICAgaW5jLT5uZXcgPSBzdGF0dXMtPnVuc2VlbjsKKyAgICAgICAgICAgICAgfQogICAg
ICAgICAgIH0KICAgICAgICAgfQogICAgICAgICBlbHNlCi0gICAgICAgICAgaW5jLT5uZXcgPSBz
dGF0dXMtPnVuc2VlbjsKKyAgICAgICAgICAgIGlmIG9wdGlvbiAoT1BUSU1BUFJFQ0VOVCkgewor
ICAgICAgICAgICAgICAgIGluYy0+bmV3ID0gc3RhdHVzLT5yZWNlbnQ7CisgICAgICAgICAgICB9
IGVsc2UgeworICAgICAgICAgICAgICAgIGluYy0+bmV3ID0gc3RhdHVzLT51bnNlZW47CisgICAg
ICAgICAgICB9CiAKICAgICAgICAgLyogZm9yY2VkIGJhY2sgdG8ga2VlcCBkZXRlY3RpbmcgbmV3
IG1haWwgdW50aWwgdGhlIG1haWxib3ggaXMgb3BlbmVkICovCiAgICAgICAgIHN0YXR1cy0+dWlk
bmV4dCA9IG9sZHVuOwpJbmRleDogaW1hcC9pbWFwLmMKPT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQpSQ1MgZmlsZTogL2hv
bWUvcm9lc3NsZXIvY3ZzL211dHQvaW1hcC9pbWFwLmMsdgpyZXRyaWV2aW5nIHJldmlzaW9uIDMu
ODgKZGlmZiAtdSAtcjMuODggaW1hcC5jCi0tLSBpbWFwL2ltYXAuYwkxNSBOb3YgMjAwNiAxODo1
MzoxNSAtMDAwMAkzLjg4CisrKyBpbWFwL2lt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