diff -Naur sources/mutt/mutt/buffy.c mutt/buffy.c
--- sources/mutt/mutt/buffy.c	2003-08-05 15:55:47.000000000 +0200
+++ mutt/buffy.c	2004-01-20 17:48:06.000000000 +0100
@@ -263,7 +263,7 @@
   char path[_POSIX_PATH_MAX];
   struct stat contex_sb;
   time_t t;
-
+  CONTEXT *ctx;
 #ifdef USE_IMAP
   /* update postponed count as well, on force */
   if (force)
@@ -296,6 +296,8 @@
   
   for (tmp = Incoming; tmp; tmp = tmp->next)
   {
+	if ( tmp->new == 1 )
+		tmp->has_new = 1;
     tmp->new = 0;
 
 #ifdef USE_IMAP
@@ -349,10 +351,25 @@
       case M_MBOX:
       case M_MMDF:
 
-	if (STAT_CHECK)
+	  {
+	if (STAT_CHECK || tmp->msgcount == 0)
 	{
+	  BUFFY b = *tmp;
+	  int msgcount = 0;
+	  int msg_unread = 0;
 	  BuffyCount++;
-	  tmp->new = 1;
+	  /* parse the mailbox, to see how much mail there is */
+	  ctx = mx_open_mailbox( tmp->path, M_READONLY | M_QUIET | M_NOSORT, NULL);
+	  if ( ctx ) {
+		msgcount = ctx->msgcount;
+		msg_unread = ctx->unread;
+		mx_close_mailbox(ctx, 0);
+	  }
+	  *tmp = b;
+	  tmp->msgcount = msgcount;
+	  tmp->msg_unread = msg_unread;
+	  if ( STAT_CHECK )
+		tmp->has_new = tmp->new = 1;
 	}
 #ifdef BUFFY_SIZE
 	else
@@ -364,7 +381,7 @@
 	if (tmp->newly_created &&
 	    (sb.st_ctime != sb.st_mtime || sb.st_ctime != sb.st_atime))
 	  tmp->newly_created = 0;
-
+	}
 	break;
 
       case M_MAILDIR:
@@ -375,6 +392,8 @@
 	  tmp->magic = 0;
 	  break;
 	}
+	tmp->msgcount = 0;
+	tmp->msg_unread = 0;
 	while ((de = readdir (dirp)) != NULL)
 	{
 	  char *p;
@@ -383,22 +402,61 @@
 	  {
 	    /* one new and undeleted message is enough */
 	    BuffyCount++;
-	    tmp->new = 1;
-	    break;
+	    tmp->has_new = tmp->new = 1;
+        tmp->msgcount++;
+		tmp->msg_unread++;
+	  }
+	}
+	closedir (dirp);
+	snprintf (path, sizeof (path), "%s/cur", tmp->path);
+	if ((dirp = opendir (path)) == NULL)
+	{
+	  tmp->magic = 0;
+	  break;
+	}
+	while ((de = readdir (dirp)) != NULL)
+	{
+	  char *p;
+	  if (*de->d_name != '.' && 
+	      (!(p = strstr (de->d_name, ":2,")) || !strchr (p + 3, 'T')))
+	  {
+	    /* one new and undeleted message is enough */
+	    BuffyCount++;
+	    tmp->has_new = tmp->new = 1;
+        tmp->msgcount++;
 	  }
 	}
 	closedir (dirp);
 	break;
 
       case M_MH:
-	if ((tmp->new = mh_buffy (tmp->path)) > 0)
-	  BuffyCount++;
+	{
+      DIR *dp;
+      struct dirent *de;
+	  if ((tmp->new = mh_buffy (tmp->path)) > 0)
+	    BuffyCount++;
+  
+      if ((dp = opendir (path)) == NULL)
+        break;
+	  tmp->msgcount = 0;
+      while ((de = readdir (dp)))
+      {
+        if (mh_valid_message (de->d_name))
+        {
+		  tmp->msgcount++;
+		  tmp->has_new = tmp->new = 1;
+        }
+      }
+      closedir (dp);
+    }
 	break;
 	
 #ifdef USE_IMAP
       case M_IMAP:
-	if ((tmp->new = imap_mailbox_check (tmp->path, 1)) > 0)
+	  tmp->msgcount = imap_mailbox_check(tmp->path, 0);
+	if ((tmp->new = imap_mailbox_check (tmp->path, 1)) > 0) {
 	  BuffyCount++;
+	}
 	else
 	  tmp->new = 0;
 
diff -Naur sources/mutt/mutt/buffy.h mutt/buffy.h
--- sources/mutt/mutt/buffy.h	2002-12-11 12:19:39.000000000 +0100
+++ mutt/buffy.h	2004-01-20 17:47:49.000000000 +0100
@@ -27,7 +27,11 @@
   long size;
 #endif				/* BUFFY_SIZE */
   struct buffy_t *next;
