OP_MAIN_CHANGE_FOLDER_READONLY "open a different folder in read only mode"
OP_MAIN_CLEAR_FLAG "clear a status flag from a message"
OP_MAIN_DELETE_PATTERN "delete messages matching a pattern"
+OP_MAIN_IMAP_FETCH "force retrieval of mail from IMAP server"
OP_MAIN_FETCH_MAIL "retrieve mail from POP server"
OP_MAIN_FIRST_MESSAGE "move to the first message"
OP_MAIN_LAST_MESSAGE "move to the last message"
{ "group-reply", OP_GROUP_REPLY, "g" },
#ifdef USE_POP
{ "fetch-mail", OP_MAIN_FETCH_MAIL, "G" },
+#endif
+#ifdef USE_IMAP
+ { "imap-fetch-mail", OP_MAIN_IMAP_FETCH, NULL },
#endif
{ "display-toggle-weed", OP_DISPLAY_HEADERS, "h" },
{ "next-undeleted", OP_MAIN_NEXT_UNDELETED, "j" },
{ "forward-message", OP_FORWARD_MESSAGE, "f" },
{ "flag-message", OP_FLAG_MESSAGE, "F" },
{ "group-reply", OP_GROUP_REPLY, "g" },
+#ifdef USE_IMAP
+ { "imap-fetch-mail", OP_MAIN_IMAP_FETCH, NULL },
+#endif
{ "display-toggle-weed", OP_DISPLAY_HEADERS, "h" },
{ "next-undeleted", OP_MAIN_NEXT_UNDELETED, "j" },
{ "next-entry", OP_NEXT_ENTRY, "J" },
WHERE LIST *MailLists INITVAL(0);
WHERE LIST *SubscribedLists INITVAL(0);
+#ifdef USE_IMAP
+WHERE time_t ImapLastCheck INITVAL(0);
+#endif
+
/* bit vector for boolean variables */
#ifdef MAIN_C
unsigned char Options[(OPTMAX + 7)/8];
{
/* overload keyboard timeout to avoid many mailbox checks in a row.
* Most users don't like having to wait exactly when they press a key. */
- static time_t LastCheck = 0;
IMAP_DATA* idata;
time_t now;
idata = (IMAP_DATA*) ctx->data;
now = time(NULL);
- if (now > LastCheck + Timeout) {
- LastCheck = now;
+ if (now > ImapLastCheck + Timeout) {
+ ImapLastCheck = now;
if (imap_exec (idata, "NOOP", 0) != 0)
{