<<< Date Index >>>     <<< Thread Index >>>

Re: Multiple IMAP accounts



Hello!

Ok, thank you advance!
And i have two small features proposal :)

------------------------------------------------------
1. 'beep_new' is good thing, but sometimes visual or other kind of
alerting is prefer way. It may be implemented like this:
------------------------------------------------------

--- globals.h.orig  Tue Apr 10 18:59:53 2007
+++ globals.h   Tue Apr 10 18:59:14 2007
@@ -67,6 +69,7 @@
 WHERE char *Inbox;
 WHERE char *Ispell;
 WHERE char *Locale;
+WHERE char *MailAlert;
 WHERE char *MailcapPath;
 WHERE char *Maildir;
 #if defined(USE_IMAP) || defined(USE_POP)
--- init.h.orig Tue Apr 10 19:00:02 2007
+++ init.h  Tue Apr 10 18:58:40 2007
@@ -1061,6 +1093,11 @@
   ** .pp
   ** The locale used by \fIstrftime(3)\fP to format dates. Legal values
are
   ** the strings your system accepts for the locale variable
\fILC_TIME\fP.
+  */
+  { "mailalert",   DT_STR,  R_NONE, UL &MailAlert, UL "" },
+  /*
+  ** .pp
+  ** When set, this is the path of executable script
   */
   { "mail_check",  DT_NUM,  R_NONE, UL &BuffyTimeout, 5 },
   /*
--- globals.h.orig  Tue Apr 10 18:59:53 2007
+++ globals.h   Tue Apr 10 18:59:14 2007
@@ -67,6 +69,7 @@
 WHERE char *Inbox;
 WHERE char *Ispell;
 WHERE char *Locale;
+WHERE char *MailAlert;
 WHERE char *MailcapPath;
 WHERE char *Maildir;
 #if defined(USE_IMAP) || defined(USE_POP)
--- init.h.orig Tue Apr 10 19:00:02 2007
+++ init.h  Tue Apr 10 18:58:40 2007
@@ -1061,6 +1093,11 @@
   ** .pp
   ** The locale used by \fIstrftime(3)\fP to format dates. Legal values
are
   ** the strings your system accepts for the locale variable
\fILC_TIME\fP.
+  */
+  { "mailalert",   DT_STR,  R_NONE, UL &MailAlert, UL "" },
+  /*
+  ** .pp
+  ** When set, this is the path of executable script
   */
   { "mail_check",  DT_NUM,  R_NONE, UL &BuffyTimeout, 5 },
   /*


------------------------------------------------------
2. 'imap-fetch-mail' function implemented via NOOP command and force
check only current mailbox, but where is the way to force check all
subscribed mailboxes? I'm trying such implementation:
------------------------------------------------------
--- curs_main.c.orig    Thu Apr 12 16:48:51 2007
+++ curs_main.c Thu Apr 12 16:49:05 2007
@@ -997,6 +997,13 @@
         break;
 #endif

+#ifdef USE_IMAP
+      case OP_MAIN_IMAP_FETCH_ALL:
+   if (Context && Context->magic == M_IMAP)
+     mutt_buffy_check(1);
+        break;
+#endif
+      
       case OP_MAIN_SYNC_FOLDER:

    if (Context && !Context->msgcount)
--- functions.h.orig    Thu Apr 12 17:04:59 2007
+++ functions.h Thu Apr 12 17:05:43 2007
@@ -108,6 +108,9 @@
 #ifdef USE_IMAP
   { "imap-fetch-mail",     OP_MAIN_IMAP_FETCH,     NULL },
 #endif
+#ifdef USE_IMAP
+  { "imap-fetch-all",      OP_MAIN_IMAP_FETCH_ALL, NULL },
+#endif
   { "display-toggle-weed",     OP_DISPLAY_HEADERS,     "h" },
   { "next-undeleted",      OP_MAIN_NEXT_UNDELETED,     "j" },
   { "previous-undeleted",  OP_MAIN_PREV_UNDELETED,     "k" },
@@ -188,6 +191,9 @@
   { "group-reply", OP_GROUP_REPLY,         "g" },
 #ifdef USE_IMAP
   { "imap-fetch-mail",  OP_MAIN_IMAP_FETCH,        NULL },
+#endif
+#ifdef USE_IMAP
+  { "imap-fetch-all",  OP_MAIN_IMAP_FETCH_ALL, NULL },
 #endif
   { "display-toggle-weed", OP_DISPLAY_HEADERS,     "h" },
   { "next-undeleted",  OP_MAIN_NEXT_UNDELETED,     "j" },
--- OPS.orig    Thu Apr 12 17:15:45 2007
+++ OPS Thu Apr 12 17:16:06 2007
@@ -102,6 +102,7 @@
 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_IMAP_FETCH_ALL "force retrieval of mail from IMAP server (all
folders)"
 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"



On Thu, Apr 12, 2007 at 10:15:24AM -0700, Brendan Cully wrote:
> On Thursday, 12 April 2007 at 21:03, Oleg A. Mamontov wrote:
> > Hello!
> > 
> > During setting up my two different IMAP accounts (mutt 1.5.14) i have
> > some problem. Periodocaly check ('mail_check' setting) discover new
> > messages only in one account folders (if both accounts connected).
> > Searching sources, i've found that first server answer for STATUS question
> > may be received when account_hook switched 'imap_user' (and global variable
> > ImapUser) to other account. Then function mutt_account_match (account.c)
> > will return false and answer will ignored...
> > There is no problem, if both accounts have th same user name, but in my
> > situation they aren't :(
> > 
> > Now i'm happy with this simple patch:
> > 
> > --- account.c.orig  Mon Apr  9 21:45:19 2007
> > +++ account.c   Mon Apr  9 21:46:59 2007
> > @@ -56,10 +56,14 @@
> > 
> >    if (a1->flags & a2->flags & M_ACCT_USER)
> >      return (!strcmp (a1->user, a2->user));
> > +  /*
> >    if (a1->flags & M_ACCT_USER)
> >      return (!strcmp (a1->user, user));
> >    if (a2->flags & M_ACCT_USER)
> >      return (!strcmp (a2->user, user));
> > +  */
> > 
> >    return 1;
> >  }
> 
> Thanks for the report. This is a good diagnosis, but I'm not sure I
> trust the fix. I think we might need something a little safer. I'll
> try to look at it a little more closely in a week.



-- 
12.04.2007 21:26:48

Cheers,
Oleg A. Mamontov

mailto:  oleg@xxxxxxxxxxxx

icq uin: 79-521-617
cell:    +7-903-798-1352