+  struct buffy_t *prev;
   short new;			/* mailbox has new mail */
+  short has_new;		/* set it new if new and not read */
+  int msgcount;			/* total number of messages */
+  int msg_unread;		/* number of unread messages */
   short notified;		/* user has been notified */
   short magic;			/* mailbox type */
   short newly_created;		/* mbox or mmdf just popped into existence */
diff -Naur sources/mutt/mutt/color.c mutt/color.c
--- sources/mutt/mutt/color.c	2003-09-19 15:03:25.000000000 +0200
+++ mutt/color.c	2004-01-20 17:47:49.000000000 +0100
@@ -89,6 +89,7 @@
   { "bold",		MT_COLOR_BOLD },
   { "underline",	MT_COLOR_UNDERLINE },
   { "index",		MT_COLOR_INDEX },
+  { "sidebarnew",	MT_COLOR_NEW },
   { NULL,		0 }
 };
 
diff -Naur sources/mutt/mutt/compose.c mutt/compose.c
--- sources/mutt/mutt/compose.c	2003-10-04 22:34:59.000000000 +0200
+++ mutt/compose.c	2004-01-20 17:47:49.000000000 +0100
@@ -67,7 +67,7 @@
 
 #define HDR_XOFFSET 10
 #define TITLE_FMT "%10s" /* Used for Prompts, which are ASCII */
