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

IMAP STATUS: Support RFC 8438 STATUS=SIZE. #437

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/low-level/imap/mailimap.c
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,9 @@ static void mailbox_data_store(mailimap * session,
case MAILIMAP_STATUS_ATT_UNSEEN:
session->imap_selection_info->unseen = info->value;
break;
case MAILIMAP_STATUS_ATT_SIZE:
session->imap_selection_info->size = info->value;
break;
}
}
}
Expand Down
1 change: 1 addition & 0 deletions src/low-level/imap/mailimap_keywords.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ static struct mailimap_token_value status_att_tab[] = {
{MAILIMAP_STATUS_ATT_UIDVALIDITY, "UIDVALIDITY"},
{MAILIMAP_STATUS_ATT_UNSEEN, "UNSEEN"},
{MAILIMAP_STATUS_ATT_HIGHESTMODSEQ, "HIGHESTMODSEQ"},
{MAILIMAP_STATUS_ATT_SIZE, "SIZE"},
};

int mailimap_status_att_get_token_value(mailstream * fd, MMAPString * buffer,
Expand Down
3 changes: 3 additions & 0 deletions src/low-level/imap/mailimap_print.c
Original file line number Diff line number Diff line change
Expand Up @@ -942,6 +942,9 @@ static void mailimap_status_att_print(int status_att)
case MAILIMAP_STATUS_ATT_UNSEEN:
printf("status att unseen");
break;
case MAILIMAP_STATUS_ATT_SIZE:
printf("status att size");
break;
}

printf(" \n");
Expand Down
9 changes: 6 additions & 3 deletions src/low-level/imap/mailimap_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@
status = "STATUS" SP mailbox SP "(" status-att *(SP status-att) ")"

status-att = "MESSAGES" / "RECENT" / "UIDNEXT" / "UIDVALIDITY" /
"UNSEEN"
"UNSEEN" / "SIZE"

store = "STORE" SP set SP store-att-flags

Expand Down Expand Up @@ -1572,6 +1572,7 @@ enum {
MAILIMAP_STATUS_ATT_HIGHESTMODSEQ, /* when requesting the highest
mod-sequence value of all messages in
the mailbox */
MAILIMAP_STATUS_ATT_SIZE, /* when requesting the mailbox size */
MAILIMAP_STATUS_ATT_EXTENSION
};

Expand All @@ -1582,7 +1583,8 @@ enum {
- att is the type of mailbox STATUS, the value can be
MAILIMAP_STATUS_ATT_MESSAGES, MAILIMAP_STATUS_ATT_RECENT,
MAILIMAP_STATUS_ATT_UIDNEXT, MAILIMAP_STATUS_ATT_UIDVALIDITY,
MAILIMAP_STATUS_ATT_UNSEEN or MAILIMAP_STATUS_ATT_EXTENSION
MAILIMAP_STATUS_ATT_UNSEEN, MAILIMAP_STATUS_ATT_EXTENSION
or MAILIMAP_STATUS_ATT_SIZE

- value is the value of the given information

Expand Down Expand Up @@ -3154,7 +3156,8 @@ void mailimap_search_key_free(struct mailimap_search_key * key);
- list is a list of mailbox STATUS request type
(value of elements in the list can be MAILIMAP_STATUS_ATT_MESSAGES,
MAILIMAP_STATUS_ATT_RECENT, MAILIMAP_STATUS_ATT_UIDNEXT,
MAILIMAP_STATUS_ATT_UIDVALIDITY or MAILIMAP_STATUS_ATT_UNSEEN),
MAILIMAP_STATUS_ATT_UIDVALIDITY, MAILIMAP_STATUS_ATT_UNSEEN
or MAILIMAP_STATUS_ATT_SIZE),
each element should be allocated with malloc()
*/

Expand Down