-#define W (COLS - HDR_XOFFSET)
+#define W (COLS - HDR_XOFFSET - SidebarWidth)
 
 static char *Prompts[] =
 {
@@ -110,16 +110,16 @@
   if ((WithCrypto & APPLICATION_PGP) && (WithCrypto & APPLICATION_SMIME))
   {     
     if (!msg->security)
-      mvaddstr (HDR_CRYPT, 0,     "Security: ");
+      mvaddstr (HDR_CRYPT, SidebarWidth,     "Security: ");
     else if (msg->security & APPLICATION_SMIME)
-      mvaddstr (HDR_CRYPT, 0,     "  S/MIME: ");
+      mvaddstr (HDR_CRYPT, SidebarWidth,     "  S/MIME: ");
     else if (msg->security & APPLICATION_PGP)
-      mvaddstr (HDR_CRYPT, 0,     "     PGP: ");
+      mvaddstr (HDR_CRYPT, SidebarWidth,     "     PGP: ");
   }
   else if ((WithCrypto & APPLICATION_SMIME))
-    mvaddstr (HDR_CRYPT, 0,     "  S/MIME: ");
+    mvaddstr (HDR_CRYPT, SidebarWidth,     "  S/MIME: ");
   else if ((WithCrypto & APPLICATION_PGP))
-    mvaddstr (HDR_CRYPT, 0,     "     PGP: ");
+    mvaddstr (HDR_CRYPT, SidebarWidth,     "     PGP: ");
   else
     return;
 
@@ -133,7 +133,7 @@
     addstr (_("Clear"));
   clrtoeol ();
 
-  move (HDR_CRYPTINFO, 0);
+  move (HDR_CRYPTINFO, SidebarWidth);
   clrtoeol ();
   if ((WithCrypto & APPLICATION_PGP)
       && msg->security & APPLICATION_PGP  && msg->security & SIGN)
@@ -146,7 +146,7 @@
 
   if ((WithCrypto & APPLICATION_SMIME)
        && msg->security & APPLICATION_SMIME  && (msg->security & ENCRYPT)) {
-      mvprintw (HDR_CRYPTINFO, 40, "%s%s", _("Encrypt with: "),
+      mvprintw (HDR_CRYPTINFO, SidebarWidth + 40, "%s%s", _("Encrypt with: "),
 		NONULL(SmimeCryptAlg));
       off = 20;
   }
@@ -308,7 +308,7 @@
   int c;
   char *t;
 
-  mvaddstr (HDR_MIX, 0,     "     Mix: ");
+  mvaddstr (HDR_MIX, SidebarWidth,     "     Mix: ");
 
   if (!chain)
   {
@@ -323,7 +323,7 @@
     if (t && t[0] == '0' && t[1] == '\0')
       t = "<random>";
     
-    if (c + mutt_strlen (t) + 2 >= COLS)
+    if (c + mutt_strlen (t) + 2 >= COLS - SidebarWidth)
       break;
 
     addstr (NONULL(t));
@@ -375,7 +375,7 @@
 
   buf[0] = 0;
   rfc822_write_address (buf, sizeof (buf), addr, 1);
-  mvprintw (line, 0, TITLE_FMT, Prompts[line - 1]);
+  mvprintw (line, SidebarWidth, TITLE_FMT, Prompts[line - 1]);
   mutt_paddstr (W, buf);
 }
 
@@ -385,10 +385,10 @@
   draw_envelope_addr (HDR_TO, msg->env->to);
   draw_envelope_addr (HDR_CC, msg->env->cc);
   draw_envelope_addr (HDR_BCC, msg->env->bcc);
-  mvprintw (HDR_SUBJECT, 0, TITLE_FMT, Prompts[HDR_SUBJECT - 1]);
+  mvprintw (HDR_SUBJECT, SidebarWidth, TITLE_FMT, Prompts[HDR_SUBJECT - 1]);
   mutt_paddstr (W, NONULL (msg->env->subject));
   draw_envelope_addr (HDR_REPLYTO, msg->env->reply_to);
-  mvprintw (HDR_FCC, 0, TITLE_FMT, Prompts[HDR_FCC - 1]);
+  mvprintw (HDR_FCC, SidebarWidth, TITLE_FMT, Prompts[HDR_FCC - 1]);
   mutt_paddstr (W, fcc);
 
   if (WithCrypto)
@@ -399,7 +399,7 @@
 #endif
 
   SETCOLOR (MT_COLOR_STATUS);
-  mvaddstr (HDR_ATTACH - 1, 0, _("-- Attachments"));
+  mvaddstr (HDR_ATTACH - 1, SidebarWidth, _("-- Attachments"));
   BKGDSET (MT_COLOR_STATUS);
   clrtoeol ();
 
@@ -437,7 +437,7 @@
   /* redraw the expanded list so the user can see the result */
   buf[0] = 0;
   rfc822_write_address (buf, sizeof (buf), *addr, 1);
-  move (line, HDR_XOFFSET);
+  move (line, HDR_XOFFSET+SidebarWidth);
   mutt_paddstr (W, buf);
   
   return 0;
@@ -679,7 +679,7 @@
 	if (mutt_get_field ("Subject: ", buf, sizeof (buf), 0) == 0)
 	{
 	  mutt_str_replace (&msg->env->subject, buf);
-	  move (HDR_SUBJECT, HDR_XOFFSET);
+	  move (HDR_SUBJECT, HDR_XOFFSET + SidebarWidth);
 	  clrtoeol ();
 	  if (msg->env->subject)
 	    mutt_paddstr (W, msg->env->subject);
@@ -694,7 +694,7 @@
 	{
 	  strfcpy (fcc, buf, _POSIX_PATH_MAX);
 	  mutt_pretty_mailbox (fcc);
-	  move (HDR_FCC, HDR_XOFFSET);
+	  move (HDR_FCC, HDR_XOFFSET + SidebarWidth);
 	  mutt_paddstr (W, fcc);
 	  fccSet = 1;
 	}
diff -Naur sources/mutt/mutt/curs_main.c mutt/curs_main.c
--- sources/mutt/mutt/curs_main.c	2003-09-03 19:09:09.000000000 +0200
+++ mutt/curs_main.c	2004-01-20 17:47:49.000000000 +0100
@@ -534,6 +534,7 @@
     if (menu->redraw & REDRAW_FULL)
     {
       menu_redraw_full (menu);
+	  draw_sidebar(menu->menu);
       mutt_show_error ();
     }
 
@@ -556,7 +557,9 @@
 
       if (menu->redraw & REDRAW_STATUS) 
       {
+	DrawFullLine = 1;
 	menu_status_line (buf, sizeof (buf), menu, NONULL (Status));
+	DrawFullLine = 0;
 	CLEARLINE (option (OPTSTATUSONTOP) ? 0 : LINES-2);
 	SETCOLOR (MT_COLOR_STATUS);
 	mutt_paddstr (COLS, buf);
@@ -1033,6 +1036,7 @@
 	  menu->redraw = REDRAW_FULL;
 	break;
 
+	  case OP_OPEN_MBOX:
       case OP_MAIN_CHANGE_FOLDER:
       
 	if (attach_msg)
@@ -1050,7 +1054,9 @@
 	buf[0] = '\0';
 	mutt_buffy (buf, sizeof (buf));
 
-	if (mutt_enter_fname (cp, buf, sizeof (buf), &menu->redraw, 1) == -1)
+	if ( op == OP_OPEN_MBOX )
+	  strncpy( buf, CurBuffy->path, sizeof(buf) );
+	else if (mutt_enter_fname (cp, buf, sizeof (buf), &menu->redraw, 1) == -1)
 	  break;
 	if (!buf[0])
 	{
@@ -2071,6 +2077,12 @@
 	mutt_what_key();
 	break;
 
+	  case OP_SCROLL_MBOX_UP:
+	  case OP_SCROLL_MBOX_DOWN:
+	  case OP_NEXT_MBOX:
+	  case OP_PREV_MBOX:
+	    scroll_sidebar(op,menu);
+		break;
       default:
 	if (menu->menu == MENU_MAIN)
 	  km_error_key (MENU_MAIN);
diff -Naur sources/mutt/mutt/flags.c mutt/flags.c
--- sources/mutt/mutt/flags.c	2003-01-31 00:48:36.000000000 +0100
+++ mutt/flags.c	2004-01-20 17:47:49.000000000 +0100
@@ -270,6 +270,7 @@
    */
   if (h->searched && (changed != h->changed || deleted != ctx->deleted || tagged != ctx->tagged))
     h->searched = 0;
+	draw_sidebar(0);
 }
 
 void mutt_tag_set_flag (int flag, int bf)
diff -Naur sources/mutt/mutt/functions.h mutt/functions.h
--- sources/mutt/mutt/functions.h	2003-07-04 19:07:22.000000000 +0200
+++ mutt/functions.h	2004-01-20 17:47:49.000000000 +0100
@@ -149,6 +149,11 @@
   { "decrypt-save",		OP_DECRYPT_SAVE,		NULL },
 
 
+  { "scroll-mbox-up",	OP_SCROLL_MBOX_UP, NULL },
+  { "scroll-mbox-down",	OP_SCROLL_MBOX_DOWN, NULL },
+  { "next-mbox",	OP_NEXT_MBOX, NULL },
+  { "previous-mbox",	OP_PREV_MBOX, NULL },
+  { "open-mbox", OP_OPEN_MBOX, NULL },
   { NULL,			0,				NULL }
 };
 
@@ -243,6 +248,11 @@
   { "decrypt-save",    	OP_DECRYPT_SAVE,		NULL },
 
 
+  { "scroll-mbox-up",	OP_SCROLL_MBOX_UP, NULL },
+  { "scroll-mbox-down",	OP_SCROLL_MBOX_DOWN, NULL },
+  { "next-mbox",	OP_NEXT_MBOX, NULL },
+  { "previous-mbox",	OP_PREV_MBOX, NULL },
+  { "open-mbox", OP_OPEN_MBOX, NULL },
   { NULL,		0,				NULL }
 };
 
diff -Naur sources/mutt/mutt/globals.h mutt/globals.h
--- sources/mutt/mutt/globals.h	2003-07-15 13:41:32.000000000 +0200
+++ mutt/globals.h	2004-01-20 17:47:49.000000000 +0100
@@ -155,6 +155,9 @@
 WHERE short ScoreThresholdRead;
 WHERE short ScoreThresholdFlag;
 
+WHERE struct buffy_t *CurBuffy INITVAL(0);
+WHERE short DrawFullLine INITVAL(0);
+WHERE short SidebarWidth;
 #ifdef USE_IMAP
 WHERE short ImapKeepalive;
 #endif
diff -Naur sources/mutt/mutt/init.h mutt/init.h
--- sources/mutt/mutt/init.h	2004-01-04 11:55:20.000000000 +0100
+++ mutt/init.h	2004-01-20 17:47:49.000000000 +0100
@@ -1025,6 +1025,11 @@
   ** This specifies the folder into which read mail in your ``$$spoolfile''
   ** folder will be appended.
   */
+  { "mbox_pane_width", DT_NUM, R_BOTH, UL &SidebarWidth, 0 },
+  /*
+  ** .pp
+  ** The width of the mailbox list pane (left sidebar like in GUIs).
+  */
   { "mbox_type",	DT_MAGIC,R_NONE, UL &DefaultMagic, M_MBOX },
   /*
   ** .pp
diff -Naur sources/mutt/mutt/Makefile.am mutt/Makefile.am
--- sources/mutt/mutt/Makefile.am	2003-11-05 13:17:10.000000000 +0100
+++ mutt/Makefile.am	2004-01-20 17:47:49.000000000 +0100
@@ -28,7 +28,7 @@
 	score.c send.c sendlib.c signal.c sort.c \
 	status.c system.c thread.c charset.c history.c lib.c \
 	muttlib.c editmsg.c utf8.c mbyte.c wcwidth.c \
-	url.c ascii.c mutt_idna.c
+	url.c ascii.c mutt_idna.c sidebar.c
 
 mutt_LDADD = @MUTT_LIB_OBJECTS@ @LIBOBJS@ $(LIBIMAP) $(MUTTLIBS) \
 	$(INTLLIBS) $(LIBICONV)
@@ -62,7 +62,7 @@
 	mutt_tunnel.c pop.c pop_auth.c pop_lib.c smime.c pgp.c pgpinvoke.c pgpkey.c \
 	pgplib.c sha1.c pgpmicalg.c gnupgparse.c resize.c dotlock.c remailer.c \
 	browser.h mbyte.h remailer.h url.h mutt_ssl_nss.c \
-	pgppacket.c mutt_idna.h
+	pgppacket.c mutt_idna.h sidebar.h
 
 EXTRA_DIST = COPYRIGHT GPL OPS OPS.PGP OPS.CRYPT OPS.SMIME TODO \
 	configure acconfig.h account.h \
diff -Naur sources/mutt/mutt/menu.c mutt/menu.c
--- sources/mutt/mutt/menu.c	2004-01-04 11:25:13.000000000 +0100
+++ mutt/menu.c	2004-01-20 17:47:49.000000000 +0100
@@ -159,7 +159,7 @@
 void menu_pad_string (char *s, size_t n)
 {
   int shift = option (OPTARROWCURSOR) ? 3 : 0;
-  int cols = COLS - shift;
+  int cols = COLS - shift - SidebarWidth;
 
   mutt_format_string (s, n, cols, cols, 0, ' ', s, strlen (s), 1);
   s[n - 1] = 0;
@@ -209,6 +209,7 @@
   char buf[STRING];
   int i;
 
+	draw_sidebar(1);
   for (i = menu->top; i < menu->top + menu->pagelen; i++)
   {
     if (i < menu->max)
@@ -219,7 +220,7 @@
       if (option (OPTARROWCURSOR))
       {
         attrset (menu->color (i));
-	CLEARLINE (i - menu->top + menu->offset);
+	CLEARLINE_WIN (i - menu->top + menu->offset);
 
 	if (i == menu->current)
 	{
@@ -230,7 +231,7 @@
 	  addch (' ');
 	}
 	else
-	  move (i - menu->top + menu->offset, 3);
+	  move (i - menu->top + menu->offset, SidebarWidth + 3);
 
         print_enriched_string (menu->color(i), (unsigned char *) buf, 1);
         SETCOLOR (MT_COLOR_NORMAL);          
@@ -245,14 +246,14 @@
 	  BKGDSET (MT_COLOR_INDICATOR);
 	}
 
-	CLEARLINE (i - menu->top + menu->offset);
+	CLEARLINE_WIN (i - menu->top + menu->offset);
 	print_enriched_string (menu->color(i), (unsigned char *) buf, i != menu->current);
         SETCOLOR (MT_COLOR_NORMAL);
         BKGDSET (MT_COLOR_NORMAL);
       }
     }
     else
-      CLEARLINE (i - menu->top + menu->offset);
+      CLEARLINE_WIN (i - menu->top + menu->offset);
   }
   menu->redraw = 0;
 }
@@ -267,7 +268,7 @@
     return;
   }
   
-  move (menu->oldcurrent + menu->offset - menu->top, 0);
+  move (menu->oldcurrent + menu->offset - menu->top, SidebarWidth);
   SETCOLOR (MT_COLOR_NORMAL);
   BKGDSET (MT_COLOR_NORMAL);
 
@@ -282,13 +283,13 @@
       clrtoeol ();
       menu_make_entry (buf, sizeof (buf), menu, menu->oldcurrent);
       menu_pad_string (buf, sizeof (buf));
-      move (menu->oldcurrent + menu->offset - menu->top, 3);
+      move (menu->oldcurrent + menu->offset - menu->top, SidebarWidth + 3);
       print_enriched_string (menu->color(menu->oldcurrent), (unsigned char *) buf, 1);
       SETCOLOR (MT_COLOR_NORMAL);
     }
 
     /* now draw it in the new location */
-    move (menu->current + menu->offset - menu->top, 0);
+    move (menu->current + menu->offset - menu->top, SidebarWidth);
     attrset (menu->color (menu->current));
     ADDCOLOR (MT_COLOR_INDICATOR);
     addstr ("->");
@@ -309,7 +310,7 @@
     attrset (menu->color (menu->current));
     ADDCOLOR (MT_COLOR_INDICATOR);
     BKGDSET (MT_COLOR_INDICATOR);
-    CLEARLINE (menu->current - menu->top + menu->offset);
+    CLEARLINE_WIN (menu->current - menu->top + menu->offset);
     print_enriched_string (menu->color(menu->current), (unsigned char *) buf, 0);
     SETCOLOR (MT_COLOR_NORMAL);
     BKGDSET (MT_COLOR_NORMAL);
@@ -321,7 +322,7 @@
 {
   char buf[STRING];
   
-  move (menu->current + menu->offset - menu->top, 0);
+  move (menu->current + menu->offset - menu->top, SidebarWidth);
   menu_make_entry (buf, sizeof (buf), menu, menu->current);
   menu_pad_string (buf, sizeof (buf));
 
diff -Naur sources/mutt/mutt/mutt_curses.h mutt/mutt_curses.h
--- sources/mutt/mutt/mutt_curses.h	2003-07-16 13:17:31.000000000 +0200
+++ mutt/mutt_curses.h	2004-01-20 17:47:49.000000000 +0100
@@ -58,6 +58,7 @@
 #undef lines
 #endif /* lines */
 
+#define CLEARLINE_WIN(x) move(x,SidebarWidth), clrtoeol()
 #define CLEARLINE(x) move(x,0), clrtoeol()
 #define CENTERLINE(x,y) move(y, (COLS-strlen(x))/2), addstr(x)
 #define BEEP() do { if (option (OPTBEEP)) beep(); } while (0)
@@ -119,6 +120,7 @@
   MT_COLOR_BOLD,
   MT_COLOR_UNDERLINE,
   MT_COLOR_INDEX,
+  MT_COLOR_NEW,
   MT_COLOR_MAX
 };
 
diff -Naur sources/mutt/mutt/muttlib.c mutt/muttlib.c
--- sources/mutt/mutt/muttlib.c	2003-10-04 22:34:59.000000000 +0200
+++ mutt/muttlib.c	2004-01-20 17:47:49.000000000 +0100
@@ -1007,7 +1007,10 @@
 	ch = *src++; /* pad char */
 	/* calculate space left on line.  if we've already written more data
 	   than will fit on the line, ignore the rest of the line */
-	count = (COLS < destlen ? COLS : destlen);
+	if ( DrawFullLine )
+	  count = (COLS < destlen ? COLS : destlen);
+	else
+	  count = ((COLS-SidebarWidth) < destlen ? COLS - SidebarWidth : destlen);
 	if (count > wlen)
 	{
 	  count -= wlen; /* how many chars left on this line */
diff -Naur sources/mutt/mutt/OPS mutt/OPS
--- sources/mutt/mutt/OPS	2003-07-04 19:07:22.000000000 +0200
+++ mutt/OPS	2004-01-20 17:47:49.000000000 +0100
@@ -174,3 +174,8 @@
 OP_MAIN_SHOW_LIMIT "show currently active limit pattern"
 OP_MAIN_COLLAPSE_THREAD "collapse/uncollapse current thread"
 OP_MAIN_COLLAPSE_ALL "collapse/uncollapse all threads"
+OP_SCROLL_MBOX_UP "scroll the mailbox pane up 1 page"
+OP_SCROLL_MBOX_DOWN "scroll the mailbox pane down 1 page"
+OP_NEXT_MBOX "go down to next mailbox"
+OP_PREV_MBOX "go to previous mailbox"
+OP_OPEN_MBOX "open hilighted mailbox"
diff -Naur sources/mutt/mutt/pager.c mutt/pager.c
--- sources/mutt/mutt/pager.c	2003-12-03 09:19:11.000000000 +0100
+++ mutt/pager.c	2004-01-20 17:47:49.000000000 +0100
@@ -1032,7 +1032,7 @@
   wchar_t wc;
   mbstate_t mbstate;
 
-  int wrap_cols = COLS - WrapMargin;
+  int wrap_cols = COLS - WrapMargin - SidebarWidth;
   
   if (wrap_cols <= 0)
     wrap_cols = COLS;
@@ -1665,7 +1665,7 @@
     if ((redraw & REDRAW_BODY) || topline != oldtopline)
     {
       do {
-	move (bodyoffset, 0);
+	move (bodyoffset, SidebarWidth);
 	curline = oldtopline = topline;
 	lines = 0;
 	force_redraw = 0;
@@ -1678,6 +1678,7 @@
 			    &QuoteList, &q_level, &force_redraw, &SearchRE) > 0)
 	    lines++;
 	  curline++;
+		move(lines + bodyoffset, SidebarWidth);
 	}
 	last_offset = lineInfo[curline].offset;
       } while (force_redraw);
@@ -1691,6 +1692,7 @@
 	  addch ('~');
 	addch ('\n');
 	lines++;
+	move(lines + bodyoffset, SidebarWidth);
       }
       /* We are going to update the pager status bar, so it isn't
        * necessary to reset to normal color now. */
@@ -1703,20 +1705,22 @@
       /* print out the pager status bar */
       SETCOLOR (MT_COLOR_STATUS);
       BKGDSET (MT_COLOR_STATUS);
-      CLEARLINE (statusoffset);
+      CLEARLINE_WIN(statusoffset);
       if (IsHeader (extra))
       {
 	_mutt_make_string (buffer,
-			   COLS-9 < sizeof (buffer) ? COLS-9 : sizeof (buffer),
+			   COLS-9-SidebarWidth < sizeof (buffer) ?
+			   COLS-9-SidebarWidth : sizeof (buffer),
 			   NONULL (PagerFmt), Context, extra->hdr, M_FORMAT_MAKEPRINT);
       }
       else if (IsMsgAttach (extra))
       {
 	_mutt_make_string (buffer,
-			   COLS - 9 < sizeof (buffer) ? COLS - 9: sizeof (buffer),
+			   COLS - 9 - SidebarWidth < sizeof (buffer) ?
+			   COLS - 9 - SidebarWidth : sizeof (buffer),
 			   NONULL (PagerFmt), Context, extra->bdy->hdr, M_FORMAT_MAKEPRINT);
       }
-      mutt_paddstr (COLS-10, IsHeader (extra) || IsMsgAttach (extra) ?
+      mutt_paddstr (COLS-10-SidebarWidth, IsHeader (extra) || IsMsgAttach (extra) ?
 		    buffer : banner);
       addstr (" -- (");
       if (last_pos < sb.st_size - 1)
@@ -1732,15 +1736,18 @@
       /* redraw the pager_index indicator, because the
        * flags for this message might have changed. */
       menu_redraw_current (index);
-
+	  draw_sidebar(MENU_PAGER);
       /* print out the index status bar */
       menu_status_line (buffer, sizeof (buffer), index, NONULL(Status));
- 
-      move (indexoffset + (option (OPTSTATUSONTOP) ? 0 : (indexlen - 1)), 0);
+      move (indexoffset + (option (OPTSTATUSONTOP) ? 0 : (indexlen - 1)),
+		  SidebarWidth);
       SETCOLOR (MT_COLOR_STATUS);
-      mutt_paddstr (COLS, buffer);
+      mutt_paddstr (COLS-SidebarWidth, buffer);
       SETCOLOR (MT_COLOR_NORMAL);
     }
+	/* if we're not using the index, update every time */
+	if ( index == 0 )
+		draw_sidebar(MENU_PAGER);
 
     redraw = 0;
 
@@ -2607,6 +2614,13 @@
         redraw = REDRAW_FULL;
         break;
 
+	  case OP_SCROLL_MBOX_UP:
+	  case OP_SCROLL_MBOX_DOWN:
+	  case OP_NEXT_MBOX:
+	  case OP_PREV_MBOX:
+	  case OP_OPEN_MBOX:
+	    scroll_sidebar(ch, MENU_PAGER);
+		break;
       default:
 	ch = -1;
 	break;
diff -Naur sources/mutt/mutt/PATCHES mutt/PATCHES
--- sources/mutt/mutt/PATCHES	2002-12-09 18:44:54.000000000 +0100
+++ mutt/PATCHES	2004-01-20 17:47:49.000000000 +0100
@@ -0,0 +1 @@
+patch-1.5.4.jrh.sidebar.8
diff -Naur sources/mutt/mutt/sidebar.c mutt/sidebar.c
--- sources/mutt/mutt/sidebar.c	1970-01-01 01:00:00.000000000 +0100
+++ mutt/sidebar.c	2004-01-20 17:47:49.000000000 +0100
@@ -0,0 +1,168 @@
+#include "sidebar.h"
+#include "buffy.h"
+#include <libgen.h>
+#include "keymap.h"
+
+/*BUFFY *CurBuffy = 0;*/
+static BUFFY *TopBuffy = 0;
+static BUFFY *BottomBuffy = 0;
+static int known_lines = 0;
+
+static int quick_log10(int n)
+{
+	int c = 0;
+	if ( n == 0 ) return 0;
+	while ( n > 0 ) {
+		n /= 10;
+		c++;
+	}
+	return c;
+}
+
+void calc_boundaries (int skip_end)
+{
+	BUFFY *tmp = Incoming;
+
+	if ( known_lines != LINES ) {
+		TopBuffy = CurBuffy = BottomBuffy = 0;
+		known_lines = LINES;
+	}
+	for ( ; tmp->next != 0; tmp = tmp->next )
+		tmp->next->prev = tmp;
+
+	if ( TopBuffy == 0 && BottomBuffy == 0 )
+		TopBuffy = Incoming;
+	if ( BottomBuffy == 0 ) {
+		int count = LINES - 2 - (skip_end != MENU_PAGER);
+		BottomBuffy = TopBuffy;
+		while ( --count && BottomBuffy->next )
+			BottomBuffy = BottomBuffy->next;
+	}
+	else if ( TopBuffy == CurBuffy->next ) {
+		int count = LINES - 2 - (skip_end != MENU_PAGER);
+		BottomBuffy = CurBuffy;
+		tmp = BottomBuffy;
+		while ( --count && tmp->prev)
+			tmp = tmp->prev;
+		TopBuffy = tmp;
+	}
+	else if ( BottomBuffy == CurBuffy->prev ) {
+		int count = LINES - 2 - (skip_end != MENU_PAGER);
+		TopBuffy = CurBuffy;
+		tmp = TopBuffy;
+		while ( --count && tmp->next )
+			tmp = tmp->next;
+		BottomBuffy = tmp;
+	}
+}
+
+char *make_sidebar_entry(char *box, int size, int new)
+{
+	static char *entry = 0;
+	char *c;
+	int i = 0;
+	c = realloc(entry, SidebarWidth + 1);
+	if ( c ) entry = c;
+	entry[SidebarWidth] = 0;
+	for (; i < SidebarWidth; entry[i++] = ' ' );
+	i = strlen(box);
+	strncpy( entry, box, i < SidebarWidth ? i :SidebarWidth );
+	if ( new ) 
+		sprintf(
+			entry + SidebarWidth - 5 - quick_log10(size) - quick_log10(new),
+			"% d(%d)", size, new);
+	else
+		sprintf( entry + SidebarWidth - 3 - quick_log10(size), "% d", size);
+	return entry;
+}
+
+int draw_sidebar(int skip_end) {
+
+	int lines = 1;
+	BUFFY *tmp;
+
+	if ( SidebarWidth == 0 ) return 0;
+
+	SETCOLOR(MT_COLOR_STATUS);
+	/* draw the divider */
+	for ( ; lines < LINES-1-(skip_end != MENU_PAGER); lines++ ) {
+		move(lines, SidebarWidth - 1);
+		addch('|');
+	}
+	if ( Incoming == 0 ) return 0;
+	lines = 1;	/* go back to the top */
+
+	if ( known_lines != LINES || TopBuffy == 0 || BottomBuffy == 0 ) 
+		calc_boundaries(skip_end);
+	if ( CurBuffy == 0 ) CurBuffy = Incoming;
+
+	tmp = TopBuffy;
+
+	SETCOLOR(MT_COLOR_NORMAL);
+
+	for ( ; tmp && lines < LINES-1 - (skip_end != MENU_PAGER); tmp = tmp->next ) {
+		if ( tmp == CurBuffy )
+			SETCOLOR(MT_COLOR_INDICATOR);
+		else if ( tmp->msg_unread > 0 )
+			SETCOLOR(MT_COLOR_NEW);
+		else
+			SETCOLOR(MT_COLOR_NORMAL);
+
+		move( lines, 0 );
+		if ( Context && !strcmp( tmp->path, Context->path ) ) {
+			printw( "%.*s", SidebarWidth,
+				make_sidebar_entry(basename(tmp->path), Context->msgcount,
+				Context->unread));
+			tmp->msg_unread = Context->unread;
+		}
+		else
+			printw( "%.*s", SidebarWidth,
+				make_sidebar_entry(basename(tmp->path), tmp->msgcount,
+				tmp->msg_unread));
+		lines++;
+	}
+	SETCOLOR(MT_COLOR_NORMAL);
+	for ( ; lines < LINES - 1 - (skip_end != MENU_PAGER); lines++ ) {
+		int i = 0;
+		move( lines, 0 );
+		for ( ; i < SidebarWidth - 1; i++ )
+			addch(' ');
+	}
+	return 0;
+}
+
+void scroll_sidebar(int op, int menu)
+{
+	switch (op) {
+		case OP_NEXT_MBOX:
+			if ( CurBuffy->next == NULL ) return;
+			CurBuffy = CurBuffy->next;
+			break;
+		case OP_PREV_MBOX:
+			if ( CurBuffy == Incoming ) return;
+			{
+				BUFFY *tmp = Incoming;
+				while ( tmp->next && strcmp(tmp->next->path, CurBuffy->path) ) tmp = tmp->next;
+				CurBuffy = tmp;
+			}
+			break;
+		case OP_SCROLL_MBOX_UP:
+			CurBuffy = TopBuffy;
+			if ( CurBuffy != Incoming ) {
+				calc_boundaries(menu);
+				CurBuffy = CurBuffy->prev;
+			}
+			break;
+		case OP_SCROLL_MBOX_DOWN:
+			CurBuffy = BottomBuffy;
+			if ( CurBuffy->next ) {
+				calc_boundaries(menu);
+				CurBuffy = CurBuffy->next;
+			}
+			break;
+		default:
+			return;
+	}
+	calc_boundaries(menu);
+	draw_sidebar(menu);
+}
diff -Naur sources/mutt/mutt/sidebar.h mutt/sidebar.h
--- sources/mutt/mutt/sidebar.h	1970-01-01 01:00:00.000000000 +0100
+++ mutt/sidebar.h	2004-01-20 17:47:49.000000000 +0100
@@ -0,0 +1,13 @@
+#include "mutt.h"
+#include "mutt_curses.h"
+
+struct MBOX_LIST {
+	char *path;
+	int msgcount;
+	int new;
+} MBLIST;
+
+/* parameter is whether or not to go to the status line */
+/* used for omitting the last | that covers up the status bar in the index */
+int draw_sidebar(int);
+void scroll_sidebar(int, int);
