]> git.pld-linux.org Git - packages/mutt.git/blobdiff - mutt-vvv.nntp.patch
http://mutt.org.ua/download/mutt-1.5.21/patch-1.5.21.vvv.nntp.gz
[packages/mutt.git] / mutt-vvv.nntp.patch
index db4bd9ef33d52ef182f166d41831f924b2e22476..aee85528297231b708eedd85392059f21666b3f7 100644 (file)
@@ -9,10 +9,53 @@ autoconf
 Vsevolod Volkov <vvv@mutt.org.ua>
 
 
-diff -udprP mutt-1.5.13.orig/ChangeLog.nntp mutt-1.5.13/ChangeLog.nntp
---- mutt-1.5.13.orig/ChangeLog.nntp    1970-01-01 03:00:00.000000000 +0300
-+++ mutt-1.5.13/ChangeLog.nntp 2006-08-15 13:12:32.000000000 +0300
-@@ -0,0 +1,332 @@
+diff -udprP mutt-1.5.21.orig/ChangeLog.nntp mutt-1.5.21/ChangeLog.nntp
+--- mutt-1.5.21.orig/ChangeLog.nntp    1970-01-01 03:00:00.000000000 +0300
++++ mutt-1.5.21/ChangeLog.nntp 2010-09-16 13:14:39.000000000 +0300
+@@ -0,0 +1,375 @@
++* Wed Sep 16 2010 Vsevolod Volkov <vvv@mutt.org.ua>
++- update to 1.5.21
++
++* Thu Aug 13 2009 Vsevolod Volkov <vvv@mutt.org.ua>
++- fixed writting references in nntp_save_cache_group()
++
++* Tue Jun 15 2009 Vsevolod Volkov <vvv@mutt.org.ua>
++- update to 1.5.20
++
++* Tue Mar 20 2009 Vsevolod Volkov <vvv@mutt.org.ua>
++- save Date: header of recorded outgoing articles
++
++* Tue Jan  6 2009 Vsevolod Volkov <vvv@mutt.org.ua>
++- update to 1.5.19
++
++* Mon May 19 2008 Vsevolod Volkov <vvv@mutt.org.ua>
++- update to 1.5.18
++- fixed SIGSEGV when followup or forward to newsgroup
++
++* Sun Nov  4 2007 Vsevolod Volkov <vvv@mutt.org.ua>
++- update to 1.5.17
++
++* Tue Jul  3 2007 Vsevolod Volkov <vvv@mutt.org.ua>
++- fixed arguments of nntp_format_str()
++
++* Fri Jun 15 2007 Vsevolod Volkov <vvv@mutt.org.ua>
++- fixed error selecting news group
++
++* Tue Jun 12 2007 Vsevolod Volkov <vvv@mutt.org.ua>
++- update to 1.5.16
++
++* Wed Apr 11 2007 Vsevolod Volkov <vvv@mutt.org.ua>
++- fixed posting error if $smtp_url is set
++- added support of print-style sequence %R (x-comment-to)
++
++* Sun Apr  8 2007 Vsevolod Volkov <vvv@mutt.org.ua>
++- update to 1.5.15
++- nntp://... url changed to news://...
++- added indicator of fetching descriptions progress
++
++* Tue Feb 28 2007 Vsevolod Volkov <vvv@mutt.org.ua>
++- update to 1.5.14
++
 +* Tue Aug 15 2006 Vsevolod Volkov <vvv@mutt.org.ua>
 +- update to 1.5.13
 +
@@ -345,23 +388,23 @@ diff -udprP mutt-1.5.13.orig/ChangeLog.nntp mutt-1.5.13/ChangeLog.nntp
 +
 +* Fri Jan 28 2000 Vsevolod Volkov <vvv@mutt.kiev.ua>
 +- update to 1.1.2
-diff -udprP mutt-1.5.13.orig/OPS mutt-1.5.13/OPS
---- mutt-1.5.13.orig/OPS       2005-07-24 19:56:42.000000000 +0300
-+++ mutt-1.5.13/OPS    2006-08-15 13:04:56.000000000 +0300
+diff -udprP mutt-1.5.21.orig/OPS mutt-1.5.21/OPS
+--- mutt-1.5.21.orig/OPS       2010-03-01 19:56:19.000000000 +0200
++++ mutt-1.5.21/OPS    2010-09-16 13:14:39.000000000 +0300
 @@ -8,14 +8,16 @@ OP_BOUNCE_MESSAGE "remail a message to a
  OP_BROWSER_NEW_FILE "select a new file in this directory"
  OP_BROWSER_VIEW_FILE "view file"
  OP_BROWSER_TELL "display the currently selected file's name"
 -OP_BROWSER_SUBSCRIBE "subscribe to current mailbox (IMAP only)"
--OP_BROWSER_UNSUBSCRIBE "unsubscribe to current mailbox (IMAP only)"
-+OP_BROWSER_SUBSCRIBE "subscribe to current (IMAP/NNTP only)"
-+OP_BROWSER_UNSUBSCRIBE "unsubscribe to current (IMAP/NNTP only)"
+-OP_BROWSER_UNSUBSCRIBE "unsubscribe from current mailbox (IMAP only)"
++OP_BROWSER_SUBSCRIBE "subscribe to current mbox (IMAP/NNTP only)"
++OP_BROWSER_UNSUBSCRIBE "unsubscribe from current mbox (IMAP/NNTP only)"
  OP_BROWSER_TOGGLE_LSUB "toggle view all/subscribed mailboxes (IMAP only)"
  OP_BUFFY_LIST "list mailboxes with new mail"
 +OP_CATCHUP "mark all articles in newsgroup as read"
  OP_CHANGE_DIRECTORY "change directories"
  OP_CHECK_NEW "check mailboxes for new mail"
- OP_COMPOSE_ATTACH_FILE "attach file(s) to this message"
+ OP_COMPOSE_ATTACH_FILE "attach file(s) to this message"
  OP_COMPOSE_ATTACH_MESSAGE "attach message(s) to this message"
 +OP_COMPOSE_ATTACH_NEWS_MESSAGE "attach newsmessage(s) to this message"
  OP_COMPOSE_EDIT_BCC "edit the BCC list"
@@ -407,7 +450,7 @@ diff -udprP mutt-1.5.13.orig/OPS mutt-1.5.13/OPS
  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"
-@@ -136,6 +149,7 @@ OP_PAGER_HIDE_QUOTED "toggle display of 
+@@ -138,6 +151,7 @@ OP_PAGER_HIDE_QUOTED "toggle display of 
  OP_PAGER_SKIP_QUOTED "skip beyond quoted text"
  OP_PAGER_TOP "jump to the top of the message"
  OP_PIPE "pipe message/attachment to a shell command"
@@ -415,7 +458,7 @@ diff -udprP mutt-1.5.13.orig/OPS mutt-1.5.13/OPS
  OP_PREV_ENTRY "move to the previous entry"
  OP_PREV_LINE "scroll up one line"
  OP_PREV_PAGE "move to the previous page"
-@@ -144,6 +158,7 @@ OP_QUERY "query external program for add
+@@ -146,6 +160,7 @@ OP_QUERY "query external program for add
  OP_QUERY_APPEND "append new query results to current results"
  OP_QUIT "save changes to mailbox and quit"
  OP_RECALL_MESSAGE "recall a postponed message"
@@ -423,7 +466,7 @@ diff -udprP mutt-1.5.13.orig/OPS mutt-1.5.13/OPS
  OP_REDRAW "clear and redraw the screen"
  OP_REFORMAT_WINCH "{internal}"
  OP_RENAME_MAILBOX "rename the current mailbox (IMAP only)"
-@@ -158,18 +173,22 @@ OP_SEARCH_TOGGLE "toggle search pattern 
+@@ -160,18 +175,22 @@ OP_SEARCH_TOGGLE "toggle search pattern 
  OP_SHELL_ESCAPE "invoke a command in a subshell"
  OP_SORT "sort messages"
  OP_SORT_REVERSE "sort messages in reverse order"
@@ -446,15 +489,15 @@ diff -udprP mutt-1.5.13.orig/OPS mutt-1.5.13/OPS
  OP_VERSION "show the Mutt version number and date"
  OP_VIEW_ATTACH "view attachment using mailcap entry if necessary"
  OP_VIEW_ATTACHMENTS "show MIME attachments"
-diff -udprP mutt-1.5.13.orig/PATCHES mutt-1.5.13/PATCHES
---- mutt-1.5.13.orig/PATCHES   2006-08-11 13:55:43.000000000 +0300
-+++ mutt-1.5.13/PATCHES        2006-08-15 13:04:56.000000000 +0300
+diff -udprP mutt-1.5.21.orig/PATCHES mutt-1.5.21/PATCHES
+--- mutt-1.5.21.orig/PATCHES   2008-03-19 22:07:06.000000000 +0200
++++ mutt-1.5.21/PATCHES        2010-09-16 13:14:39.000000000 +0300
 @@ -0,0 +1 @@
 +vvv.nntp
-diff -udprP mutt-1.5.13.orig/account.c mutt-1.5.13/account.c
---- mutt-1.5.13.orig/account.c 2005-09-18 11:22:21.000000000 +0300
-+++ mutt-1.5.13/account.c      2006-08-15 13:04:56.000000000 +0300
-@@ -54,6 +54,11 @@ int mutt_account_match (const ACCOUNT* a
+diff -udprP mutt-1.5.21.orig/account.c mutt-1.5.21/account.c
+--- mutt-1.5.21.orig/account.c 2009-08-25 22:08:52.000000000 +0300
++++ mutt-1.5.21/account.c      2010-09-16 13:14:39.000000000 +0300
+@@ -51,6 +51,11 @@ int mutt_account_match (const ACCOUNT* a
      user = PopUser;
  #endif
    
@@ -466,7 +509,7 @@ diff -udprP mutt-1.5.13.orig/account.c mutt-1.5.13/account.c
    if (a1->flags & a2->flags & M_ACCT_USER)
      return (!strcmp (a1->user, a2->user));
    if (a1->flags & M_ACCT_USER)
-@@ -123,6 +128,16 @@ void mutt_account_tourl (ACCOUNT* accoun
+@@ -130,6 +135,16 @@ void mutt_account_tourl (ACCOUNT* accoun
    }
  #endif
  
@@ -483,7 +526,7 @@ diff -udprP mutt-1.5.13.orig/account.c mutt-1.5.13/account.c
    url->host = account->host;
    if (account->flags & M_ACCT_PORT)
      url->port = account->port;
-@@ -148,6 +163,10 @@ int mutt_account_getuser (ACCOUNT* accou
+@@ -155,6 +170,10 @@ int mutt_account_getuser (ACCOUNT* accou
    else if ((account->type == M_ACCT_TYPE_POP) && PopUser)
      strfcpy (account->user, PopUser, sizeof (account->user));
  #endif
@@ -491,34 +534,36 @@ diff -udprP mutt-1.5.13.orig/account.c mutt-1.5.13/account.c
 +  else if ((account->type == M_ACCT_TYPE_NNTP) && NntpUser)
 +    strfcpy (account->user, NntpUser, sizeof (account->user));
 +#endif
+   else if (option (OPTNOCURSES))
+     return -1;
    /* prompt (defaults to unix username), copy into account->user */
-   else
-   {
-@@ -204,6 +223,10 @@ int mutt_account_getpass (ACCOUNT* accou
-   else if ((account->type == M_ACCT_TYPE_POP) && PopPass)
-     strfcpy (account->pass, PopPass, sizeof (account->pass));
+@@ -217,6 +236,10 @@ int mutt_account_getpass (ACCOUNT* accou
+   else if ((account->type == M_ACCT_TYPE_SMTP) && SmtpPass)
+     strfcpy (account->pass, SmtpPass, sizeof (account->pass));
  #endif
 +#ifdef USE_NNTP
 +  else if ((account->type == M_ACCT_TYPE_NNTP) && NntpPass)
 +    strfcpy (account->pass, NntpPass, sizeof (account->pass));
 +#endif
+   else if (option (OPTNOCURSES))
+     return -1;
    else
-   {
-     snprintf (prompt, sizeof (prompt), _("Password for %s@%s: "),
-diff -udprP mutt-1.5.13.orig/account.h mutt-1.5.13/account.h
---- mutt-1.5.13.orig/account.h 2005-09-18 11:22:21.000000000 +0300
-+++ mutt-1.5.13/account.h      2006-08-15 13:04:56.000000000 +0300
-@@ -28,6 +28,7 @@ enum
- {
+diff -udprP mutt-1.5.21.orig/account.h mutt-1.5.21/account.h
+--- mutt-1.5.21.orig/account.h 2008-03-19 22:07:06.000000000 +0200
++++ mutt-1.5.21/account.h      2010-09-16 13:14:39.000000000 +0300
+@@ -29,7 +29,8 @@ enum
    M_ACCT_TYPE_NONE = 0,
    M_ACCT_TYPE_IMAP,
-+  M_ACCT_TYPE_NNTP,
-   M_ACCT_TYPE_POP
+   M_ACCT_TYPE_POP,
+-  M_ACCT_TYPE_SMTP
++  M_ACCT_TYPE_SMTP,
++  M_ACCT_TYPE_NNTP
  };
  
-diff -udprP mutt-1.5.13.orig/attach.h mutt-1.5.13/attach.h
---- mutt-1.5.13.orig/attach.h  2005-09-18 11:22:21.000000000 +0300
-+++ mutt-1.5.13/attach.h       2006-08-15 13:04:56.000000000 +0300
+ /* account flags */
+diff -udprP mutt-1.5.21.orig/attach.h mutt-1.5.21/attach.h
+--- mutt-1.5.21.orig/attach.h  2008-03-19 22:07:06.000000000 +0200
++++ mutt-1.5.21/attach.h       2010-09-16 13:14:39.000000000 +0300
 @@ -50,7 +50,7 @@ void mutt_print_attachment_list (FILE *f
  
  void mutt_attach_bounce (FILE *, HEADER *, ATTACHPTR **, short, BODY *);
@@ -528,9 +573,9 @@ diff -udprP mutt-1.5.13.orig/attach.h mutt-1.5.13/attach.h
  void mutt_attach_reply (FILE *, HEADER *, ATTACHPTR **, short, BODY *, int);
  
  #endif /* _ATTACH_H_ */
-diff -udprP mutt-1.5.13.orig/browser.c mutt-1.5.13/browser.c
---- mutt-1.5.13.orig/browser.c 2006-08-06 01:17:37.000000000 +0300
-+++ mutt-1.5.13/browser.c      2006-08-15 13:04:56.000000000 +0300
+diff -udprP mutt-1.5.21.orig/browser.c mutt-1.5.21/browser.c
+--- mutt-1.5.21.orig/browser.c 2010-08-25 19:31:40.000000000 +0300
++++ mutt-1.5.21/browser.c      2010-09-16 13:14:39.000000000 +0300
 @@ -32,6 +32,9 @@
  #ifdef USE_IMAP
  #include "imap.h"
@@ -541,8 +586,8 @@ diff -udprP mutt-1.5.13.orig/browser.c mutt-1.5.13/browser.c
  
  #include <stdlib.h>
  #include <dirent.h>
-@@ -49,6 +52,19 @@ static struct mapping_t FolderHelp[] = {
-   { NULL }
+@@ -50,6 +53,19 @@ static struct mapping_t FolderHelp[] = {
+   { NULL,      0 }
  };
  
 +#ifdef USE_NNTP
@@ -561,7 +606,7 @@ diff -udprP mutt-1.5.13.orig/browser.c mutt-1.5.13/browser.c
  typedef struct folder_t
  {
    struct folder_file *ff;
-@@ -114,9 +130,17 @@ static void browser_sort (struct browser
+@@ -115,9 +131,17 @@ static void browser_sort (struct browser
      case SORT_ORDER:
        return;
      case SORT_DATE:
@@ -579,13 +624,13 @@ diff -udprP mutt-1.5.13.orig/browser.c mutt-1.5.13/browser.c
        f = browser_compare_size;
        break;
      case SORT_SUBJECT:
-@@ -306,8 +330,106 @@ folder_format_str (char *dest, size_t de
+@@ -324,8 +348,106 @@ folder_format_str (char *dest, size_t de
    return (src);
  }
  
 +#ifdef USE_NNTP
 +static const char *
-+newsgroup_format_str (char *dest, size_t destlen, char op, const char *src,
++newsgroup_format_str (char *dest, size_t destlen, size_t col, char op, const char *src,
 +                     const char *fmt, const char *ifstring, const char *elsestring,
 +                     unsigned long data, format_flag flags)
 +{
@@ -625,10 +670,10 @@ diff -udprP mutt-1.5.13.orig/browser.c mutt-1.5.13/browser.c
 +      if (flags & M_FORMAT_OPTIONAL)
 +      {
 +      if (folder->ff->nd->unread != 0)
-+        mutt_FormatString (dest, destlen, ifstring, newsgroup_format_str,
++        mutt_FormatString (dest, destlen, col, ifstring, newsgroup_format_str,
 +              data, flags);
 +      else
-+        mutt_FormatString (dest, destlen, elsestring, newsgroup_format_str,
++        mutt_FormatString (dest, destlen, col, elsestring, newsgroup_format_str,
 +              data, flags);
 +      }
 +      else if (Context && Context->data == folder->ff->nd)
@@ -687,7 +732,7 @@ diff -udprP mutt-1.5.13.orig/browser.c mutt-1.5.13/browser.c
  {
    if (state->entrylen == state->entrymax)
    {
-@@ -336,6 +458,10 @@ static void add_folder (MUTTMENU *m, str
+@@ -354,6 +476,10 @@ static void add_folder (MUTTMENU *m, str
  #ifdef USE_IMAP
    (state->entry)[state->entrylen].imap = 0;
  #endif
@@ -698,7 +743,7 @@ diff -udprP mutt-1.5.13.orig/browser.c mutt-1.5.13/browser.c
    (state->entrylen)++;
  }
  
-@@ -351,9 +477,35 @@ static void init_state (struct browser_s
+@@ -369,9 +495,35 @@ static void init_state (struct browser_s
      menu->data = state->entry;
  }
  
@@ -734,7 +779,7 @@ diff -udprP mutt-1.5.13.orig/browser.c mutt-1.5.13/browser.c
    struct stat s;
    DIR *dp;
    struct dirent *de;
-@@ -414,17 +566,40 @@ static int examine_directory (MUTTMENU *
+@@ -432,17 +584,40 @@ static int examine_directory (MUTTMENU *
      tmp = Incoming;
      while (tmp && mutt_strcmp (buffer, tmp->path))
        tmp = tmp->next;
@@ -775,14 +820,14 @@ diff -udprP mutt-1.5.13.orig/browser.c mutt-1.5.13/browser.c
 +#endif
 +  {
    BUFFY *tmp = Incoming;
-   if (!Incoming)
-@@ -438,14 +613,21 @@ static int examine_mailboxes (MUTTMENU *
  #ifdef USE_IMAP
+   struct mailbox_state mbox;
+@@ -460,14 +635,21 @@ static int examine_mailboxes (MUTTMENU *
      if (mx_is_imap (tmp->path))
      {
--      add_folder (menu, state, tmp->path, NULL, tmp->new);
-+      add_folder (menu, state, tmp->path, NULL, NULL, tmp->new);
+       imap_mailbox_state (tmp->path, &mbox);
+-      add_folder (menu, state, tmp->path, NULL, mbox.new);
++      add_folder (menu, state, tmp->path, NULL, NULL, mbox.new);
        continue;
      }
  #endif
@@ -801,9 +846,9 @@ diff -udprP mutt-1.5.13.orig/browser.c mutt-1.5.13/browser.c
        continue;
      }
  #endif
-@@ -459,15 +641,20 @@ static int examine_mailboxes (MUTTMENU *
+@@ -496,15 +678,20 @@ static int examine_mailboxes (MUTTMENU *
      strfcpy (buffer, NONULL(tmp->path), sizeof (buffer));
-     mutt_pretty_mailbox (buffer);
+     mutt_pretty_mailbox (buffer, sizeof (buffer));
  
 -    add_folder (menu, state, buffer, &s, tmp->new);
 +    add_folder (menu, state, buffer, &s, NULL, tmp->new);
@@ -823,22 +868,20 @@ diff -udprP mutt-1.5.13.orig/browser.c mutt-1.5.13/browser.c
    return (regexec (re, ((struct folder_file *) menu->data)[n].name, 0, NULL, 0));
  }
  
-@@ -478,7 +665,13 @@ static void folder_entry (char *s, size_
+@@ -515,6 +702,12 @@ static void folder_entry (char *s, size_
    folder.ff = &((struct folder_file *) menu->data)[num];
    folder.num = num;
    
--  mutt_FormatString (s, slen, NONULL(FolderFormat), folder_format_str, 
 +#ifdef USE_NNTP
 +  if (option (OPTNEWS))
-+    mutt_FormatString (s, slen, NONULL(GroupFormat), newsgroup_format_str, 
++    mutt_FormatString (s, slen, 0, NONULL(GroupFormat), newsgroup_format_str, 
 +      (unsigned long) &folder, M_FORMAT_ARROWCURSOR);
 +  else
 +#endif
-+    mutt_FormatString (s, slen, NONULL(FolderFormat), folder_format_str, 
+   mutt_FormatString (s, slen, 0, NONULL(FolderFormat), folder_format_str, 
        (unsigned long) &folder, M_FORMAT_ARROWCURSOR);
  }
-@@ -498,6 +691,17 @@ static void init_menu (struct browser_st
+@@ -535,6 +728,17 @@ static void init_menu (struct browser_st
  
    menu->tagged = 0;
    
@@ -856,7 +899,7 @@ diff -udprP mutt-1.5.13.orig/browser.c mutt-1.5.13/browser.c
    if (buffy)
      snprintf (title, titlelen, _("Mailboxes [%d]"), mutt_buffy_check (0));
    else
-@@ -553,6 +757,31 @@ void _mutt_select_file (char *f, size_t 
+@@ -590,6 +794,31 @@ void _mutt_select_file (char *f, size_t 
    if (!folder)
      strfcpy (LastDirBackup, LastDir, sizeof (LastDirBackup));
  
@@ -888,7 +931,7 @@ diff -udprP mutt-1.5.13.orig/browser.c mutt-1.5.13/browser.c
    if (*f)
    {
      mutt_expand_path (f, flen);
-@@ -642,6 +871,9 @@ void _mutt_select_file (char *f, size_t 
+@@ -686,6 +915,9 @@ void _mutt_select_file (char *f, size_t 
      menu->tag = file_tag;
  
    menu->help = mutt_compile_help (helpstr, sizeof (helpstr), MENU_FOLDER,
@@ -898,7 +941,7 @@ diff -udprP mutt-1.5.13.orig/browser.c mutt-1.5.13/browser.c
      FolderHelp);
  
    init_menu (&state, menu, title, sizeof (title), buffy);
-@@ -780,7 +1012,11 @@ void _mutt_select_file (char *f, size_t 
+@@ -824,7 +1056,11 @@ void _mutt_select_file (char *f, size_t 
          }
        }
  
@@ -910,7 +953,7 @@ diff -udprP mutt-1.5.13.orig/browser.c mutt-1.5.13/browser.c
        {
          strfcpy (f, state.entry[menu->current].name, flen);
          mutt_expand_path (f, flen);
-@@ -838,14 +1074,6 @@ void _mutt_select_file (char *f, size_t 
+@@ -882,14 +1118,6 @@ void _mutt_select_file (char *f, size_t 
          break;
  
  #ifdef USE_IMAP
@@ -924,8 +967,8 @@ diff -udprP mutt-1.5.13.orig/browser.c mutt-1.5.13/browser.c
 -
        case OP_BROWSER_TOGGLE_LSUB:
        if (option (OPTIMAPLSUB))
-       {
-@@ -944,6 +1172,11 @@ void _mutt_select_file (char *f, size_t 
+         unset_option (OPTIMAPLSUB);
+@@ -990,6 +1218,11 @@ void _mutt_select_file (char *f, size_t 
        
        case OP_CHANGE_DIRECTORY:
  
@@ -937,7 +980,7 @@ diff -udprP mutt-1.5.13.orig/browser.c mutt-1.5.13/browser.c
        strfcpy (buf, LastDir, sizeof (buf));
  #ifdef USE_IMAP
        if (!state.imap_browse)
-@@ -1200,6 +1433,190 @@ void _mutt_select_file (char *f, size_t 
+@@ -1255,6 +1488,190 @@ void _mutt_select_file (char *f, size_t 
          else
            mutt_error _("Error trying to view file");
        }
@@ -968,7 +1011,7 @@ diff -udprP mutt-1.5.13.orig/browser.c mutt-1.5.13/browser.c
 +          folder.ff->is_new = nd->new;
 +          folder.ff->nd = nd;
 +          FREE (&f->desc);
-+          mutt_FormatString (buffer, sizeof (buffer), NONULL(GroupFormat),
++          mutt_FormatString (buffer, sizeof (buffer), 0, NONULL(GroupFormat),
 +                newsgroup_format_str, (unsigned long) &folder,
 +                M_FORMAT_ARROWCURSOR);
 +          f->desc = safe_strdup (buffer); */
@@ -1073,7 +1116,7 @@ diff -udprP mutt-1.5.13.orig/browser.c mutt-1.5.13/browser.c
 +              folder.new = nd->new;
 +              folder.nd = nd;
 +              FREE (&f->desc);
-+              mutt_FormatString (buffer, sizeof (buffer), NONULL(GroupFormat),
++              mutt_FormatString (buffer, sizeof (buffer), 0, NONULL(GroupFormat),
 +                      newsgroup_format_str, (unsigned long) &folder,
 +                      M_FORMAT_ARROWCURSOR);
 +              f->desc = safe_strdup (buffer);
@@ -1128,10 +1171,10 @@ diff -udprP mutt-1.5.13.orig/browser.c mutt-1.5.13/browser.c
      }
    }
    
-diff -udprP mutt-1.5.13.orig/browser.h mutt-1.5.13/browser.h
---- mutt-1.5.13.orig/browser.h 2005-09-18 11:22:21.000000000 +0300
-+++ mutt-1.5.13/browser.h      2006-08-15 13:04:56.000000000 +0300
-@@ -20,6 +20,10 @@
+diff -udprP mutt-1.5.21.orig/browser.h mutt-1.5.21/browser.h
+--- mutt-1.5.21.orig/browser.h 2009-01-05 21:20:53.000000000 +0200
++++ mutt-1.5.21/browser.h      2010-09-16 13:14:39.000000000 +0300
+@@ -19,6 +19,10 @@
  #ifndef _BROWSER_H
  #define _BROWSER_H 1
  
@@ -1142,7 +1185,7 @@ diff -udprP mutt-1.5.13.orig/browser.h mutt-1.5.13/browser.h
  struct folder_file
  {
    mode_t mode;
-@@ -38,14 +42,17 @@ struct folder_file
+@@ -37,6 +41,9 @@ struct folder_file
    unsigned selectable : 1;
    unsigned inferiors : 1;
  #endif
@@ -1152,80 +1195,48 @@ diff -udprP mutt-1.5.13.orig/browser.h mutt-1.5.13/browser.h
    unsigned tagged : 1;
  };
  
- struct browser_state
- {
-   struct folder_file *entry;
--  short entrylen; /* number of real entries */
--  short entrymax;  /* max entry */
-+  unsigned int entrylen; /* number of real entries */
-+  unsigned int entrymax; /* max entry */
- #ifdef USE_IMAP
-   short imap_browse;
-   char *folder;
-diff -udprP mutt-1.5.13.orig/buffy.c mutt-1.5.13/buffy.c
---- mutt-1.5.13.orig/buffy.c   2006-05-18 21:44:28.000000000 +0300
-+++ mutt-1.5.13/buffy.c        2006-08-15 13:04:56.000000000 +0300
-@@ -293,6 +293,9 @@ int mutt_buffy_check (int force)
- #ifdef USE_POP
-   if (!Context || Context->magic != M_POP)
- #endif
+diff -udprP mutt-1.5.21.orig/buffy.c mutt-1.5.21/buffy.c
+--- mutt-1.5.21.orig/buffy.c   2010-09-13 20:19:55.000000000 +0300
++++ mutt-1.5.21/buffy.c        2010-09-16 13:14:39.000000000 +0300
+@@ -405,6 +405,9 @@ int mutt_buffy_check (int force)
+   /* check device ID and serial number instead of comparing paths */
+   if (!Context || Context->magic == M_IMAP || Context->magic == M_POP
 +#ifdef USE_NNTP
-+  if (!Context || Context->magic != M_NNTP)
++      || Context->magic == M_NNTP
 +#endif
-   /* check device ID and serial number instead of comparing paths */
-   if (!Context || !Context->path || stat (Context->path, &contex_sb) != 0)
+       || stat (Context->path, &contex_sb) != 0)
    {
-@@ -316,6 +319,11 @@ int mutt_buffy_check (int force)
-       tmp->magic = M_POP;
-     else
+     contex_sb.st_dev=0;
+@@ -421,6 +424,11 @@ int mutt_buffy_check (int force)
+       tmp->magic = M_POP;
+       else
  #endif
 +#ifdef USE_NNTP
-+    if ((tmp->magic == M_NNTP) || mx_is_nntp (tmp->path))
-+      tmp->magic = M_NNTP;
-+    else
++      if ((tmp->magic == M_NNTP) || mx_is_nntp (tmp->path))
++      tmp->magic = M_NNTP;
++      else
 +#endif
-     if (stat (tmp->path, &sb) != 0 || sb.st_size == 0 ||
-       (!tmp->magic && (tmp->magic = mx_get_magic (tmp->path)) <= 0))
-     {
-@@ -335,25 +343,21 @@ int mutt_buffy_check (int force)
+       if (stat (tmp->path, &sb) != 0 || (S_ISREG(sb.st_mode) && sb.st_size == 0) ||
+         (!tmp->magic && (tmp->magic = mx_get_magic (tmp->path)) <= 0))
+       {
+@@ -436,8 +444,11 @@ int mutt_buffy_check (int force)
      /* check to see if the folder is the currently selected folder
       * before polling */
      if (!Context || !Context->path ||
--#if defined USE_IMAP || defined USE_POP
--      ((
-+       (
-+         (0
- #ifdef USE_IMAP
--      tmp->magic == M_IMAP
-+          || tmp->magic == M_IMAP
- #endif
- #ifdef USE_POP
--#ifdef USE_IMAP
--      ||
--#endif
--      tmp->magic == M_POP
--#endif
--      ) ? mutt_strcmp (tmp->path, Context->path) :
-+          || tmp->magic == M_POP
- #endif
--       (sb.st_dev != contex_sb.st_dev || sb.st_ino != contex_sb.st_ino)
--#if defined USE_IMAP || defined USE_POP        
--          )
+-      (( tmp->magic == M_IMAP || tmp->magic == M_POP )
+-          ? mutt_strcmp (tmp->path, Context->path) :
++      (( tmp->magic == M_IMAP || tmp->magic == M_POP
 +#ifdef USE_NNTP
 +          || tmp->magic == M_NNTP
- #endif
--      )
--      
-+         ) ? mutt_strcmp (tmp->path, Context->path) :
-+             (sb.st_dev != contex_sb.st_dev || sb.st_ino != contex_sb.st_ino)
-+       )
-+       )
++#endif
++          ) ? mutt_strcmp (tmp->path, Context->path) :
+             (sb.st_dev != contex_sb.st_dev || sb.st_ino != contex_sb.st_ino)))
      {
        switch (tmp->magic)
-       {
-diff -udprP mutt-1.5.13.orig/complete.c mutt-1.5.13/complete.c
---- mutt-1.5.13.orig/complete.c        2005-09-18 11:22:21.000000000 +0300
-+++ mutt-1.5.13/complete.c     2006-08-15 13:04:56.000000000 +0300
+diff -udprP mutt-1.5.21.orig/complete.c mutt-1.5.21/complete.c
+--- mutt-1.5.21.orig/complete.c        2009-01-05 21:20:53.000000000 +0200
++++ mutt-1.5.21/complete.c     2010-09-16 13:14:39.000000000 +0300
 @@ -25,6 +25,9 @@
  #include "mailbox.h"
  #include "imap.h"
@@ -1308,9 +1319,9 @@ diff -udprP mutt-1.5.13.orig/complete.c mutt-1.5.13/complete.c
    /* we can use '/' as a delimiter, imap_complete rewrites it */
    if (*s == '=' || *s == '+' || *s == '!')
    {
-diff -udprP mutt-1.5.13.orig/compose.c mutt-1.5.13/compose.c
---- mutt-1.5.13.orig/compose.c 2005-09-18 11:22:21.000000000 +0300
-+++ mutt-1.5.13/compose.c      2006-08-15 13:04:56.000000000 +0300
+diff -udprP mutt-1.5.21.orig/compose.c mutt-1.5.21/compose.c
+--- mutt-1.5.21.orig/compose.c 2010-04-14 21:50:19.000000000 +0300
++++ mutt-1.5.21/compose.c      2010-09-16 13:14:39.000000000 +0300
 @@ -32,10 +32,15 @@
  #include "mailbox.h"
  #include "sort.h"
@@ -1327,7 +1338,7 @@ diff -udprP mutt-1.5.13.orig/compose.c mutt-1.5.13/compose.c
  
  #include <errno.h>
  #include <string.h>
-@@ -60,18 +65,21 @@ enum
+@@ -60,18 +65,21 @@
    HDR_REPLYTO,
    HDR_FCC,
  
@@ -1354,7 +1365,7 @@ diff -udprP mutt-1.5.13.orig/compose.c mutt-1.5.13/compose.c
  #define W (COLS - HDR_XOFFSET)
  
  static char *Prompts[] =
-@@ -83,6 +91,16 @@ static char *Prompts[] =
+@@ -83,6 +91,16 @@
    "Subject: ",
    "Reply-To: ",
    "Fcc: "
@@ -1371,8 +1382,8 @@ diff -udprP mutt-1.5.13.orig/compose.c mutt-1.5.13/compose.c
  };
  
  static struct mapping_t ComposeHelp[] = {
-@@ -97,6 +115,19 @@ static struct mapping_t ComposeHelp[] = 
-   { NULL }
+@@ -97,6 +115,19 @@
+   { NULL,     0 }
  };
  
 +#ifdef USE_NNTP
@@ -1390,30 +1401,45 @@ diff -udprP mutt-1.5.13.orig/compose.c mutt-1.5.13/compose.c
 +
  static void snd_entry (char *b, size_t blen, MUTTMENU *menu, int num)
  {
-     mutt_FormatString (b, blen, NONULL (AttachFormat), mutt_attach_fmt,
-@@ -115,16 +146,16 @@ static void redraw_crypt_lines (HEADER *
-   if ((WithCrypto & APPLICATION_PGP) && (WithCrypto & APPLICATION_SMIME))
-   {     
-     if (!msg->security)
--      mvaddstr (HDR_CRYPT, 0,     "Security: ");
-+      mvaddstr (HDR_CRYPT, 0,     "    Security: ");
-     else if (msg->security & APPLICATION_SMIME)
--      mvaddstr (HDR_CRYPT, 0,     "  S/MIME: ");
-+      mvaddstr (HDR_CRYPT, 0,     "      S/MIME: ");
-     else if (msg->security & APPLICATION_PGP)
--      mvaddstr (HDR_CRYPT, 0,     "     PGP: ");
-+      mvaddstr (HDR_CRYPT, 0,     "         PGP: ");
+     mutt_FormatString (b, blen, 0, NONULL (AttachFormat), mutt_attach_fmt,
+@@ -112,7 +143,7 @@
+ {
+   int off = 0;
+-  mvaddstr (HDR_CRYPT, 0, "Security: ");
++  mvprintw (HDR_CRYPT, 0, TITLE_FMT, "Security: ");
+   if ((WithCrypto & (APPLICATION_PGP | APPLICATION_SMIME)) == 0)
+   {
+@@ -148,12 +179,15 @@
+   clrtoeol ();
+   if ((WithCrypto & APPLICATION_PGP)
+-      && msg->security & APPLICATION_PGP  && msg->security & SIGN)
+-    printw ("%s%s", _(" sign as: "), PgpSignAs ? PgpSignAs : _("<default>"));
++      && msg->security & APPLICATION_PGP  && msg->security & SIGN) {
++    printw (TITLE_FMT, _(" sign as: "));
++    printw ("%s", PgpSignAs ? PgpSignAs : _("<default>"));
++  }
+   if ((WithCrypto & APPLICATION_SMIME)
+       && msg->security & APPLICATION_SMIME  && msg->security & SIGN) {
+-      printw ("%s%s", _(" sign as: "), SmimeDefaultKey ? SmimeDefaultKey : _("<default>"));
++    printw (TITLE_FMT, _(" sign as: "));
++    printw ("%s", SmimeDefaultKey ? SmimeDefaultKey : _("<default>"));
    }
-   else if ((WithCrypto & APPLICATION_SMIME))
--    mvaddstr (HDR_CRYPT, 0,     "  S/MIME: ");
-+    mvaddstr (HDR_CRYPT, 0,     "      S/MIME: ");
-   else if ((WithCrypto & APPLICATION_PGP))
--    mvaddstr (HDR_CRYPT, 0,     "     PGP: ");
-+    mvaddstr (HDR_CRYPT, 0,     "         PGP: ");
-   else
-     return;
  
-@@ -252,9 +283,28 @@ static void draw_envelope_addr (int line
+   if ((WithCrypto & APPLICATION_SMIME)
+@@ -175,7 +209,7 @@
+   int c;
+   char *t;
+-  mvaddstr (HDR_MIX, 0,     "     Mix: ");
++  mvprintw (HDR_MIX, 0, TITLE_FMT, "Mix: ");
+   if (!chain)
+   {
+@@ -249,9 +283,28 @@
  static void draw_envelope (HEADER *msg, char *fcc)
  {
    draw_envelope_addr (HDR_FROM, msg->env->from);
@@ -1442,7 +1468,7 @@ diff -udprP mutt-1.5.13.orig/compose.c mutt-1.5.13/compose.c
    mvprintw (HDR_SUBJECT, 0, TITLE_FMT, Prompts[HDR_SUBJECT - 1]);
    mutt_paddstr (W, NONULL (msg->env->subject));
    draw_envelope_addr (HDR_REPLYTO, msg->env->reply_to);
-@@ -507,6 +557,12 @@ int mutt_compose_menu (HEADER *msg,   /*
+@@ -504,6 +557,12 @@
    /* Sort, SortAux could be changed in mutt_index_menu() */
    int oldSort, oldSortAux;
    struct stat st;
@@ -1455,7 +1481,7 @@ diff -udprP mutt-1.5.13.orig/compose.c mutt-1.5.13/compose.c
  
    mutt_attach_init (msg->content);
    idx = mutt_gen_attach_list (msg->content, -1, idx, &idxlen, &idxmax, 0, 1);
-@@ -518,10 +574,18 @@ int mutt_compose_menu (HEADER *msg,   /*
+@@ -514,10 +573,18 @@
    menu->make_entry = snd_entry;
    menu->tag = mutt_tag_attach;
    menu->data = idx;
@@ -1474,7 +1500,7 @@ diff -udprP mutt-1.5.13.orig/compose.c mutt-1.5.13/compose.c
      switch (op = mutt_menuLoop (menu))
      {
        case OP_REDRAW:
-@@ -534,17 +598,87 @@ int mutt_compose_menu (HEADER *msg,   /*
+@@ -530,17 +597,87 @@
          mutt_message_hook (NULL, msg, M_SEND2HOOK);
        break;
        case OP_COMPOSE_EDIT_TO:
@@ -1562,7 +1588,7 @@ diff -udprP mutt-1.5.13.orig/compose.c mutt-1.5.13/compose.c
        case OP_COMPOSE_EDIT_SUBJECT:
        if (msg->env->subject)
          strfcpy (buf, msg->env->subject, sizeof (buf));
-@@ -707,6 +841,9 @@ int mutt_compose_menu (HEADER *msg,   /*
+@@ -703,6 +840,9 @@
          break;
  
        case OP_COMPOSE_ATTACH_MESSAGE:
@@ -1572,7 +1598,7 @@ diff -udprP mutt-1.5.13.orig/compose.c mutt-1.5.13/compose.c
        {
          char *prompt;
          HEADER *h;
-@@ -714,7 +851,22 @@ int mutt_compose_menu (HEADER *msg,   /*
+@@ -710,7 +850,22 @@
          fname[0] = 0;
          prompt = _("Open mailbox to attach message from");
  
@@ -1594,8 +1620,8 @@ diff -udprP mutt-1.5.13.orig/compose.c mutt-1.5.13/compose.c
 +#endif
          {
            strfcpy (fname, NONULL (Context->path), sizeof (fname));
-           mutt_pretty_mailbox (fname);
-@@ -723,6 +875,11 @@ int mutt_compose_menu (HEADER *msg,   /*
+           mutt_pretty_mailbox (fname, sizeof (fname));
+@@ -719,6 +874,11 @@
          if (mutt_enter_fname (prompt, fname, sizeof (fname), &menu->redraw, 1) == -1 || !fname[0])
            break;
  
@@ -1607,7 +1633,7 @@ diff -udprP mutt-1.5.13.orig/compose.c mutt-1.5.13/compose.c
          mutt_expand_path (fname, sizeof (fname));
  #ifdef USE_IMAP
            if (!mx_is_imap (fname))
-@@ -730,6 +887,9 @@ int mutt_compose_menu (HEADER *msg,   /*
+@@ -726,6 +886,9 @@
  #ifdef USE_POP
            if (!mx_is_pop (fname))
  #endif
@@ -1617,9 +1643,9 @@ diff -udprP mutt-1.5.13.orig/compose.c mutt-1.5.13/compose.c
          /* check to make sure the file exists and is readable */
          if (access (fname, R_OK) == -1)
          {
-diff -udprP mutt-1.5.13.orig/config.h.in mutt-1.5.13/config.h.in
---- mutt-1.5.13.orig/config.h.in       2006-08-14 17:09:46.000000000 +0300
-+++ mutt-1.5.13/config.h.in    2006-08-15 13:04:56.000000000 +0300
+diff -udprP mutt-1.5.21.orig/config.h.in mutt-1.5.21/config.h.in
+--- mutt-1.5.21.orig/config.h.in       2010-08-25 19:32:03.000000000 +0300
++++ mutt-1.5.21/config.h.in    2010-09-16 13:14:39.000000000 +0300
 @@ -37,6 +37,9 @@
     significant more memory when defined. */
  #undef EXACT_ADDRESS
@@ -1630,10 +1656,10 @@ diff -udprP mutt-1.5.13.orig/config.h.in mutt-1.5.13/config.h.in
  /* program to use for shell commands */
  #undef EXECSHELL
  
-diff -udprP mutt-1.5.13.orig/configure.in mutt-1.5.13/configure.in
---- mutt-1.5.13.orig/configure.in      2006-08-14 17:09:18.000000000 +0300
-+++ mutt-1.5.13/configure.in   2006-08-15 13:04:56.000000000 +0300
-@@ -574,6 +574,14 @@ if test x"$need_imap" = xyes -o x"$need_
+diff -udprP mutt-1.5.21.orig/configure.ac mutt-1.5.21/configure.ac
+--- mutt-1.5.21.orig/configure.ac      2010-08-24 19:34:21.000000000 +0300
++++ mutt-1.5.21/configure.ac   2010-09-16 13:14:39.000000000 +0300
+@@ -602,6 +602,14 @@ if test x"$need_imap" = xyes -o x"$need_
    MUTT_LIB_OBJECTS="$MUTT_LIB_OBJECTS bcache.o"
  fi
  
@@ -1648,18 +1674,18 @@ diff -udprP mutt-1.5.13.orig/configure.in mutt-1.5.13/configure.in
  dnl -- end socket dependencies --
  
  if test "$need_socket" = "yes"
-diff -udprP mutt-1.5.13.orig/curs_main.c mutt-1.5.13/curs_main.c
---- mutt-1.5.13.orig/curs_main.c       2006-06-08 14:50:29.000000000 +0300
-+++ mutt-1.5.13/curs_main.c    2006-08-15 13:04:56.000000000 +0300
+diff -udprP mutt-1.5.21.orig/curs_main.c mutt-1.5.21/curs_main.c
+--- mutt-1.5.21.orig/curs_main.c       2010-09-13 20:19:55.000000000 +0300
++++ mutt-1.5.21/curs_main.c    2010-09-16 13:14:39.000000000 +0300
 @@ -22,6 +22,7 @@
  
  #include "mutt.h"
  #include "mutt_curses.h"
 +#include "mx.h"
  #include "mutt_menu.h"
- #include "attach.h"
  #include "mailbox.h"
-@@ -40,6 +41,10 @@
+ #include "mapping.h"
+@@ -38,6 +39,10 @@
  
  #include "mutt_crypt.h"
  
@@ -1670,8 +1696,8 @@ diff -udprP mutt-1.5.13.orig/curs_main.c mutt-1.5.13/curs_main.c
  
  #include <ctype.h>
  #include <stdlib.h>
-@@ -415,12 +420,27 @@ struct mapping_t IndexHelp[] = {
-   { NULL }
+@@ -413,12 +418,27 @@ static struct mapping_t IndexHelp[] = {
+   { NULL,      0 }
  };
  
 +#ifdef USE_NNTP
@@ -1693,12 +1719,12 @@ diff -udprP mutt-1.5.13.orig/curs_main.c mutt-1.5.13/curs_main.c
   */
  int mutt_index_menu (void)
  {
-   char buf[LONG_STRING], helpstr[SHORT_STRING];
+   char buf[LONG_STRING], helpstr[LONG_STRING];
 +  int flags;
    int op = OP_NULL;
    int done = 0;                /* controls when to exit the "event" loop */
    int i = 0, j;
-@@ -442,7 +462,11 @@ int mutt_index_menu (void)
+@@ -439,7 +459,11 @@ int mutt_index_menu (void)
    menu->make_entry = index_make_entry;
    menu->color = index_color;
    menu->current = ci_first_message ();
@@ -1708,10 +1734,10 @@ diff -udprP mutt-1.5.13.orig/curs_main.c mutt-1.5.13/curs_main.c
 +      (Context && (Context->magic == M_NNTP)) ? IndexNewsHelp :
 +#endif
 +      IndexHelp);
-   
-   if (!attach_msg) 
+   if (!attach_msg)
      mutt_buffy_check(1); /* force the buffy check after we enter the folder */
-@@ -694,6 +718,9 @@ int mutt_index_menu (void)
+@@ -682,6 +706,9 @@ int mutt_index_menu (void)
        mutt_curs_set (1);      /* fallback from the pager */
      }
  
@@ -1721,7 +1747,7 @@ diff -udprP mutt-1.5.13.orig/curs_main.c mutt-1.5.13/curs_main.c
      switch (op)
      {
  
-@@ -744,6 +771,120 @@ int mutt_index_menu (void)
+@@ -732,6 +759,120 @@ int mutt_index_menu (void)
        menu_current_bottom (menu);
        break;
  
@@ -1842,7 +1868,7 @@ diff -udprP mutt-1.5.13.orig/curs_main.c mutt-1.5.13/curs_main.c
        case OP_JUMP:
  
        CHECK_MSGCOUNT;
-@@ -841,11 +982,33 @@ int mutt_index_menu (void)
+@@ -828,11 +969,33 @@ int mutt_index_menu (void)
          break;
  
        case OP_MAIN_LIMIT:
@@ -1877,11 +1903,11 @@ diff -udprP mutt-1.5.13.orig/curs_main.c mutt-1.5.13/curs_main.c
        {
          if (menu->oldcurrent >= 0)
          {
-@@ -1052,20 +1215,43 @@ int mutt_index_menu (void)
-       break;
+@@ -1071,15 +1234,22 @@ int mutt_index_menu (void)
  
        case OP_MAIN_CHANGE_FOLDER:
--      
+       case OP_MAIN_NEXT_UNREAD_MAILBOX:
+-
 -      if (attach_msg)
 -        op = OP_MAIN_CHANGE_FOLDER_READONLY;
 -
@@ -1891,9 +1917,8 @@ diff -udprP mutt-1.5.13.orig/curs_main.c mutt-1.5.13/curs_main.c
 +#ifdef USE_NNTP
 +      case OP_MAIN_CHANGE_GROUP:
 +      case OP_MAIN_CHANGE_GROUP_READONLY:
++      unset_option (OPTNEWS);
 +#endif
--        if ((op == OP_MAIN_CHANGE_FOLDER_READONLY) || option (OPTREADONLY))
 +      if (attach_msg || option (OPTREADONLY) ||
 +#ifdef USE_NNTP
 +          op == OP_MAIN_CHANGE_GROUP_READONLY ||
@@ -1902,52 +1927,54 @@ diff -udprP mutt-1.5.13.orig/curs_main.c mutt-1.5.13/curs_main.c
 +        flags = M_READONLY;
 +      else
 +        flags = 0;
-+
+-        if ((op == OP_MAIN_CHANGE_FOLDER_READONLY) || option (OPTREADONLY))
 +      if (flags)
            cp = _("Open mailbox in read-only mode");
          else
            cp = _("Open mailbox");
-       buf[0] = '\0';
+@@ -1098,6 +1268,21 @@ int mutt_index_menu (void)
+       }
+       else
+       {
 +#ifdef USE_NNTP
-+      unset_option (OPTNEWS);
-+      if (op == OP_MAIN_CHANGE_GROUP ||
-+          op == OP_MAIN_CHANGE_GROUP_READONLY)
-+      {
-+        set_option (OPTNEWS);
-+        if (!(CurrentNewsSrv = mutt_select_newsserver (NewsServer)))
-+          break;
-+        if (flags)
-+          cp = _("Open newsgroup in read-only mode");
++        if (op == OP_MAIN_CHANGE_GROUP ||
++            op == OP_MAIN_CHANGE_GROUP_READONLY)
++        {
++          set_option (OPTNEWS);
++          if (!(CurrentNewsSrv = mutt_select_newsserver (NewsServer)))
++            break;
++          if (flags)
++            cp = _("Open newsgroup in read-only mode");
++          else
++            cp = _("Open newsgroup");
++          nntp_buffy (buf);
++        }
 +        else
-+          cp = _("Open newsgroup");
-+        nntp_buffy (buf);
-+      }
-+      else
 +#endif
-       mutt_buffy (buf, sizeof (buf));
+         mutt_buffy (buf, sizeof (buf));
  
-       if (mutt_enter_fname (cp, buf, sizeof (buf), &menu->redraw, 1) == -1)
-@@ -1084,6 +1270,14 @@ int mutt_index_menu (void)
-         break;
+         if (mutt_enter_fname (cp, buf, sizeof (buf), &menu->redraw, 1) == -1)
+@@ -1117,6 +1302,14 @@ int mutt_index_menu (void)
+         }
        }
  
 +#ifdef USE_NNTP
-+        if (option (OPTNEWS))
++      if (option (OPTNEWS))
 +      {
 +        unset_option (OPTNEWS);
-+          nntp_expand_path (buf, sizeof (buf), &CurrentNewsSrv->conn->account);
++        nntp_expand_path (buf, sizeof (buf), &CurrentNewsSrv->conn->account);
 +      }
-+        else
++      else
 +#endif
        mutt_expand_path (buf, sizeof (buf));
        if (mx_get_magic (buf) <= 0)
        {
-@@ -1121,15 +1315,18 @@ int mutt_index_menu (void)
+@@ -1158,15 +1351,18 @@ int mutt_index_menu (void)
        CurrentMenu = MENU_MAIN;
        mutt_folder_hook (buf);
  
--      if ((Context = mx_open_mailbox (buf, 
+-      if ((Context = mx_open_mailbox (buf,
 -                                      (option (OPTREADONLY) || op == OP_MAIN_CHANGE_FOLDER_READONLY) ?
 -                                      M_READONLY : 0, NULL)) != NULL)
 +      if ((Context = mx_open_mailbox (buf, flags, NULL)) != NULL)
@@ -1965,9 +1992,9 @@ diff -udprP mutt-1.5.13.orig/curs_main.c mutt-1.5.13/curs_main.c
        mutt_clear_error ();
        mutt_buffy_check(1); /* force the buffy check after we have changed
                              the folder */
-@@ -1509,6 +1706,15 @@ int mutt_index_menu (void)
-       }
- #endif
+@@ -1539,6 +1735,15 @@ int mutt_index_menu (void)
+       CHECK_READONLY;
+       CHECK_ACL(M_ACL_WRITE, _("flag message"));
  
 +#ifdef USE_NNTP
 +      if (Context->magic == M_NNTP)
@@ -1981,7 +2008,7 @@ diff -udprP mutt-1.5.13.orig/curs_main.c mutt-1.5.13/curs_main.c
          if (tag)
          {
          for (j = 0; j < Context->vcount; j++)
-@@ -1856,6 +2062,17 @@ int mutt_index_menu (void)
+@@ -1886,6 +2091,17 @@ int mutt_index_menu (void)
        }
        break;
  
@@ -1999,8 +2026,8 @@ diff -udprP mutt-1.5.13.orig/curs_main.c mutt-1.5.13/curs_main.c
        case OP_DISPLAY_ADDRESS:
  
        CHECK_MSGCOUNT;
-@@ -1890,6 +2107,15 @@ int mutt_index_menu (void)
-         break;
+@@ -2013,6 +2229,15 @@ int mutt_index_menu (void)
+         menu->redraw = (tag ? REDRAW_INDEX : REDRAW_CURRENT) | REDRAW_STATUS;
        }
  #endif
 +  
@@ -2013,18 +2040,21 @@ diff -udprP mutt-1.5.13.orig/curs_main.c mutt-1.5.13/curs_main.c
 +      }
 +#endif
  
-       if (option (OPTPGPAUTODEC) && (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED))) 
-         mutt_check_traditional_pgp (tag ? NULL : CURHDR, &menu->redraw);
-@@ -2063,6 +2289,37 @@ int mutt_index_menu (void)
-       
+       MAYBE_REDRAW (menu->redraw);
+       break;
+@@ -2090,6 +2315,41 @@ int mutt_index_menu (void)
          menu->redraw = REDRAW_FULL;
          break;
-+
 +#ifdef USE_NNTP
-+      case OP_POST:
 +      case OP_FOLLOWUP:
 +      case OP_FORWARD_TO_GROUP:
 +
++      CHECK_MSGCOUNT;
++      CHECK_VISIBLE;
++
++      case OP_POST:
++
 +      CHECK_ATTACH;
 +      if (op != OP_FOLLOWUP || !CURHDR->env->followup_to ||
 +          mutt_strcasecmp (CURHDR->env->followup_to, "poster") ||
@@ -2050,12 +2080,13 @@ diff -udprP mutt-1.5.13.orig/curs_main.c mutt-1.5.13/curs_main.c
 +        break;
 +      }
 +#endif
-       
++
        case OP_REPLY:
  
-@@ -2136,6 +2393,12 @@ int mutt_index_menu (void)
+       CHECK_ATTACH;
+@@ -2165,6 +2425,12 @@ int mutt_index_menu (void)
        CHECK_READONLY;
-       CHECK_IMAP_ACL(IMAP_ACL_DELETE);
+       CHECK_ACL(M_ACL_DELETE, _("undelete message(s)"));
  
 +#ifdef USE_NNTP
 +      /* Close all open NNTP connections */
@@ -2066,10 +2097,10 @@ diff -udprP mutt-1.5.13.orig/curs_main.c mutt-1.5.13/curs_main.c
        rc = mutt_thread_set_flag (CURHDR, M_DELETE, 0,
                                   op == OP_UNDELETE_THREAD ? 0 : 1);
  
-diff -udprP mutt-1.5.13.orig/doc/manual.xml.head mutt-1.5.13/doc/manual.xml.head
---- mutt-1.5.13.orig/doc/manual.xml.head       2006-08-11 12:23:28.000000000 +0300
-+++ mutt-1.5.13/doc/manual.xml.head    2006-08-15 13:04:56.000000000 +0300
-@@ -1204,6 +1204,22 @@ have a look at the mixmaster documentati
+diff -udprP mutt-1.5.21.orig/doc/manual.xml.head mutt-1.5.21/doc/manual.xml.head
+--- mutt-1.5.21.orig/doc/manual.xml.head       2010-08-24 19:34:21.000000000 +0300
++++ mutt-1.5.21/doc/manual.xml.head    2010-09-16 13:14:39.000000000 +0300
+@@ -1611,6 +1611,22 @@ fo-table</literal> for details.
  
  </sect2>
  
@@ -2092,21 +2123,21 @@ diff -udprP mutt-1.5.13.orig/doc/manual.xml.head mutt-1.5.13/doc/manual.xml.head
  </sect1>
  
  <sect1 id="forwarding-mail">
-diff -udprP mutt-1.5.13.orig/doc/mutt.man mutt-1.5.13/doc/mutt.man
---- mutt-1.5.13.orig/doc/mutt.man      2005-09-18 11:22:22.000000000 +0300
-+++ mutt-1.5.13/doc/mutt.man   2006-08-15 13:04:56.000000000 +0300
+diff -udprP mutt-1.5.21.orig/doc/mutt.man mutt-1.5.21/doc/mutt.man
+--- mutt-1.5.21.orig/doc/mutt.man      2010-08-24 19:34:21.000000000 +0300
++++ mutt-1.5.21/doc/mutt.man   2010-09-16 13:14:39.000000000 +0300
 @@ -23,8 +23,8 @@ mutt \- The Mutt Mail User Agent
  .SH SYNOPSIS
  .PP
  .B mutt
--[-nRyzZ] 
--[-e \fIcmd\fP] [-F \fIfile\fP] [-m \fItype\fP] [-f \fIfile\fP]
-+[-GnRyzZ] 
-+[-e \fIcmd\fP] [-F \fIfile\fP] [-g \fIserver\fP] [-m \fItype\fP] [-f \fIfile\fP]
+-[\-nRyzZ]
+-[\-e \fIcmd\fP] [\-F \fIfile\fP] [\-m \fItype\fP] [\-f \fIfile\fP]
++[\-GnRyzZ]
++[\-e \fIcmd\fP] [\-F \fIfile\fP] [\-g \fIserver\fP] [\-m \fItype\fP] [\-f \fIfile\fP]
  .PP
  .B mutt 
- [-nx] 
-@@ -75,6 +75,10 @@ files.
+ [\-nx] 
+@@ -101,6 +101,10 @@ files.
  Specify which mailbox to load.
  .IP "-F \fImuttrc\fP"
  Specify an initialization file to read instead of ~/.muttrc
@@ -2117,10 +2148,10 @@ diff -udprP mutt-1.5.13.orig/doc/mutt.man mutt-1.5.13/doc/mutt.man
  .IP "-h"
  Display help.
  .IP "-H \fIdraft\fP"
-diff -udprP mutt-1.5.13.orig/functions.h mutt-1.5.13/functions.h
---- mutt-1.5.13.orig/functions.h       2005-09-18 11:22:21.000000000 +0300
-+++ mutt-1.5.13/functions.h    2006-08-15 13:04:56.000000000 +0300
-@@ -72,6 +72,10 @@ struct binding_t OpMain[] = {
+diff -udprP mutt-1.5.21.orig/functions.h mutt-1.5.21/functions.h
+--- mutt-1.5.21.orig/functions.h       2010-08-24 19:34:21.000000000 +0300
++++ mutt-1.5.21/functions.h    2010-09-16 13:14:39.000000000 +0300
+@@ -88,6 +88,10 @@ struct binding_t OpMain[] = { /* map: in
    { "break-thread",           OP_MAIN_BREAK_THREAD,           "#" },
    { "change-folder",          OP_MAIN_CHANGE_FOLDER,          "c" },
    { "change-folder-readonly", OP_MAIN_CHANGE_FOLDER_READONLY, "\033c" },
@@ -2128,10 +2159,10 @@ diff -udprP mutt-1.5.13.orig/functions.h mutt-1.5.13/functions.h
 +  { "change-newsgroup",               OP_MAIN_CHANGE_GROUP,           "i" },
 +  { "change-newsgroup-readonly",OP_MAIN_CHANGE_GROUP_READONLY,        "\033i" },
 +#endif
+   { "next-unread-mailbox",    OP_MAIN_NEXT_UNREAD_MAILBOX,    NULL },
    { "collapse-thread",                OP_MAIN_COLLAPSE_THREAD,        "\033v" },
    { "collapse-all",           OP_MAIN_COLLAPSE_ALL,           "\033V" },
-   { "copy-message",           OP_COPY_MESSAGE,                "C" },
-@@ -84,7 +88,15 @@ struct binding_t OpMain[] = {
+@@ -101,7 +105,15 @@ struct binding_t OpMain[] = { /* map: in
    { "edit",                   OP_EDIT_MESSAGE,                "e" },
    { "edit-type",              OP_EDIT_TYPE,                   "\005" },
    { "forward-message",                OP_FORWARD_MESSAGE,             "f" },
@@ -2148,7 +2179,7 @@ diff -udprP mutt-1.5.13.orig/functions.h mutt-1.5.13/functions.h
    { "group-reply",            OP_GROUP_REPLY,                 "g" },
  #ifdef USE_POP
    { "fetch-mail",             OP_MAIN_FETCH_MAIL,             "G" },
-@@ -110,6 +122,9 @@ struct binding_t OpMain[] = {
+@@ -128,6 +140,9 @@ struct binding_t OpMain[] = { /* map: in
    { "sort-mailbox",           OP_SORT,                        "o" },
    { "sort-reverse",           OP_SORT_REVERSE,                "O" },
    { "print-message",          OP_PRINT,                       "p" },
@@ -2158,7 +2189,7 @@ diff -udprP mutt-1.5.13.orig/functions.h mutt-1.5.13/functions.h
    { "previous-thread",                OP_MAIN_PREV_THREAD,            "\020" },
    { "previous-subthread",     OP_MAIN_PREV_SUBTHREAD,         "\033p" },
    { "recall-message",         OP_RECALL_MESSAGE,              "R" },
-@@ -129,6 +144,10 @@ struct binding_t OpMain[] = {
+@@ -147,6 +162,10 @@ struct binding_t OpMain[] = { /* map: in
    { "show-version",           OP_VERSION,                     "V" },
    { "set-flag",                       OP_MAIN_SET_FLAG,               "w" },
    { "clear-flag",             OP_MAIN_CLEAR_FLAG,             "W" },
@@ -2169,7 +2200,7 @@ diff -udprP mutt-1.5.13.orig/functions.h mutt-1.5.13/functions.h
    { "display-message",                OP_DISPLAY_MESSAGE,             M_ENTER_S },
    { "buffy-list",             OP_BUFFY_LIST,                  "." },
    { "sync-mailbox",           OP_MAIN_SYNC_FOLDER,            "$" },
-@@ -140,7 +159,7 @@ struct binding_t OpMain[] = {
+@@ -158,7 +177,7 @@ struct binding_t OpMain[] = { /* map: in
    { "previous-new-then-unread",       OP_MAIN_PREV_NEW_THEN_UNREAD,   "\033\t" },
    { "next-unread",            OP_MAIN_NEXT_UNREAD,            NULL },
    { "previous-unread",                OP_MAIN_PREV_UNREAD,            NULL },
@@ -2178,7 +2209,7 @@ diff -udprP mutt-1.5.13.orig/functions.h mutt-1.5.13/functions.h
  
  
    { "extract-keys",           OP_EXTRACT_KEYS,                "\013" },
-@@ -160,6 +179,10 @@ struct binding_t OpPager[] = {
+@@ -178,6 +197,10 @@ struct binding_t OpPager[] = { /* map: p
    { "bounce-message", OP_BOUNCE_MESSAGE,              "b" },
    { "change-folder",  OP_MAIN_CHANGE_FOLDER,          "c" },
    { "change-folder-readonly", OP_MAIN_CHANGE_FOLDER_READONLY, "\033c" },
@@ -2186,11 +2217,11 @@ diff -udprP mutt-1.5.13.orig/functions.h mutt-1.5.13/functions.h
 +  { "change-newsgroup",               OP_MAIN_CHANGE_GROUP,           "i" },
 +  { "change-newsgroup-readonly",OP_MAIN_CHANGE_GROUP_READONLY,        "\033i" },
 +#endif
+   { "next-unread-mailbox",    OP_MAIN_NEXT_UNREAD_MAILBOX, NULL },
    { "copy-message",   OP_COPY_MESSAGE,                "C" },
    { "decode-copy",    OP_DECODE_COPY,                 "\033C" },
-   { "delete-message", OP_DELETE,                      "d" },
-@@ -167,8 +190,12 @@ struct binding_t OpPager[] = {
-   { "delete-subthread",       OP_DELETE_SUBTHREAD,            "\033d" },
+@@ -188,8 +211,12 @@ struct binding_t OpPager[] = { /* map: p
+   { "clear-flag",       OP_MAIN_CLEAR_FLAG,           "W" },
    { "edit",           OP_EDIT_MESSAGE,                "e" },
    { "edit-type",      OP_EDIT_TYPE,                   "\005" },
 +#ifdef USE_NNTP
@@ -2203,9 +2234,9 @@ diff -udprP mutt-1.5.13.orig/functions.h mutt-1.5.13/functions.h
    { "group-reply",    OP_GROUP_REPLY,                 "g" },
  #ifdef USE_IMAP
    { "imap-fetch-mail",  OP_MAIN_IMAP_FETCH,           NULL },
-@@ -187,6 +214,9 @@ struct binding_t OpPager[] = {
-   { "next-thread",    OP_MAIN_NEXT_THREAD,            "\016" },
-   { "next-subthread", OP_MAIN_NEXT_SUBTHREAD,         "\033n" },
+@@ -211,6 +238,9 @@ struct binding_t OpPager[] = { /* map: p
+   { "sort-mailbox",   OP_SORT,                        "o" },
+   { "sort-reverse",   OP_SORT_REVERSE,                "O" },
    { "print-message",  OP_PRINT,                       "p" },
 +#ifdef USE_NNTP
 +  { "post-message",   OP_POST,                        "P" },
@@ -2213,7 +2244,7 @@ diff -udprP mutt-1.5.13.orig/functions.h mutt-1.5.13/functions.h
    { "previous-thread",        OP_MAIN_PREV_THREAD,            "\020" },
    { "previous-subthread",OP_MAIN_PREV_SUBTHREAD,      "\033p" },
    { "quit",           OP_QUIT,                        "Q" },
-@@ -234,7 +264,7 @@ struct binding_t OpPager[] = {
+@@ -258,7 +288,7 @@ struct binding_t OpPager[] = { /* map: p
    { "half-down",      OP_HALF_DOWN,                   NULL },
    { "previous-line",  OP_PREV_LINE,                   NULL },
    { "bottom",         OP_PAGER_BOTTOM,                NULL },
@@ -2222,7 +2253,7 @@ diff -udprP mutt-1.5.13.orig/functions.h mutt-1.5.13/functions.h
  
  
  
-@@ -254,6 +284,10 @@ struct binding_t OpAttach[] = {
+@@ -279,6 +309,10 @@ struct binding_t OpAttach[] = { /* map: 
    { "bounce-message", OP_BOUNCE_MESSAGE,              "b" },
    { "display-toggle-weed",    OP_DISPLAY_HEADERS,     "h" },
    { "edit-type",      OP_EDIT_TYPE,                   "\005" },
@@ -2233,15 +2264,15 @@ diff -udprP mutt-1.5.13.orig/functions.h mutt-1.5.13/functions.h
    { "print-entry",    OP_PRINT,                       "p" },
    { "save-entry",     OP_SAVE,                        "s" },
    { "pipe-entry",     OP_PIPE,                        "|" },
-@@ -279,6 +313,7 @@ struct binding_t OpAttach[] = {
- struct binding_t OpCompose[] = {
+@@ -304,6 +338,7 @@ struct binding_t OpAttach[] = { /* map: 
+ struct binding_t OpCompose[] = { /* map: compose */
    { "attach-file",    OP_COMPOSE_ATTACH_FILE,         "a" },
    { "attach-message", OP_COMPOSE_ATTACH_MESSAGE,      "A" },
 +  { "attach-news-message",OP_COMPOSE_ATTACH_NEWS_MESSAGE,"\033a" },
    { "edit-bcc",               OP_COMPOSE_EDIT_BCC,            "b" },
    { "edit-cc",                OP_COMPOSE_EDIT_CC,             "c" },
    { "copy-file",      OP_SAVE,                        "C" },
-@@ -298,6 +333,11 @@ struct binding_t OpCompose[] = {
+@@ -323,6 +358,11 @@ struct binding_t OpCompose[] = { /* map:
    { "print-entry",    OP_PRINT,                       "l" },
    { "edit-mime",      OP_COMPOSE_EDIT_MIME,           "m" },
    { "new-mime",               OP_COMPOSE_NEW_MIME,            "n" },
@@ -2253,7 +2284,7 @@ diff -udprP mutt-1.5.13.orig/functions.h mutt-1.5.13/functions.h
    { "postpone-message",       OP_COMPOSE_POSTPONE_MESSAGE,    "P" },
    { "edit-reply-to",  OP_COMPOSE_EDIT_REPLY_TO,       "r" },
    { "rename-file",    OP_COMPOSE_RENAME_FILE,         "R" },
-@@ -349,14 +389,25 @@ struct binding_t OpBrowser[] = {
+@@ -374,14 +414,25 @@ struct binding_t OpBrowser[] = { /* map:
    { "select-new",     OP_BROWSER_NEW_FILE,    "N" },
    { "check-new",      OP_CHECK_NEW,           NULL },
    { "toggle-mailboxes", OP_TOGGLE_MAILBOXES,  "\t" },
@@ -2279,10 +2310,10 @@ diff -udprP mutt-1.5.13.orig/functions.h mutt-1.5.13/functions.h
    { "toggle-subscribed", OP_BROWSER_TOGGLE_LSUB, "T" },
  #endif
    { NULL,             0,                      NULL }
-diff -udprP mutt-1.5.13.orig/globals.h mutt-1.5.13/globals.h
---- mutt-1.5.13.orig/globals.h 2006-08-11 12:07:12.000000000 +0300
-+++ mutt-1.5.13/globals.h      2006-08-15 13:04:56.000000000 +0300
-@@ -93,6 +93,15 @@ WHERE char *MixEntryFormat;
+diff -udprP mutt-1.5.21.orig/globals.h mutt-1.5.21/globals.h
+--- mutt-1.5.21.orig/globals.h 2009-08-25 22:08:52.000000000 +0300
++++ mutt-1.5.21/globals.h      2010-09-16 13:14:39.000000000 +0300
+@@ -95,6 +95,15 @@ WHERE char *MixEntryFormat;
  #endif
  
  WHERE char *Muttrc INITVAL (NULL);
@@ -2298,7 +2329,7 @@ diff -udprP mutt-1.5.13.orig/globals.h mutt-1.5.13/globals.h
  WHERE char *Outbox;
  WHERE char *Pager;
  WHERE char *PagerFmt;
-@@ -183,6 +192,11 @@ extern unsigned char QuadOptions[];
+@@ -188,6 +197,11 @@ extern unsigned char QuadOptions[];
  
  WHERE unsigned short Counter INITVAL (0);
  
@@ -2310,25 +2341,28 @@ diff -udprP mutt-1.5.13.orig/globals.h mutt-1.5.13/globals.h
  WHERE short ConnectTimeout;
  WHERE short HistSize;
  WHERE short MenuContext;
-diff -udprP mutt-1.5.13.orig/hash.c mutt-1.5.13/hash.c
---- mutt-1.5.13.orig/hash.c    2006-05-18 21:44:29.000000000 +0300
-+++ mutt-1.5.13/hash.c 2006-08-15 13:04:56.000000000 +0300
-@@ -51,10 +51,35 @@ HASH *hash_create (int nelem)
+diff -udprP mutt-1.5.21.orig/hash.c mutt-1.5.21/hash.c
+--- mutt-1.5.21.orig/hash.c    2009-03-19 21:41:18.000000000 +0200
++++ mutt-1.5.21/hash.c 2010-09-16 13:14:39.000000000 +0300
+@@ -57,6 +57,7 @@ HASH *hash_create (int nelem, int lower)
    if (nelem == 0)
      nelem = 2;
    table->nelem = nelem;
 +  table->curnelem = 0;
    table->table = safe_calloc (nelem, sizeof (struct hash_elem *));
+   if (lower)
+   {
+@@ -71,6 +72,29 @@ HASH *hash_create (int nelem, int lower)
    return table;
  }
  
-+HASH *hash_resize (HASH *ptr, int nelem)
++HASH *hash_resize (HASH *ptr, int nelem, int lower)
 +{
 +  HASH *table;
 +  struct hash_elem *elem, *tmp;
 +  int i;
 +
-+  table = hash_create (nelem);
++  table = hash_create (nelem, lower);
 +
 +  for (i = 0; i < ptr->nelem; i++)
 +  {
@@ -2342,14 +2376,13 @@ diff -udprP mutt-1.5.13.orig/hash.c mutt-1.5.13/hash.c
 +  }
 +  FREE (&ptr->table);
 +  FREE (&ptr);
-+
 +  return table;
 +}
 +
  /* table        hash table to update
   * key          key to hash on
   * data         data to associate with `key'
-@@ -74,6 +99,7 @@ int hash_insert (HASH * table, const cha
+@@ -90,6 +114,7 @@ int hash_insert (HASH * table, const cha
    {
      ptr->next = table->table[h];
      table->table[h] = ptr;
@@ -2357,7 +2390,7 @@ diff -udprP mutt-1.5.13.orig/hash.c mutt-1.5.13/hash.c
    }
    else
    {
-@@ -96,6 +122,7 @@ int hash_insert (HASH * table, const cha
+@@ -112,6 +137,7 @@ int hash_insert (HASH * table, const cha
      else
        table->table[h] = ptr;
      ptr->next = tmp;
@@ -2365,7 +2398,7 @@ diff -udprP mutt-1.5.13.orig/hash.c mutt-1.5.13/hash.c
    }
    return h;
  }
-@@ -126,6 +153,7 @@ void hash_delete_hash (HASH * table, int
+@@ -142,6 +168,7 @@ void hash_delete_hash (HASH * table, int
        if (destroy)
        destroy (ptr->data);
        FREE (&ptr);
@@ -2373,9 +2406,9 @@ diff -udprP mutt-1.5.13.orig/hash.c mutt-1.5.13/hash.c
        
        ptr = *last;
      }
-diff -udprP mutt-1.5.13.orig/hash.h mutt-1.5.13/hash.h
---- mutt-1.5.13.orig/hash.h    2005-09-18 11:22:22.000000000 +0300
-+++ mutt-1.5.13/hash.h 2006-08-15 13:04:56.000000000 +0300
+diff -udprP mutt-1.5.21.orig/hash.h mutt-1.5.21/hash.h
+--- mutt-1.5.21.orig/hash.h    2009-03-19 21:41:18.000000000 +0200
++++ mutt-1.5.21/hash.h 2010-09-16 13:14:39.000000000 +0300
 @@ -28,7 +28,7 @@ struct hash_elem
  
  typedef struct
@@ -2383,20 +2416,20 @@ diff -udprP mutt-1.5.13.orig/hash.h mutt-1.5.13/hash.h
 -  int nelem;
 +  int nelem, curnelem;
    struct hash_elem **table;
- }
HASH;
-@@ -40,6 +40,7 @@ HASH;
- HASH *hash_create (int nelem);
int hash_string (const unsigned char *s, int n);
+   unsigned int (*hash_string)(const unsigned char *, unsigned int);
  int (*cmp_string)(const char *, const char *);
+@@ -41,6 +41,7 @@ HASH;
HASH *hash_create (int nelem, int lower);
  int hash_insert (HASH * table, const char *key, void *data, int allow_dup);
-+HASH *hash_resize (HASH * table, int nelem);
++HASH *hash_resize (HASH * table, int nelem, int lower);
  void *hash_find_hash (const HASH * table, int hash, const char *key);
  void hash_delete_hash (HASH * table, int hash, const char *key, const void *data,
                       void (*destroy) (void *));
-diff -udprP mutt-1.5.13.orig/hdrline.c mutt-1.5.13/hdrline.c
---- mutt-1.5.13.orig/hdrline.c 2006-04-28 22:43:51.000000000 +0300
-+++ mutt-1.5.13/hdrline.c      2006-08-15 13:04:56.000000000 +0300
-@@ -205,6 +205,7 @@ int mutt_user_is_recipient (HEADER *h)
+diff -udprP mutt-1.5.21.orig/hdrline.c mutt-1.5.21/hdrline.c
+--- mutt-1.5.21.orig/hdrline.c 2009-04-11 02:45:19.000000000 +0300
++++ mutt-1.5.21/hdrline.c      2010-09-16 13:14:39.000000000 +0300
+@@ -211,6 +211,7 @@ int mutt_user_is_recipient (HEADER *h)
   * %E = number of messages in current thread
   * %f = entire from line
   * %F = like %n, unless from self
@@ -2404,7 +2437,14 @@ diff -udprP mutt-1.5.13.orig/hdrline.c mutt-1.5.13/hdrline.c
   * %i = message-id
   * %l = number of lines in the message
   * %L = like %F, except `lists' are displayed first
-@@ -218,6 +219,7 @@ int mutt_user_is_recipient (HEADER *h)
+@@ -219,12 +220,14 @@ int mutt_user_is_recipient (HEADER *h)
+  * %N = score
+  * %O = like %L, except using address instead of name
+  * %P = progress indicator for builtin pager
++ * %R = `x-comment-to:' field (if present and compiled with nntp support)
+  * %s = subject
+  * %S = short message status (e.g., N/O/D/!/r/-)
+  * %t = `to:' field (recipients)
   * %T = $to_chars
   * %u = user (login) name of author
   * %v = first name of author, unless from self
@@ -2412,7 +2452,7 @@ diff -udprP mutt-1.5.13.orig/hdrline.c mutt-1.5.13/hdrline.c
   * %X = number of MIME attachments
   * %y = `x-label:' field (if present)
   * %Y = `x-label:' field (if present, tree unfolded, and != parent's x-label)
-@@ -455,6 +457,12 @@ hdr_format_str (char *dest,
+@@ -457,6 +460,12 @@ hdr_format_str (char *dest,
  
        break;
  
@@ -2425,7 +2465,23 @@ diff -udprP mutt-1.5.13.orig/hdrline.c mutt-1.5.13/hdrline.c
      case 'i':
        mutt_format_s (dest, destlen, prefix, hdr->env->message_id ? hdr->env->message_id : "<no.id>");
        break;
-@@ -631,6 +639,13 @@ hdr_format_str (char *dest,
+@@ -548,6 +557,15 @@ hdr_format_str (char *dest,
+       strfcpy(dest, NONULL(hfi->pager_progress), destlen);
+       break;
++#ifdef USE_NNTP
++    case 'R':
++      if (!optional)
++      mutt_format_s (dest, destlen, prefix, hdr->env->x_comment_to ? hdr->env->x_comment_to : "");
++      else if (!hdr->env->x_comment_to)
++      optional = 0;
++      break;
++#endif
++
+     case 's':
+       
+       if (flags & M_FORMAT_TREE && !hdr->collapsed)
+@@ -637,6 +655,13 @@ hdr_format_str (char *dest,
        mutt_format_s (dest, destlen, prefix, buf2);
        break;
  
@@ -2439,23 +2495,23 @@ diff -udprP mutt-1.5.13.orig/hdrline.c mutt-1.5.13/hdrline.c
      case 'Z':
      
        ch = ' ';
-diff -udprP mutt-1.5.13.orig/headers.c mutt-1.5.13/headers.c
---- mutt-1.5.13.orig/headers.c 2006-04-20 19:46:28.000000000 +0300
-+++ mutt-1.5.13/headers.c      2006-08-15 13:04:56.000000000 +0300
-@@ -118,6 +118,9 @@ void mutt_edit_headers (const char *edit
-   msg->env = n; n = NULL;
-   if (!msg->env->in_reply_to)
+diff -udprP mutt-1.5.21.orig/headers.c mutt-1.5.21/headers.c
+--- mutt-1.5.21.orig/headers.c 2009-08-25 22:08:52.000000000 +0300
++++ mutt-1.5.21/headers.c      2010-09-16 13:14:39.000000000 +0300
+@@ -114,6 +114,9 @@ void mutt_edit_headers (const char *edit
+      $edit_headers set, we remove References: as they're likely invalid;
+      we can simply compare strings as we don't generate References for
+      multiple Message-Ids in IRT anyways */
 +#ifdef USE_NNTP
 +  if (!option (OPTNEWSSEND))
 +#endif
-     mutt_free_list (&msg->env->references);
-   mutt_expand_aliases_env (msg->env);
-diff -udprP mutt-1.5.13.orig/init.c mutt-1.5.13/init.c
---- mutt-1.5.13.orig/init.c    2006-07-05 11:40:05.000000000 +0300
-+++ mutt-1.5.13/init.c 2006-08-15 13:04:56.000000000 +0300
-@@ -2839,6 +2839,28 @@ void mutt_init (int skip_sys_rc, LIST *c
+   if (!n->in_reply_to || (msg->env->in_reply_to &&
+                         mutt_strcmp (n->in_reply_to->data,
+                                      msg->env->in_reply_to->data) != 0))
+diff -udprP mutt-1.5.21.orig/init.c mutt-1.5.21/init.c
+--- mutt-1.5.21.orig/init.c    2010-08-25 19:31:40.000000000 +0300
++++ mutt-1.5.21/init.c 2010-09-16 13:14:39.000000000 +0300
+@@ -2966,6 +2966,28 @@ void mutt_init (int skip_sys_rc, LIST *c
    else
      Fqdn = safe_strdup(NONULL(Hostname));
  
@@ -2484,32 +2540,32 @@ diff -udprP mutt-1.5.13.orig/init.c mutt-1.5.13/init.c
    if ((p = getenv ("MAIL")))
      Spoolfile = safe_strdup (p);
    else if ((p = getenv ("MAILDIR")))
-diff -udprP mutt-1.5.13.orig/init.h mutt-1.5.13/init.h
---- mutt-1.5.13.orig/init.h    2006-08-11 12:04:04.000000000 +0300
-+++ mutt-1.5.13/init.h 2006-08-15 13:04:56.000000000 +0300
-@@ -215,6 +215,20 @@ struct option_t MuttVars[] = {
-   ** If set, Mutt will prompt you for carbon-copy (Cc) recipients before
+diff -udprP mutt-1.5.21.orig/init.h mutt-1.5.21/init.h
+--- mutt-1.5.21.orig/init.h    2010-09-15 18:39:31.000000000 +0300
++++ mutt-1.5.21/init.h 2010-09-16 13:14:39.000000000 +0300
+@@ -176,6 +176,20 @@ struct option_t MuttVars[] = {
+   ** If \fIset\fP, Mutt will prompt you for carbon-copy (Cc) recipients before
    ** editing the body of an outgoing message.
-   */  
+   */
 +#ifdef USE_NNTP
 +  { "ask_follow_up",  DT_BOOL, R_NONE, OPTASKFOLLOWUP, 0 },
 +  /*
 +  ** .pp
 +  ** If set, Mutt will prompt you for follow-up groups before editing
 +  ** the body of an outgoing message.
-+  */  
++  */
 +  { "ask_x_comment_to",       DT_BOOL, R_NONE, OPTASKXCOMMENTTO, 0 },
 +  /*
 +  ** .pp
 +  ** If set, Mutt will prompt you for x-comment-to field before editing
 +  ** the body of an outgoing message.
-+  */  
++  */
 +#endif
-   { "attach_format",  DT_STR,  R_NONE, UL &AttachFormat, UL "%u%D%I %t%4n %T%.40d%> [%.7m/%.10M, %.6e%?C?, %C?, %s] " },
+   { "assumed_charset", DT_STR, R_NONE, UL &AssumedCharset, UL 0},
    /*
    ** .pp
-@@ -318,6 +332,14 @@ struct option_t MuttVars[] = {
-   ** follow these menus.  The option is disabled by default because many 
+@@ -322,6 +336,14 @@ struct option_t MuttVars[] = {
+   ** follow these menus.  The option is \fIunset\fP by default because many
    ** visual terminals don't permit making the cursor invisible.
    */
 +#ifdef USE_NNTP
@@ -2520,10 +2576,10 @@ diff -udprP mutt-1.5.13.orig/init.h mutt-1.5.13/init.h
 +  ** as read when you quit the newsgroup (catchup newsgroup).
 +  */
 +#endif
-   { "charset",                DT_STR,  R_NONE, UL &Charset, UL 0 },
+ #if defined(USE_SSL)
+   { "certificate_file",       DT_PATH, R_NONE, UL &SslCertFile, UL "~/.mutt_certificates" },
    /*
-   ** .pp
-@@ -639,6 +661,16 @@ struct option_t MuttVars[] = {
+@@ -798,6 +820,16 @@ struct option_t MuttVars[] = {
    ** sent to both the list and your address, resulting in two copies
    ** of the same email for you.
    */
@@ -2540,9 +2596,9 @@ diff -udprP mutt-1.5.13.orig/init.h mutt-1.5.13/init.h
    { "force_name",     DT_BOOL, R_NONE, OPTFORCENAME, 0 },
    /*
    ** .pp
-@@ -710,6 +742,27 @@ struct option_t MuttVars[] = {
+@@ -880,6 +912,27 @@ struct option_t MuttVars[] = {
    ** a regular expression that will match the whole name so mutt will expand
-   ** "Franklin" to "Franklin, Steve".
+   ** ``Franklin'' to ``Franklin, Steve''.
    */
 +#ifdef USE_NNTP
 +  { "group_index_format", DT_STR, R_BOTH, UL &GroupFormat, UL "%4C %M%N %5s  %-45.45f %d" },
@@ -2568,25 +2624,32 @@ diff -udprP mutt-1.5.13.orig/init.h mutt-1.5.13/init.h
    { "hdr_format",     DT_SYN,  R_NONE, UL "index_format", 0 },
    /*
    */
-@@ -995,6 +1048,7 @@ struct option_t MuttVars[] = {
+@@ -1256,6 +1309,7 @@ struct option_t MuttVars[] = {
    ** .dt %E .dd number of messages in current thread
-   ** .dt %f .dd entire From: line (address + real name)
+   ** .dt %f .dd sender (address + real name), either From: or Return-Path:
    ** .dt %F .dd author name, or recipient name if the message is from you
 +  ** .dt %g .dd newsgroup name (if compiled with nntp support)
    ** .dt %H .dd spam attribute(s) of this message
    ** .dt %i .dd message-id of the current message
    ** .dt %l .dd number of lines in the message (does not work with maildir,
-@@ -1014,6 +1068,7 @@ struct option_t MuttVars[] = {
+@@ -1271,12 +1325,14 @@ struct option_t MuttVars[] = {
+   **            stashed the message: list name or recipient name
+   **            if not sent to a list
+   ** .dt %P .dd progress indicator for the built-in pager (how much of the file has been displayed)
++  ** .dt %R .dd ``x-comment-to:'' field (if present and compiled with nntp support)
+   ** .dt %s .dd subject of the message
+   ** .dt %S .dd status of the message (``N''/``D''/``d''/``!''/``r''/\(as)
+   ** .dt %t .dd ``To:'' field (recipients)
    ** .dt %T .dd the appropriate character from the $$to_chars string
    ** .dt %u .dd user (login) name of the author
    ** .dt %v .dd first name of the author, or the recipient if the message is from you
-+  ** .dt %W .dd name of organization of author (`organization:' field)
++  ** .dt %W .dd name of organization of author (``organization:'' field)
    ** .dt %X .dd number of attachments
    **            (please see the ``$attachments'' section for possible speed effects)
-   ** .dt %y .dd `x-label:' field, if present
-@@ -1038,6 +1093,21 @@ struct option_t MuttVars[] = {
-   ** .pp
-   ** See also: ``$$to_chars''.
+   ** .dt %y .dd ``X-Label:'' field, if present
+@@ -1311,6 +1367,21 @@ struct option_t MuttVars[] = {
+   ** Note that these expandos are supported in
+   ** ``$save-hook'', ``$fcc-hook'' and ``$fcc-save-hook'', too.
    */
 +#ifdef USE_NNTP
 +  { "inews",          DT_PATH, R_NONE, UL &Inews, UL "" },
@@ -2606,10 +2669,10 @@ diff -udprP mutt-1.5.13.orig/init.h mutt-1.5.13/init.h
    { "ispell",         DT_PATH, R_NONE, UL &Ispell, UL ISPELL },
    /*
    ** .pp
-@@ -1252,6 +1322,16 @@ struct option_t MuttVars[] = {
-   ** be attached to the newly composed message if this option is set.
+@@ -1545,6 +1616,15 @@ struct option_t MuttVars[] = {
+   ** menu, attachments which cannot be decoded in a reasonable manner will
+   ** be attached to the newly composed message if this option is \fIset\fP.
    */
 +#ifdef USE_NNTP
 +  { "mime_subject",   DT_BOOL, R_NONE, OPTMIMESUBJECT, 1 },
 +  /*
@@ -2619,14 +2682,13 @@ diff -udprP mutt-1.5.13.orig/init.h mutt-1.5.13/init.h
 +  ** is Usenet article, because MIME for news is nonstandard feature.
 +  */
 +#endif
-+
  #ifdef MIXMASTER
    { "mix_entry_format", DT_STR,  R_NONE, UL &MixEntryFormat, UL "%4n %c %-16s %a" },
    /*
-@@ -1322,6 +1402,77 @@ struct option_t MuttVars[] = {
-    ** See also ``$$read_inc'' and ``$$write_inc''.
+@@ -1592,6 +1672,77 @@ struct option_t MuttVars[] = {
+    ** See also $$read_inc, $$write_inc and $$net_inc.
     */
- #endif  
+ #endif
 +#ifdef USE_NNTP
 +  { "news_cache_dir", DT_PATH, R_NONE, UL &NewsCacheDir, UL "~/.mutt" },
 +  /*
@@ -2643,7 +2705,7 @@ diff -udprP mutt-1.5.13.orig/init.h mutt-1.5.13/init.h
 +  ** $$$NNTPSERVER or contained in the file /etc/nntpserver.  You can also
 +  ** specify username and an alternative port for each newsserver, ie:
 +  ** .pp
-+  ** [nntp[s]://][username[:password]@]newsserver[:port]
++  ** [news[s]://][username[:password]@]newsserver[:port]
 +  */
 +  { "newsrc",         DT_PATH, R_NONE, UL &NewsRc, UL "~/.newsrc" },
 +  /*
@@ -2701,7 +2763,7 @@ diff -udprP mutt-1.5.13.orig/init.h mutt-1.5.13/init.h
    { "pager",          DT_PATH, R_NONE, UL &Pager, UL "builtin" },
    /*
    ** .pp
-@@ -2132,6 +2283,16 @@ struct option_t MuttVars[] = {
+@@ -2091,6 +2242,16 @@ struct option_t MuttVars[] = {
    { "post_indent_str",  DT_SYN,  R_NONE, UL "post_indent_string", 0 },
    /*
    */
@@ -2718,9 +2780,9 @@ diff -udprP mutt-1.5.13.orig/init.h mutt-1.5.13/init.h
    { "postpone",               DT_QUAD, R_NONE, OPT_POSTPONE, M_ASKYES },
    /*
    ** .pp
-@@ -2480,6 +2641,28 @@ struct option_t MuttVars[] = {
+@@ -2494,6 +2655,28 @@ struct option_t MuttVars[] = {
    ** Command to use when spawning a subshell.  By default, the user's login
-   ** shell from /etc/passwd is used.
+   ** shell from \fC/etc/passwd\fP is used.
    */
 +#ifdef USE_NNTP
 +  { "save_unsubscribed",DT_BOOL, R_NONE, OPTSAVEUNSUB, 0 },
@@ -2747,9 +2809,9 @@ diff -udprP mutt-1.5.13.orig/init.h mutt-1.5.13/init.h
    { "sig_dashes",     DT_BOOL, R_NONE, OPTSIGDASHES, 1 },
    /*
    ** .pp
-@@ -2939,6 +3122,14 @@ struct option_t MuttVars[] = {
-   ** Controls whether mutt writes out the Bcc header when preparing
-   ** messages to be sent.  Exim users may wish to unset this.
+@@ -3364,6 +3547,14 @@ struct option_t MuttVars[] = {
+   ** Also see the $$read_inc, $$net_inc and $$time_inc variables and the
+   ** ``$tuning'' section of the manual for performance considerations.
    */
 +#ifdef USE_NNTP
 +  { "x_comment_to",   DT_BOOL, R_NONE, OPTXCOMMENTTO, 0 },
@@ -2760,12 +2822,12 @@ diff -udprP mutt-1.5.13.orig/init.h mutt-1.5.13/init.h
 +  */
 +#endif
    /*--*/
-   { NULL }
+   { NULL, 0, 0, 0, 0 }
  };
-diff -udprP mutt-1.5.13.orig/keymap.c mutt-1.5.13/keymap.c
---- mutt-1.5.13.orig/keymap.c  2005-09-18 11:22:22.000000000 +0300
-+++ mutt-1.5.13/keymap.c       2006-08-15 13:04:56.000000000 +0300
-@@ -629,7 +629,6 @@ void km_init (void)
+diff -udprP mutt-1.5.21.orig/keymap.c mutt-1.5.21/keymap.c
+--- mutt-1.5.21.orig/keymap.c  2010-09-13 20:19:55.000000000 +0300
++++ mutt-1.5.21/keymap.c       2010-09-16 13:14:39.000000000 +0300
+@@ -780,7 +780,6 @@ void km_init (void)
    km_bindkey ("<enter>", MENU_MAIN, OP_DISPLAY_MESSAGE);
  
    km_bindkey ("x", MENU_PAGER, OP_EXIT);
@@ -2773,9 +2835,9 @@ diff -udprP mutt-1.5.13.orig/keymap.c mutt-1.5.13/keymap.c
    km_bindkey ("<backspace>", MENU_PAGER, OP_PREV_LINE);
    km_bindkey ("<pagedown>", MENU_PAGER, OP_NEXT_PAGE);
    km_bindkey ("<pageup>", MENU_PAGER, OP_PREV_PAGE);
-diff -udprP mutt-1.5.13.orig/mailbox.h mutt-1.5.13/mailbox.h
---- mutt-1.5.13.orig/mailbox.h 2005-09-18 11:22:22.000000000 +0300
-+++ mutt-1.5.13/mailbox.h      2006-08-15 13:04:56.000000000 +0300
+diff -udprP mutt-1.5.21.orig/mailbox.h mutt-1.5.21/mailbox.h
+--- mutt-1.5.21.orig/mailbox.h 2009-04-30 20:33:48.000000000 +0300
++++ mutt-1.5.21/mailbox.h      2010-09-16 13:14:39.000000000 +0300
 @@ -74,6 +74,9 @@ int mx_is_imap (const char *);
  #ifdef USE_POP
  int mx_is_pop (const char *);
@@ -2786,21 +2848,21 @@ diff -udprP mutt-1.5.13.orig/mailbox.h mutt-1.5.13/mailbox.h
  
  int mx_access (const char*, int);
  int mx_check_empty (const char *);
-diff -udprP mutt-1.5.13.orig/main.c mutt-1.5.13/main.c
---- mutt-1.5.13.orig/main.c    2006-08-11 12:07:12.000000000 +0300
-+++ mutt-1.5.13/main.c 2006-08-15 13:04:56.000000000 +0300
-@@ -56,6 +56,10 @@
+diff -udprP mutt-1.5.21.orig/main.c mutt-1.5.21/main.c
+--- mutt-1.5.21.orig/main.c    2010-09-13 20:19:55.000000000 +0300
++++ mutt-1.5.21/main.c 2010-09-16 13:14:39.000000000 +0300
+@@ -60,6 +60,10 @@
  #include <stringprep.h>
  #endif
  
 +#ifdef USE_NNTP
-+#include <nntp.h>
++#include "nntp.h"
 +#endif
 +
  static const char *ReachingUs = N_("\
  To contact the developers, please mail to <mutt-dev@mutt.org>.\n\
  To report a bug, please visit http://bugs.mutt.org/.\n");
-@@ -127,6 +131,8 @@ options:\n\
+@@ -134,6 +138,8 @@ options:\n\
  "  -e <command>\tspecify a command to be executed after initialization\n\
    -f <file>\tspecify which mailbox to read\n\
    -F <file>\tspecify an alternate muttrc file\n\
@@ -2809,7 +2871,7 @@ diff -udprP mutt-1.5.13.orig/main.c mutt-1.5.13/main.c
    -H <file>\tspecify a draft file to read header and body from\n\
    -i <file>\tspecify a file which Mutt should include in the body\n\
    -m <type>\tspecify a default mailbox type\n\
-@@ -251,6 +257,12 @@ static void show_version (void)
+@@ -254,6 +260,12 @@ static void show_version (void)
        "-USE_POP  "
  #endif
  
@@ -2822,7 +2884,7 @@ diff -udprP mutt-1.5.13.orig/main.c mutt-1.5.13/main.c
  #ifdef USE_IMAP
          "+USE_IMAP  "
  #else
-@@ -518,6 +530,9 @@ static void start_curses (void)
+@@ -522,6 +534,9 @@ init_extended_keys();
  #define M_NOSYSRC (1<<2)      /* -n */
  #define M_RO      (1<<3)      /* -R */
  #define M_SELECT  (1<<4)      /* -y */
@@ -2832,19 +2894,19 @@ diff -udprP mutt-1.5.13.orig/main.c mutt-1.5.13/main.c
  
  int main (int argc, char **argv)
  {
-@@ -566,7 +581,11 @@ int main (int argc, char **argv)
-   memset (Options, 0, sizeof (Options));
-   memset (QuadOptions, 0, sizeof (QuadOptions));
-   
+@@ -594,7 +609,11 @@ int main (int argc, char **argv)
+         argv[nargc++] = argv[optind];
+     }
 +#ifdef USE_NNTP
-+  while ((i = getopt (argc, argv, "A:a:b:F:f:c:Dd:e:g:GH:s:i:hm:npQ:RvxyzZ")) != EOF)
++    if ((i = getopt (argc, argv, "+A:a:b:F:f:c:Dd:e:g:GH:s:i:hm:npQ:RvxyzZ")) != EOF)
 +#else
-   while ((i = getopt (argc, argv, "A:a:b:F:f:c:Dd:e:H:s:i:hm:npQ:RvxyzZ")) != EOF)
+     if ((i = getopt (argc, argv, "+A:a:b:F:f:c:Dd:e:H:s:i:hm:npQ:RvxyzZ")) != EOF)
 +#endif
-     switch (i)
-     {
+       switch (i)
+       {
        case 'A':
-@@ -659,6 +678,20 @@ int main (int argc, char **argv)
+@@ -691,6 +710,20 @@ int main (int argc, char **argv)
        flags |= M_SELECT;
        break;
  
@@ -2865,7 +2927,7 @@ diff -udprP mutt-1.5.13.orig/main.c mutt-1.5.13/main.c
        case 'z':
        flags |= M_IGNORE;
        break;
-@@ -921,6 +954,18 @@ int main (int argc, char **argv)
+@@ -978,6 +1011,18 @@ int main (int argc, char **argv)
      }
      else if (flags & M_SELECT)
      {
@@ -2884,7 +2946,7 @@ diff -udprP mutt-1.5.13.orig/main.c mutt-1.5.13/main.c
        if (!Incoming) {
        mutt_endwin _("No incoming mailboxes defined.");
        exit (1);
-@@ -936,6 +981,15 @@ int main (int argc, char **argv)
+@@ -993,6 +1038,15 @@ int main (int argc, char **argv)
  
      if (!folder[0])
        strfcpy (folder, NONULL(Spoolfile), sizeof (folder));
@@ -2900,10 +2962,10 @@ diff -udprP mutt-1.5.13.orig/main.c mutt-1.5.13/main.c
      mutt_expand_path (folder, sizeof (folder));
  
      mutt_str_replace (&CurrentFolder, folder);
-diff -udprP mutt-1.5.13.orig/mutt.h mutt-1.5.13/mutt.h
---- mutt-1.5.13.orig/mutt.h    2006-08-11 12:22:15.000000000 +0300
-+++ mutt-1.5.13/mutt.h 2006-08-15 13:04:56.000000000 +0300
-@@ -240,6 +240,9 @@ enum
+diff -udprP mutt-1.5.21.orig/mutt.h mutt-1.5.21/mutt.h
+--- mutt-1.5.21.orig/mutt.h    2010-09-13 20:19:55.000000000 +0300
++++ mutt-1.5.21/mutt.h 2010-09-16 13:14:39.000000000 +0300
+@@ -229,6 +229,9 @@ enum
    M_PGP_KEY,
    M_XLABEL,
    M_MIMEATTACH,
@@ -2913,7 +2975,7 @@ diff -udprP mutt-1.5.13.orig/mutt.h mutt-1.5.13/mutt.h
    
    /* Options for Mailcap lookup */
    M_EDIT,
-@@ -295,6 +298,12 @@ enum
+@@ -285,6 +288,12 @@ enum
  #endif
    OPT_SUBJECT,
    OPT_VERIFYSIG,      /* verify PGP signatures */
@@ -2926,7 +2988,7 @@ diff -udprP mutt-1.5.13.orig/mutt.h mutt-1.5.13/mutt.h
      
    /* THIS MUST BE THE LAST VALUE. */
    OPT_MAX
-@@ -310,6 +319,7 @@ enum
+@@ -300,6 +309,7 @@ enum
  #define SENDMAILX     (1<<6)
  #define SENDKEY               (1<<7)
  #define SENDRESEND    (1<<8)
@@ -2934,7 +2996,7 @@ diff -udprP mutt-1.5.13.orig/mutt.h mutt-1.5.13/mutt.h
  
  /* flags to _mutt_select_file() */
  #define M_SEL_BUFFY   (1<<0)
-@@ -329,6 +339,8 @@ enum
+@@ -319,6 +329,8 @@ enum
    OPTASCIICHARS,
    OPTASKBCC,
    OPTASKCC,
@@ -2943,7 +3005,7 @@ diff -udprP mutt-1.5.13.orig/mutt.h mutt-1.5.13/mutt.h
    OPTATTACHSPLIT,
    OPTAUTOEDIT,
    OPTAUTOTAG,
-@@ -399,6 +411,9 @@ enum
+@@ -397,6 +409,9 @@ enum
    OPTMETOO,
    OPTMHPURGE,
    OPTMIMEFORWDECODE,
@@ -2953,7 +3015,7 @@ diff -udprP mutt-1.5.13.orig/mutt.h mutt-1.5.13/mutt.h
    OPTNARROWTREE,
    OPTPAGERSTOP,
    OPTPIPEDECODE,
-@@ -479,6 +494,16 @@ enum
+@@ -478,6 +493,16 @@ enum
    OPTPGPAUTOINLINE,
    OPTPGPREPLYINLINE,
  
@@ -2970,7 +3032,7 @@ diff -udprP mutt-1.5.13.orig/mutt.h mutt-1.5.13/mutt.h
    /* pseudo options */
  
    OPTAUXSORT,         /* (pseudo) using auxillary sort function */
-@@ -499,6 +524,7 @@ enum
+@@ -498,6 +523,7 @@ enum
    OPTSORTSUBTHREADS,  /* (pseudo) used when $sort_aux changes */
    OPTNEEDRESCORE,     /* (pseudo) set when the `score' command is used */
    OPTATTACHMSG,               /* (pseudo) used by attach-message */
@@ -2978,7 +3040,7 @@ diff -udprP mutt-1.5.13.orig/mutt.h mutt-1.5.13/mutt.h
    OPTKEEPQUIET,               /* (pseudo) shut up the message and refresh
                         *          functions while we are executing an
                         *          external program.
-@@ -509,6 +535,12 @@ enum
+@@ -508,6 +534,12 @@ enum
    OPTDONTHANDLEPGPKEYS,       /* (pseudo) used to extract PGP keys */
    OPTUNBUFFEREDINPUT,   /* (pseudo) don't use key buffer */
  
@@ -2991,7 +3053,7 @@ diff -udprP mutt-1.5.13.orig/mutt.h mutt-1.5.13/mutt.h
    OPTMAX
  };
  
-@@ -586,6 +618,13 @@ typedef struct envelope
+@@ -587,6 +619,13 @@ typedef struct envelope
    char *supersedes;
    char *date;
    char *x_label;
@@ -3005,7 +3067,7 @@ diff -udprP mutt-1.5.13.orig/mutt.h mutt-1.5.13/mutt.h
    BUFFER *spam;
    LIST *references;           /* message references (in reverse order) */
    LIST *in_reply_to;          /* in-reply-to header content */
-@@ -751,6 +790,9 @@ typedef struct header
+@@ -756,6 +795,9 @@ typedef struct header
    ENVELOPE *env;              /* envelope information */
    BODY *content;              /* list of MIME parts */
    char *path;
@@ -3014,8 +3076,8 @@ diff -udprP mutt-1.5.13.orig/mutt.h mutt-1.5.13/mutt.h
 +#endif
    
    char *tree;                 /* character string to print thread tree */
-   struct thread *thread;
-@@ -766,7 +808,7 @@ typedef struct header
+   THREAD *thread;
+@@ -771,7 +813,7 @@ typedef struct header
    int refno;                  /* message number on server */
  #endif
  
@@ -3024,19 +3086,10 @@ diff -udprP mutt-1.5.13.orig/mutt.h mutt-1.5.13/mutt.h
    void *data;                 /* driver-specific data */
  #endif
    
-@@ -857,7 +899,7 @@ typedef struct
-   int deleted;                        /* how many deleted messages */
-   int flagged;                        /* how many flagged messages */
-   int msgnotreadyet;          /* which msg "new" in pager, -1 if none */
--#if defined USE_POP || defined USE_IMAP
-+#if defined USE_POP || defined USE_IMAP || defined USE_NNTP
-   void *data;                 /* driver specific data */
- #endif /* USE_IMAP */
-diff -udprP mutt-1.5.13.orig/muttlib.c mutt-1.5.13/muttlib.c
---- mutt-1.5.13.orig/muttlib.c 2006-06-08 14:51:03.000000000 +0300
-+++ mutt-1.5.13/muttlib.c      2006-08-15 13:04:56.000000000 +0300
-@@ -286,7 +286,7 @@ void mutt_free_header (HEADER **h)
+diff -udprP mutt-1.5.21.orig/muttlib.c mutt-1.5.21/muttlib.c
+--- mutt-1.5.21.orig/muttlib.c 2010-08-25 19:31:40.000000000 +0300
++++ mutt-1.5.21/muttlib.c      2010-09-16 13:14:39.000000000 +0300
+@@ -337,7 +337,7 @@ void mutt_free_header (HEADER **h)
  #ifdef MIXMASTER
    mutt_free_list (&(*h)->chain);
  #endif
@@ -3045,7 +3098,7 @@ diff -udprP mutt-1.5.13.orig/muttlib.c mutt-1.5.13/muttlib.c
    FREE (&(*h)->data);
  #endif
    FREE (h);           /* __FREE_CHECKED__ */
-@@ -671,6 +671,13 @@ void mutt_free_envelope (ENVELOPE **p)
+@@ -722,6 +722,13 @@ void mutt_free_envelope (ENVELOPE **p)
    FREE (&(*p)->supersedes);
    FREE (&(*p)->date);
    FREE (&(*p)->x_label);
@@ -3059,7 +3112,7 @@ diff -udprP mutt-1.5.13.orig/muttlib.c mutt-1.5.13/muttlib.c
  
    mutt_buffer_free (&(*p)->spam);
  
-@@ -1275,6 +1282,14 @@ int mutt_save_confirm (const char *s, st
+@@ -1525,6 +1532,14 @@ int mutt_save_confirm (const char *s, st
      }
    }
  
@@ -3074,21 +3127,10 @@ diff -udprP mutt-1.5.13.orig/muttlib.c mutt-1.5.13/muttlib.c
    if (stat (s, st) != -1)
    {
      if (magic == -1)
-diff -udprP mutt-1.5.13.orig/mx.c mutt-1.5.13/mx.c
---- mutt-1.5.13.orig/mx.c      2006-05-18 21:44:29.000000000 +0300
-+++ mutt-1.5.13/mx.c   2006-08-15 13:04:56.000000000 +0300
-@@ -38,6 +38,10 @@
- #include "pop.h"
- #endif
-+#ifdef USE_NNTP
-+#include "nntp.h"
-+#endif
-+
- #ifdef BUFFY_SIZE
- #include "buffy.h"
- #endif
-@@ -352,6 +356,22 @@ int mx_is_pop (const char *p)
+diff -udprP mutt-1.5.21.orig/mx.c mutt-1.5.21/mx.c
+--- mutt-1.5.21.orig/mx.c      2010-09-13 20:19:55.000000000 +0300
++++ mutt-1.5.21/mx.c   2010-09-16 13:14:39.000000000 +0300
+@@ -343,6 +343,22 @@ int mx_is_pop (const char *p)
  }
  #endif
  
@@ -3111,7 +3153,7 @@ diff -udprP mutt-1.5.13.orig/mx.c mutt-1.5.13/mx.c
  int mx_get_magic (const char *path)
  {
    struct stat st;
-@@ -369,6 +389,11 @@ int mx_get_magic (const char *path)
+@@ -360,6 +376,11 @@ int mx_get_magic (const char *path)
      return M_POP;
  #endif /* USE_POP */
  
@@ -3123,7 +3165,7 @@ diff -udprP mutt-1.5.13.orig/mx.c mutt-1.5.13/mx.c
    if (stat (path, &st) == -1)
    {
      dprint (1, (debugfile, "mx_get_magic(): unable to stat %s: %s (errno %d).\n",
-@@ -705,6 +730,12 @@ CONTEXT *mx_open_mailbox (const char *pa
+@@ -668,6 +689,12 @@ CONTEXT *mx_open_mailbox (const char *pa
        break;
  #endif /* USE_POP */
  
@@ -3136,18 +3178,7 @@ diff -udprP mutt-1.5.13.orig/mx.c mutt-1.5.13/mx.c
      default:
        rc = -1;
        break;
-@@ -750,6 +781,10 @@ void mx_fastclose_mailbox (CONTEXT *ctx)
-   if (ctx->magic == M_POP)
-     pop_close_mailbox (ctx);
- #endif /* USE_POP */
-+#ifdef USE_NNTP
-+  if (ctx->magic == M_NNTP)
-+    nntp_fastclose_mailbox (ctx);
-+#endif /* USE_NNTP */
-   if (ctx->subj_hash)
-     hash_destroy (&ctx->subj_hash, NULL);
-   if (ctx->id_hash)
-@@ -805,6 +840,12 @@ static int sync_mailbox (CONTEXT *ctx, i
+@@ -764,6 +791,12 @@ static int sync_mailbox (CONTEXT *ctx, i
        rc = pop_sync_mailbox (ctx, index_hint);
        break;
  #endif /* USE_POP */
@@ -3160,7 +3191,7 @@ diff -udprP mutt-1.5.13.orig/mx.c mutt-1.5.13/mx.c
    }
  
  #if 0
-@@ -833,6 +874,16 @@ int mx_close_mailbox (CONTEXT *ctx, int 
+@@ -790,6 +823,16 @@ int mx_close_mailbox (CONTEXT *ctx, int 
  
    ctx->closing = 1;
  
@@ -3177,7 +3208,7 @@ diff -udprP mutt-1.5.13.orig/mx.c mutt-1.5.13/mx.c
    if (ctx->readonly || ctx->dontwrite)
    {
      /* mailbox is readonly or we don't want to write */
-@@ -1370,6 +1421,11 @@ int mx_check_mailbox (CONTEXT *ctx, int 
+@@ -1341,6 +1384,11 @@ int mx_check_mailbox (CONTEXT *ctx, int 
        case M_POP:
        return (pop_check_mailbox (ctx, index_hint));
  #endif /* USE_POP */
@@ -3189,7 +3220,7 @@ diff -udprP mutt-1.5.13.orig/mx.c mutt-1.5.13/mx.c
      }
    }
  
-@@ -1430,6 +1486,15 @@ MESSAGE *mx_open_message (CONTEXT *ctx, 
+@@ -1401,6 +1449,15 @@ MESSAGE *mx_open_message (CONTEXT *ctx, 
      }
  #endif /* USE_POP */
  
@@ -3205,37 +3236,37 @@ diff -udprP mutt-1.5.13.orig/mx.c mutt-1.5.13/mx.c
      default:
        dprint (1, (debugfile, "mx_open_message(): function not implemented for mailbox type %d.\n", ctx->magic));
        FREE (&msg);
-@@ -1511,6 +1576,9 @@ int mx_close_message (MESSAGE **msg)
- #ifdef USE_POP
-       || (*msg)->magic == M_POP
- #endif
+@@ -1476,6 +1533,9 @@ int mx_close_message (MESSAGE **msg)
+   int r = 0;
+   if ((*msg)->magic == M_MH || (*msg)->magic == M_MAILDIR
 +#ifdef USE_NNTP
 +      || (*msg)->magic == M_NNTP
 +#endif
-       )
+       || (*msg)->magic == M_IMAP || (*msg)->magic == M_POP)
    {
      r = safe_fclose (&(*msg)->fp);
-diff -udprP mutt-1.5.13.orig/mx.h mutt-1.5.13/mx.h
---- mutt-1.5.13.orig/mx.h      2005-09-18 11:22:22.000000000 +0300
-+++ mutt-1.5.13/mx.h   2006-08-15 13:04:56.000000000 +0300
-@@ -40,6 +40,9 @@ enum
- #ifdef USE_POP
-   , M_POP
- #endif
-+#ifdef USE_NNTP
-+  , M_NNTP
-+#endif
+diff -udprP mutt-1.5.21.orig/mx.h mutt-1.5.21/mx.h
+--- mutt-1.5.21.orig/mx.h      2009-08-25 22:08:52.000000000 +0300
++++ mutt-1.5.21/mx.h   2010-09-16 13:14:39.000000000 +0300
+@@ -34,6 +34,9 @@ enum
+   M_MMDF,
+   M_MH,
+   M_MAILDIR,
++#ifdef USE_NNTP
++  M_NNTP,
++#endif
+   M_IMAP,
+   M_POP
  };
- WHERE short DefaultMagic INITVAL (M_MBOX);
-diff -udprP mutt-1.5.13.orig/newsrc.c mutt-1.5.13/newsrc.c
---- mutt-1.5.13.orig/newsrc.c  1970-01-01 03:00:00.000000000 +0300
-+++ mutt-1.5.13/newsrc.c       2006-08-15 13:04:56.000000000 +0300
+diff -udprP mutt-1.5.21.orig/newsrc.c mutt-1.5.21/newsrc.c
+--- mutt-1.5.21.orig/newsrc.c  1970-01-01 03:00:00.000000000 +0300
++++ mutt-1.5.21/newsrc.c       2010-09-16 13:14:39.000000000 +0300
 @@ -0,0 +1,1170 @@
 +/*
 + * Copyright (C) 1998 Brandon Long <blong@fiction.net>
 + * Copyright (C) 1999 Andrej Gritsenko <andrej@lucky.net>
-+ * Copyright (C) 2000-2006 Vsevolod Volkov <vvv@mutt.org.ua>
++ * Copyright (C) 2000-2009 Vsevolod Volkov <vvv@mutt.org.ua>
 + * 
 + *     This program is free software; you can redistribute it and/or modify
 + *     it under the terms of the GNU General Public License as published by
@@ -3319,7 +3350,7 @@ diff -udprP mutt-1.5.13.orig/newsrc.c mutt-1.5.13/newsrc.c
 +    data->nserv = news;
 +    data->deleted = 1;
 +    if (news->newsgroups->nelem < news->newsgroups->curnelem * 2)
-+      news->newsgroups = hash_resize (news->newsgroups, news->newsgroups->nelem * 2);
++      news->newsgroups = hash_resize (news->newsgroups, news->newsgroups->nelem * 2, 0);
 +    hash_insert (news->newsgroups, data->group, data, 0);
 +    nntp_add_to_list (news, data);
 +  }
@@ -3477,7 +3508,7 @@ diff -udprP mutt-1.5.13.orig/newsrc.c mutt-1.5.13/newsrc.c
 +      data->nserv = news;
 +      data->deleted = 1;
 +      if (news->newsgroups->nelem < news->newsgroups->curnelem * 2)
-+        news->newsgroups = hash_resize (news->newsgroups, news->newsgroups->nelem * 2);
++        news->newsgroups = hash_resize (news->newsgroups, news->newsgroups->nelem * 2, 0);
 +      hash_insert (news->newsgroups, data->group, data, 0);
 +      nntp_add_to_list (news, data);
 +      }
@@ -3499,7 +3530,7 @@ diff -udprP mutt-1.5.13.orig/newsrc.c mutt-1.5.13/newsrc.c
 +}
 +
 +const char *
-+nntp_format_str (char *dest, size_t destlen, char op, const char *src,
++nntp_format_str (char *dest, size_t destlen, size_t col, char op, const char *src,
 +              const char *fmt, const char *ifstring, const char *elsestring,
 +              unsigned long data, format_flag flags)
 +{
@@ -3591,7 +3622,7 @@ diff -udprP mutt-1.5.13.orig/newsrc.c mutt-1.5.13/newsrc.c
 +  buf = p = safe_calloc (strlen (server) + 10, sizeof (char));
 +  if (url_check_scheme (server) == U_UNKNOWN)
 +  {
-+    strcpy (buf, "nntp://");
++    strcpy (buf, "news://");
 +    p = strchr (buf, '\0');
 +  }
 +  strcpy (p, server);
@@ -3608,7 +3639,7 @@ diff -udprP mutt-1.5.13.orig/newsrc.c mutt-1.5.13/newsrc.c
 +  if (!conn)
 +    return NULL;
 +
-+  mutt_FormatString (file, sizeof (file), NONULL (NewsRc), nntp_format_str, 0, 0);
++  mutt_FormatString (file, sizeof (file), 0, NONULL (NewsRc), nntp_format_str, 0, 0);
 +  mutt_expand_path (file, sizeof (file));
 +
 +  serv = (NNTP_SERVER *)conn->data;
@@ -3645,7 +3676,7 @@ diff -udprP mutt-1.5.13.orig/newsrc.c mutt-1.5.13/newsrc.c
 +  serv = safe_calloc (1, sizeof (NNTP_SERVER));
 +  serv->conn = conn;
 +  serv->newsrc = safe_strdup (file);
-+  serv->newsgroups = hash_create (1009);
++  serv->newsgroups = hash_create (1009, 0);
 +  slurp_newsrc (serv);                        /* load .newsrc */
 +  nntp_parse_cacheindex (serv);               /* load .index */
 +  if (option (OPTNEWSCACHE) && serv->cache && nntp_get_cache_all (serv) >= 0)
@@ -4234,9 +4265,9 @@ diff -udprP mutt-1.5.13.orig/newsrc.c mutt-1.5.13/newsrc.c
 +          tm->tm_sec, h->env->message_id);
 +      fputs (buf, f);
 +      if (h->env->references)
-+      mutt_write_references (h->env->references, f);
-+      snprintf (buf, sizeof(buf), "\t%ld\t%d\tXref: %s\n", NONULL(h->content->length),
-+          NONULL(h->lines), NONULL(h->env->xref));
++      mutt_write_references (h->env->references, f, -10);
++      snprintf (buf, sizeof(buf), "\t%ld\t%d\tXref: %s\n", (long int) h->content->length,
++          (int) h->lines, NONULL(h->env->xref));
 +      if (fputs (buf, f) == EOF)
 +      {
 +      fclose (f);
@@ -4293,7 +4324,7 @@ diff -udprP mutt-1.5.13.orig/newsrc.c mutt-1.5.13/newsrc.c
 +    data->nserv = news;
 +    data->deleted = 1;
 +    if (news->newsgroups->nelem < news->newsgroups->curnelem * 2)
-+      news->newsgroups = hash_resize (news->newsgroups, news->newsgroups->nelem * 2);
++      news->newsgroups = hash_resize (news->newsgroups, news->newsgroups->nelem * 2, 0);
 +    hash_insert (news->newsgroups, data->group, data, 0);
 +    nntp_add_to_list (news, data);
 +  }
@@ -4402,14 +4433,14 @@ diff -udprP mutt-1.5.13.orig/newsrc.c mutt-1.5.13/newsrc.c
 +    }
 +  }
 +}
-diff -udprP mutt-1.5.13.orig/nntp.c mutt-1.5.13/nntp.c
---- mutt-1.5.13.orig/nntp.c    1970-01-01 03:00:00.000000000 +0300
-+++ mutt-1.5.13/nntp.c 2006-08-15 13:04:56.000000000 +0300
-@@ -0,0 +1,1573 @@
+diff -udprP mutt-1.5.21.orig/nntp.c mutt-1.5.21/nntp.c
+--- mutt-1.5.21.orig/nntp.c    1970-01-01 03:00:00.000000000 +0300
++++ mutt-1.5.21/nntp.c 2010-09-16 13:15:46.000000000 +0300
+@@ -0,0 +1,1588 @@
 +/*
 + * Copyright (C) 1998 Brandon Long <blong@fiction.net>
 + * Copyright (C) 1999 Andrej Gritsenko <andrej@lucky.net>
-+ * Copyright (C) 2000-2004 Vsevolod Volkov <vvv@mutt.org.ua>
++ * Copyright (C) 2000-2007 Vsevolod Volkov <vvv@mutt.org.ua>
 + * 
 + *     This program is free software; you can redistribute it and/or modify
 + *     it under the terms of the GNU General Public License as published by
@@ -4852,7 +4883,7 @@ diff -udprP mutt-1.5.13.orig/nntp.c mutt-1.5.13/nntp.c
 +  int ret;
 +  HEADER *h = ctx->hdrs[ctx->msgcount];
 +
-+  mutt_mktemp (tempfile);
++  mutt_mktemp (tempfile, sizeof(tempfile));
 +  if (!(f = safe_fopen (tempfile, "w+")))
 +    return -1;
 +
@@ -5265,6 +5296,7 @@ diff -udprP mutt-1.5.13.orig/nntp.c mutt-1.5.13/nntp.c
 +    nntp_add_to_list (serv, nntp_data);
 +  }
 +  ctx->data = nntp_data;
++  ctx->mx_close = nntp_fastclose_mailbox;
 +  nntp_data->nserv = serv;
 +
 +  mutt_message (_("Selecting %s..."), nntp_data->group);
@@ -5350,7 +5382,7 @@ diff -udprP mutt-1.5.13.orig/nntp.c mutt-1.5.13/nntp.c
 +  mutt_message (m);
 +
 +  cache->index = ctx->hdrs[msgno]->index;
-+  mutt_mktemp (path);
++  mutt_mktemp (path, sizeof(path));
 +  cache->path = safe_strdup (path);
 +  if (!(msg->fp = safe_fopen (path, "w+")))
 +  {
@@ -5551,19 +5583,20 @@ diff -udprP mutt-1.5.13.orig/nntp.c mutt-1.5.13/nntp.c
 +  return 0;
 +}
 +
-+void nntp_fastclose_mailbox (CONTEXT *ctx)
++int nntp_fastclose_mailbox (CONTEXT *ctx)
 +{
 +  NNTP_DATA *data = (NNTP_DATA *) ctx->data, *tmp;
 +
 +  if (!data)
-+    return;
++    return 0;
 +  nntp_free_acache (data);
 +  if (!data->nserv || !data->nserv->newsgroups || !data->group)
-+    return;
++    return 0;
 +  nntp_save_cache_index (data->nserv);
 +  if ((tmp = hash_find (data->nserv->newsgroups, data->group)) == NULL
 +      || tmp != data)
 +    nntp_delete_data (data);
++  return 0;
 +}
 +
 +/* commit changes and terminate connection */
@@ -5697,7 +5730,7 @@ diff -udprP mutt-1.5.13.orig/nntp.c mutt-1.5.13/nntp.c
 +    strcpy (nntp_data->group, group);
 +    nntp_data->nserv = s;
 +    if (s->newsgroups->nelem < s->newsgroups->curnelem * 2)
-+      s->newsgroups = hash_resize (s->newsgroups, s->newsgroups->nelem * 2);
++      s->newsgroups = hash_resize (s->newsgroups, s->newsgroups->nelem * 2, 0);
 +    hash_insert (s->newsgroups, nntp_data->group, nntp_data, 0);
 +    nntp_add_to_list (s, nntp_data);
 +  }
@@ -5727,11 +5760,14 @@ diff -udprP mutt-1.5.13.orig/nntp.c mutt-1.5.13/nntp.c
 +int nntp_check_newgroups (NNTP_SERVER *serv, int force)
 +{
 +  char buf[LONG_STRING];
++  char msg[SHORT_STRING];
 +  NNTP_DATA nntp_data;
 +  LIST *l;
 +  LIST emp;
 +  time_t now;
 +  struct tm *t;
++  unsigned int count = 0;
++  unsigned int total = 0;
 +
 +  if (!serv || !serv->newgroups_time)
 +    return -1;
@@ -5775,7 +5811,8 @@ diff -udprP mutt-1.5.13.orig/nntp.c mutt-1.5.13/nntp.c
 +    return -1;
 +  }
 +
-+  mutt_message _("Loading descriptions...");
++  strfcpy (msg, _("Loading descriptions..."), sizeof (msg));
++  mutt_message (msg);
 +  if (l)
 +    emp.next = l->next;
 +  else
@@ -5785,7 +5822,16 @@ diff -udprP mutt-1.5.13.orig/nntp.c mutt-1.5.13/nntp.c
 +  {
 +    l = l->next;
 +    ((NNTP_DATA *) l->data)->new = 1;
++    total++;
++  }
++  l = &emp;
++  while (l->next)
++  {
++    l = l->next;
 +    nntp_get_desc ((NNTP_DATA *) l->data, ((NNTP_DATA *) l->data)->group, NULL);
++    count++;
++    if (ReadInc && (count % ReadInc == 0))
++      mutt_message ("%s %d/%d", msg, count, total);
 +  }
 +  if (emp.next)
 +    nntp_save_cache_index (serv);
@@ -5979,14 +6025,14 @@ diff -udprP mutt-1.5.13.orig/nntp.c mutt-1.5.13/nntp.c
 +  FREE (&cc.child);
 +  return ret;
 +}
-diff -udprP mutt-1.5.13.orig/nntp.h mutt-1.5.13/nntp.h
---- mutt-1.5.13.orig/nntp.h    1970-01-01 03:00:00.000000000 +0300
-+++ mutt-1.5.13/nntp.h 2006-08-15 13:04:56.000000000 +0300
+diff -udprP mutt-1.5.21.orig/nntp.h mutt-1.5.21/nntp.h
+--- mutt-1.5.21.orig/nntp.h    1970-01-01 03:00:00.000000000 +0300
++++ mutt-1.5.21/nntp.h 2010-09-16 13:14:39.000000000 +0300
 @@ -0,0 +1,136 @@
 +/*
 + * Copyright (C) 1998 Brandon Long <blong@fiction.net>
 + * Copyright (C) 1999 Andrej Gritsenko <andrej@lucky.net>
-+ * Copyright (C) 2000-2004 Vsevolod Volkov <vvv@mutt.org.ua>
++ * Copyright (C) 2000-2007 Vsevolod Volkov <vvv@mutt.org.ua>
 + * 
 + *     This program is free software; you can redistribute it and/or modify
 + *     it under the terms of the GNU General Public License as published by
@@ -6105,7 +6151,7 @@ diff -udprP mutt-1.5.13.orig/nntp.h mutt-1.5.13/nntp.h
 +int nntp_sync_mailbox (CONTEXT *);
 +int nntp_check_mailbox (CONTEXT *);
 +int nntp_close_mailbox (CONTEXT *);
-+void nntp_fastclose_mailbox (CONTEXT *);
++int nntp_fastclose_mailbox (CONTEXT *);
 +int nntp_fetch_message (MESSAGE *, CONTEXT *, int);
 +int nntp_post (const char *);
 +int nntp_check_msgid (CONTEXT *, const char *);
@@ -6113,16 +6159,16 @@ diff -udprP mutt-1.5.13.orig/nntp.h mutt-1.5.13/nntp.h
 +void nntp_buffy (char *);
 +void nntp_expand_path (char *, size_t, ACCOUNT *);
 +void nntp_logout_all ();
-+const char *nntp_format_str (char *, size_t, char, const char *, const char *,
++const char *nntp_format_str (char *, size_t, size_t, char, const char *, const char *,
 +              const char *, const char *, unsigned long, format_flag);
 +
 +NNTP_SERVER *CurrentNewsSrv INITVAL (NULL);
 +
 +#endif /* _NNTP_H_ */
-diff -udprP mutt-1.5.13.orig/pager.c mutt-1.5.13/pager.c
---- mutt-1.5.13.orig/pager.c   2006-05-18 21:44:29.000000000 +0300
-+++ mutt-1.5.13/pager.c        2006-08-15 13:04:56.000000000 +0300
-@@ -1059,6 +1059,11 @@ fill_buffer (FILE *f, LOFF_T *last_pos, 
+diff -udprP mutt-1.5.21.orig/pager.c mutt-1.5.21/pager.c
+--- mutt-1.5.21.orig/pager.c   2010-08-25 19:31:40.000000000 +0300
++++ mutt-1.5.21/pager.c        2010-09-16 13:14:39.000000000 +0300
+@@ -1084,6 +1084,11 @@ fill_buffer (FILE *f, LOFF_T *last_pos, 
    return b_read;
  }
  
@@ -6134,7 +6180,7 @@ diff -udprP mutt-1.5.13.orig/pager.c mutt-1.5.13/pager.c
  
  static int format_line (struct line_t **lineInfo, int n, unsigned char *buf,
                        int flags, ansi_attr *pa, int cnt,
-@@ -1497,6 +1502,16 @@ static struct mapping_t PagerHelpExtra[]
+@@ -1540,6 +1545,16 @@ static struct mapping_t PagerHelpExtra[]
    { NULL,     0 }
  };
  
@@ -6151,7 +6197,7 @@ diff -udprP mutt-1.5.13.orig/pager.c mutt-1.5.13/pager.c
  
  
  /* This pager is actually not so simple as it once was.  It now operates in
-@@ -1538,6 +1553,10 @@ mutt_pager (const char *banner, const ch
+@@ -1581,6 +1596,10 @@ mutt_pager (const char *banner, const ch
    int old_PagerIndexLines;            /* some people want to resize it
                                         * while inside the pager... */
  
@@ -6162,7 +6208,7 @@ diff -udprP mutt-1.5.13.orig/pager.c mutt-1.5.13/pager.c
    if (!(flags & M_SHOWCOLOR))
      flags |= M_SHOWFLAT;
  
-@@ -1577,7 +1596,11 @@ mutt_pager (const char *banner, const ch
+@@ -1620,7 +1639,11 @@ mutt_pager (const char *banner, const ch
    if (IsHeader (extra))
    {
      strfcpy (tmphelp, helpstr, sizeof (tmphelp));
@@ -6175,9 +6221,9 @@ diff -udprP mutt-1.5.13.orig/pager.c mutt-1.5.13/pager.c
      snprintf (helpstr, sizeof (helpstr), "%s %s", tmphelp, buffer);
    }
    if (!InHelp)
-@@ -2418,6 +2441,15 @@ CHECK_IMAP_ACL(IMAP_ACL_DELETE);
CHECK_IMAP_ACL(IMAP_ACL_WRITE);
- #endif
+@@ -2492,6 +2515,15 @@ search_next:
      CHECK_READONLY;
+       CHECK_ACL(M_ACL_WRITE, "flag message");
  
 +#ifdef USE_NNTP
 +      if (Context->magic == M_NNTP)
@@ -6191,7 +6237,7 @@ diff -udprP mutt-1.5.13.orig/pager.c mutt-1.5.13/pager.c
        mutt_set_flag (Context, extra->hdr, M_FLAG, !extra->hdr->flagged);
        redraw = REDRAW_STATUS | REDRAW_INDEX;
        if (option (OPTRESOLVE))
-@@ -2451,6 +2483,60 @@ CHECK_IMAP_ACL(IMAP_ACL_WRITE);
+@@ -2525,6 +2557,60 @@ search_next:
        redraw = REDRAW_FULL;
        break;
  
@@ -6252,7 +6298,7 @@ diff -udprP mutt-1.5.13.orig/pager.c mutt-1.5.13/pager.c
        case OP_REPLY:
        CHECK_MODE(IsHeader (extra) || IsMsgAttach (extra));
          CHECK_ATTACH;      
-@@ -2497,7 +2583,7 @@ CHECK_IMAP_ACL(IMAP_ACL_WRITE);
+@@ -2571,7 +2657,7 @@ search_next:
          CHECK_ATTACH;
          if (IsMsgAttach (extra))
          mutt_attach_forward (extra->fp, extra->hdr, extra->idx,
@@ -6261,9 +6307,9 @@ diff -udprP mutt-1.5.13.orig/pager.c mutt-1.5.13/pager.c
          else
          ci_send_message (SENDFORWARD, NULL, NULL, extra->ctx, extra->hdr);
        redraw = REDRAW_FULL;
-diff -udprP mutt-1.5.13.orig/parse.c mutt-1.5.13/parse.c
---- mutt-1.5.13.orig/parse.c   2006-04-28 22:48:32.000000000 +0300
-+++ mutt-1.5.13/parse.c        2006-08-15 13:04:56.000000000 +0300
+diff -udprP mutt-1.5.21.orig/parse.c mutt-1.5.21/parse.c
+--- mutt-1.5.21.orig/parse.c   2009-08-25 22:08:52.000000000 +0300
++++ mutt-1.5.21/parse.c        2010-09-16 13:14:39.000000000 +0300
 @@ -89,7 +89,7 @@ char *mutt_read_rfc822_line (FILE *f, ch
    /* not reached */
  }
@@ -6272,8 +6318,8 @@ diff -udprP mutt-1.5.13.orig/parse.c mutt-1.5.13/parse.c
 +LIST *mutt_parse_references (char *s, int in_reply_to)
  {
    LIST *t, *lst = NULL;
-   int m, n = 0;
-@@ -1052,6 +1052,17 @@ int mutt_parse_rfc822_line (ENVELOPE *e,
+   char *m;
+@@ -1067,6 +1067,17 @@ int mutt_parse_rfc822_line (ENVELOPE *e,
        e->from = rfc822_parse_adrlist (e->from, p);
        matched = 1;
      }
@@ -6291,7 +6337,7 @@ diff -udprP mutt-1.5.13.orig/parse.c mutt-1.5.13/parse.c
      break;
      
      case 'i':
-@@ -1136,6 +1147,27 @@ int mutt_parse_rfc822_line (ENVELOPE *e,
+@@ -1149,6 +1160,27 @@ int mutt_parse_rfc822_line (ENVELOPE *e,
      }
      break;
      
@@ -6319,7 +6365,7 @@ diff -udprP mutt-1.5.13.orig/parse.c mutt-1.5.13/parse.c
      case 'r':
      if (!ascii_strcasecmp (line + 1, "eferences"))
      {
-@@ -1244,6 +1276,20 @@ int mutt_parse_rfc822_line (ENVELOPE *e,
+@@ -1257,6 +1289,20 @@ int mutt_parse_rfc822_line (ENVELOPE *e,
        e->x_label = safe_strdup(p);
        matched = 1;
      }
@@ -6340,10 +6386,10 @@ diff -udprP mutt-1.5.13.orig/parse.c mutt-1.5.13/parse.c
      
      default:
      break;
-diff -udprP mutt-1.5.13.orig/pattern.c mutt-1.5.13/pattern.c
---- mutt-1.5.13.orig/pattern.c 2006-08-11 12:32:58.000000000 +0300
-+++ mutt-1.5.13/pattern.c      2006-08-15 13:04:56.000000000 +0300
-@@ -90,6 +90,9 @@ Flags[] =
+diff -udprP mutt-1.5.21.orig/pattern.c mutt-1.5.21/pattern.c
+--- mutt-1.5.21.orig/pattern.c 2010-08-24 19:34:21.000000000 +0300
++++ mutt-1.5.21/pattern.c      2010-09-16 13:14:39.000000000 +0300
+@@ -92,6 +92,9 @@ Flags[] =
    { 'U', M_UNREAD,            0,              NULL },
    { 'v', M_COLLAPSED,         0,              NULL },
    { 'V', M_CRYPT_VERIFIED,    0,              NULL },
@@ -6353,7 +6399,7 @@ diff -udprP mutt-1.5.13.orig/pattern.c mutt-1.5.13/pattern.c
    { 'x', M_REFERENCE,         0,              eat_regexp },
    { 'X', M_MIMEATTACH,                0,              eat_range },
    { 'y', M_XLABEL,            0,              eat_regexp },
-@@ -1197,6 +1200,10 @@ mutt_pattern_exec (struct pattern_t *pat
+@@ -1213,6 +1216,10 @@ mutt_pattern_exec (struct pattern_t *pat
        }
      case M_UNREFERENCED:
        return (pat->not ^ (h->thread && !h->thread->child));
@@ -6364,18 +6410,18 @@ diff -udprP mutt-1.5.13.orig/pattern.c mutt-1.5.13/pattern.c
    }
    mutt_error (_("error: unknown op %d (report this error)."), pat->op);
    return (-1);
-@@ -1264,6 +1271,7 @@ int mutt_pattern_func (int op, char *pro
-   int i;
+@@ -1294,6 +1301,7 @@ int mutt_pattern_func (int op, char *pro
+   progress_t progress;
  
    strfcpy (buf, NONULL (Context->pattern), sizeof (buf));
 +  if (prompt || op != M_LIMIT)
    if (mutt_get_field (prompt, buf, sizeof (buf), M_PATTERN | M_CLEAR) != 0 || !buf[0])
      return (-1);
  
-diff -udprP mutt-1.5.13.orig/po/POTFILES.in mutt-1.5.13/po/POTFILES.in
---- mutt-1.5.13.orig/po/POTFILES.in    2005-08-03 12:17:47.000000000 +0300
-+++ mutt-1.5.13/po/POTFILES.in 2006-08-15 13:04:56.000000000 +0300
-@@ -45,6 +45,8 @@ mutt_ssl_gnutls.c
+diff -udprP mutt-1.5.21.orig/po/POTFILES.in mutt-1.5.21/po/POTFILES.in
+--- mutt-1.5.21.orig/po/POTFILES.in    2008-03-19 22:07:57.000000000 +0200
++++ mutt-1.5.21/po/POTFILES.in 2010-09-16 13:14:39.000000000 +0300
+@@ -46,6 +46,8 @@ mutt_ssl_gnutls.c
  mutt_tunnel.c
  muttlib.c
  mx.c
@@ -6384,10 +6430,10 @@ diff -udprP mutt-1.5.13.orig/po/POTFILES.in mutt-1.5.13/po/POTFILES.in
  pager.c
  parse.c
  pattern.c
-diff -udprP mutt-1.5.13.orig/postpone.c mutt-1.5.13/postpone.c
---- mutt-1.5.13.orig/postpone.c        2006-04-20 19:46:35.000000000 +0300
-+++ mutt-1.5.13/postpone.c     2006-08-15 13:04:56.000000000 +0300
-@@ -126,15 +126,26 @@ int mutt_num_postponed (int force)
+diff -udprP mutt-1.5.21.orig/postpone.c mutt-1.5.21/postpone.c
+--- mutt-1.5.21.orig/postpone.c        2010-08-24 19:34:21.000000000 +0300
++++ mutt-1.5.21/postpone.c     2010-09-16 13:14:39.000000000 +0300
+@@ -125,15 +125,26 @@ int mutt_num_postponed (int force)
  
    if (LastModify < st.st_mtime)
    {
@@ -6414,9 +6460,9 @@ diff -udprP mutt-1.5.13.orig/postpone.c mutt-1.5.13/postpone.c
    }
  
    return (PostCount);
-diff -udprP mutt-1.5.13.orig/protos.h mutt-1.5.13/protos.h
---- mutt-1.5.13.orig/protos.h  2006-07-12 02:32:28.000000000 +0300
-+++ mutt-1.5.13/protos.h       2006-08-15 13:04:56.000000000 +0300
+diff -udprP mutt-1.5.21.orig/protos.h mutt-1.5.21/protos.h
+--- mutt-1.5.21.orig/protos.h  2010-08-24 19:34:21.000000000 +0300
++++ mutt-1.5.21/protos.h       2010-09-16 13:14:39.000000000 +0300
 @@ -110,6 +110,7 @@ HASH *mutt_make_id_hash (CONTEXT *);
  HASH *mutt_make_subj_hash (CONTEXT *);
  
@@ -6425,18 +6471,10 @@ diff -udprP mutt-1.5.13.orig/protos.h mutt-1.5.13/protos.h
  
  char *mutt_read_rfc822_line (FILE *, char *, size_t *);
  ENVELOPE *mutt_read_rfc822_header (FILE *, HEADER *, short, short);
-@@ -251,6 +252,7 @@ void mutt_unblock_signals_system (int);
- void mutt_update_encoding (BODY *a);
- void mutt_version (void);
- void mutt_view_attachments (HEADER *);
-+void mutt_write_references (LIST *, FILE *);
- void mutt_write_address_list (ADDRESS *adr, FILE *fp, int linelen, int display);
- void mutt_set_virtual (CONTEXT *);
-diff -udprP mutt-1.5.13.orig/recvattach.c mutt-1.5.13/recvattach.c
---- mutt-1.5.13.orig/recvattach.c      2006-04-18 18:25:33.000000000 +0300
-+++ mutt-1.5.13/recvattach.c   2006-08-15 13:04:56.000000000 +0300
-@@ -1087,6 +1087,15 @@ void mutt_view_attachments (HEADER *hdr)
+diff -udprP mutt-1.5.21.orig/recvattach.c mutt-1.5.21/recvattach.c
+--- mutt-1.5.21.orig/recvattach.c      2010-09-13 20:19:55.000000000 +0300
++++ mutt-1.5.21/recvattach.c   2010-09-16 13:14:39.000000000 +0300
+@@ -1119,6 +1119,15 @@ void mutt_view_attachments (HEADER *hdr)
        }
  #endif
  
@@ -6452,7 +6490,7 @@ diff -udprP mutt-1.5.13.orig/recvattach.c mutt-1.5.13/recvattach.c
          if (WithCrypto && hdr->security & ~PGP_TRADITIONAL_CHECKED)
          {
          mutt_message _(
-@@ -1178,10 +1187,33 @@ void mutt_view_attachments (HEADER *hdr)
+@@ -1210,10 +1219,33 @@ void mutt_view_attachments (HEADER *hdr)
        case OP_FORWARD_MESSAGE:
          CHECK_ATTACH;
          mutt_attach_forward (fp, hdr, idx, idxlen,
@@ -6487,10 +6525,10 @@ diff -udprP mutt-1.5.13.orig/recvattach.c mutt-1.5.13/recvattach.c
        case OP_REPLY:
        case OP_GROUP_REPLY:
        case OP_LIST_REPLY:
-diff -udprP mutt-1.5.13.orig/recvcmd.c mutt-1.5.13/recvcmd.c
---- mutt-1.5.13.orig/recvcmd.c 2005-09-18 11:22:22.000000000 +0300
-+++ mutt-1.5.13/recvcmd.c      2006-08-15 13:04:56.000000000 +0300
-@@ -377,7 +377,7 @@ static BODY ** copy_problematic_attachme
+diff -udprP mutt-1.5.21.orig/recvcmd.c mutt-1.5.21/recvcmd.c
+--- mutt-1.5.21.orig/recvcmd.c 2010-09-13 20:19:55.000000000 +0300
++++ mutt-1.5.21/recvcmd.c      2010-09-16 13:14:39.000000000 +0300
+@@ -401,7 +401,7 @@ static BODY ** copy_problematic_attachme
  static void attach_forward_bodies (FILE * fp, HEADER * hdr,
                                   ATTACHPTR ** idx, short idxlen,
                                   BODY * cur,
@@ -6499,7 +6537,7 @@ diff -udprP mutt-1.5.13.orig/recvcmd.c mutt-1.5.13/recvcmd.c
  {
    short i;
    short mime_fwd_all = 0;
-@@ -523,7 +523,7 @@ _("Can't decode all tagged attachments. 
+@@ -547,7 +547,7 @@ _("Can't decode all tagged attachments. 
    tmpfp = NULL;
  
    /* now that we have the template, send it. */
@@ -6508,7 +6546,7 @@ diff -udprP mutt-1.5.13.orig/recvcmd.c mutt-1.5.13/recvcmd.c
    return;
    
    bail:
-@@ -550,7 +550,7 @@ _("Can't decode all tagged attachments. 
+@@ -574,7 +574,7 @@ _("Can't decode all tagged attachments. 
   */
  
  static void attach_forward_msgs (FILE * fp, HEADER * hdr, 
@@ -6517,7 +6555,7 @@ diff -udprP mutt-1.5.13.orig/recvcmd.c mutt-1.5.13/recvcmd.c
  {
    HEADER *curhdr = NULL;
    HEADER *tmphdr;
-@@ -655,23 +655,23 @@ static void attach_forward_msgs (FILE * 
+@@ -679,23 +679,23 @@ static void attach_forward_msgs (FILE * 
    else
      mutt_free_header (&tmphdr);
  
@@ -6545,7 +6583,7 @@ diff -udprP mutt-1.5.13.orig/recvcmd.c mutt-1.5.13/recvcmd.c
    }
  }
  
-@@ -729,28 +729,40 @@ attach_reply_envelope_defaults (ENVELOPE
+@@ -753,28 +753,40 @@ attach_reply_envelope_defaults (ENVELOPE
      return -1;
    }
  
@@ -6600,7 +6638,7 @@ diff -udprP mutt-1.5.13.orig/recvcmd.c mutt-1.5.13/recvcmd.c
    mutt_make_misc_reply_headers (env, Context, curhdr, curenv);
  
    if (parent)
-@@ -811,6 +823,13 @@ void mutt_attach_reply (FILE * fp, HEADE
+@@ -835,6 +847,13 @@ void mutt_attach_reply (FILE * fp, HEADE
    char prefix[SHORT_STRING];
    int rc;
    
@@ -6614,10 +6652,10 @@ diff -udprP mutt-1.5.13.orig/recvcmd.c mutt-1.5.13/recvcmd.c
    if (check_all_msg (idx, idxlen, cur, 0) == -1)
    {
      nattach = count_tagged (idx, idxlen);
-diff -udprP mutt-1.5.13.orig/rfc1524.c mutt-1.5.13/rfc1524.c
---- mutt-1.5.13.orig/rfc1524.c 2006-05-18 21:44:29.000000000 +0300
-+++ mutt-1.5.13/rfc1524.c      2006-08-15 13:04:56.000000000 +0300
-@@ -569,13 +569,13 @@ int rfc1524_expand_filename (char *namet
+diff -udprP mutt-1.5.21.orig/rfc1524.c mutt-1.5.21/rfc1524.c
+--- mutt-1.5.21.orig/rfc1524.c 2010-03-01 19:56:19.000000000 +0200
++++ mutt-1.5.21/rfc1524.c      2010-09-16 13:14:39.000000000 +0300
+@@ -570,13 +570,13 @@ int rfc1524_expand_filename (char *namet
   * safe_fopen().
   */
  
@@ -6633,7 +6671,7 @@ diff -udprP mutt-1.5.13.orig/rfc1524.c mutt-1.5.13/rfc1524.c
      return 2;
    if ((ofp = fopen (oldfile,"r")) == NULL)
      return 3;
-@@ -590,3 +590,8 @@ int mutt_rename_file (char *oldfile, cha
+@@ -591,3 +591,8 @@ int mutt_rename_file (char *oldfile, cha
    mutt_unlink (oldfile);
    return 0;
  }
@@ -6642,9 +6680,9 @@ diff -udprP mutt-1.5.13.orig/rfc1524.c mutt-1.5.13/rfc1524.c
 +{
 +  return _mutt_rename_file (oldfile, newfile, 0);
 +}
-diff -udprP mutt-1.5.13.orig/rfc1524.h mutt-1.5.13/rfc1524.h
---- mutt-1.5.13.orig/rfc1524.h 2005-09-18 11:22:22.000000000 +0300
-+++ mutt-1.5.13/rfc1524.h      2006-08-15 13:04:56.000000000 +0300
+diff -udprP mutt-1.5.21.orig/rfc1524.h mutt-1.5.21/rfc1524.h
+--- mutt-1.5.21.orig/rfc1524.h 2008-03-19 22:07:06.000000000 +0200
++++ mutt-1.5.21/rfc1524.h      2010-09-16 13:14:39.000000000 +0300
 @@ -40,5 +40,6 @@ int rfc1524_expand_command (BODY *, char
  int rfc1524_expand_filename (char *, char *, char *, size_t);
  int rfc1524_mailcap_lookup (BODY *, char *, rfc1524_entry *, int);
@@ -6652,21 +6690,22 @@ diff -udprP mutt-1.5.13.orig/rfc1524.h mutt-1.5.13/rfc1524.h
 +int _mutt_rename_file (char *, char *, int);
  
  #endif /* _RFC1524_H */
-diff -udprP mutt-1.5.13.orig/send.c mutt-1.5.13/send.c
---- mutt-1.5.13.orig/send.c    2006-03-03 12:12:34.000000000 +0200
-+++ mutt-1.5.13/send.c 2006-08-15 13:04:56.000000000 +0300
-@@ -44,6 +44,10 @@
+diff -udprP mutt-1.5.21.orig/send.c mutt-1.5.21/send.c
+--- mutt-1.5.21.orig/send.c    2010-09-13 20:19:55.000000000 +0300
++++ mutt-1.5.21/send.c 2010-09-16 13:14:39.000000000 +0300
+@@ -44,6 +44,11 @@
  #include <sys/types.h>
  #include <utime.h>
  
 +#ifdef USE_NNTP
 +#include "nntp.h"
++#include "mx.h"
 +#endif
 +
  #ifdef MIXMASTER
  #include "remailer.h"
  #endif
-@@ -213,17 +217,51 @@ static int edit_address (ADDRESS **a, /*
+@@ -213,17 +218,51 @@ static int edit_address (ADDRESS **a, /*
    return 0;
  }
  
@@ -6725,7 +6764,7 @@ diff -udprP mutt-1.5.13.orig/send.c mutt-1.5.13/send.c
  
    if (en->subject)
    {
-@@ -259,6 +297,14 @@ static int edit_envelope (ENVELOPE *en)
+@@ -259,6 +298,14 @@ static int edit_envelope (ENVELOPE *en)
    return 0;
  }
  
@@ -6740,7 +6779,7 @@ diff -udprP mutt-1.5.13.orig/send.c mutt-1.5.13/send.c
  static void process_user_recips (ENVELOPE *env)
  {
    LIST *uh = UserHeader;
-@@ -271,6 +317,14 @@ static void process_user_recips (ENVELOP
+@@ -271,6 +318,14 @@ static void process_user_recips (ENVELOP
        env->cc = rfc822_parse_adrlist (env->cc, uh->data + 3);
      else if (ascii_strncasecmp ("bcc:", uh->data, 4) == 0)
        env->bcc = rfc822_parse_adrlist (env->bcc, uh->data + 4);
@@ -6755,7 +6794,7 @@ diff -udprP mutt-1.5.13.orig/send.c mutt-1.5.13/send.c
    }
  }
  
-@@ -301,6 +355,12 @@ static void process_user_header (ENVELOP
+@@ -309,6 +364,12 @@ static void process_user_header (ENVELOP
      else if (ascii_strncasecmp ("to:", uh->data, 3) != 0 &&
             ascii_strncasecmp ("cc:", uh->data, 3) != 0 &&
             ascii_strncasecmp ("bcc:", uh->data, 4) != 0 &&
@@ -6765,10 +6804,10 @@ diff -udprP mutt-1.5.13.orig/send.c mutt-1.5.13/send.c
 +           ascii_strncasecmp ("x-comment-to:", uh->data, 13) != 0 &&
 +#endif
 +           ascii_strncasecmp ("supersedes:", uh->data, 11) != 0 &&
-            ascii_strncasecmp ("subject:", uh->data, 8) != 0)
+            ascii_strncasecmp ("subject:", uh->data, 8) != 0 &&
+            ascii_strncasecmp ("return-path:", uh->data, 12) != 0)
      {
-       if (last)
-@@ -646,6 +706,10 @@ void mutt_add_to_reference_headers (ENVE
+@@ -657,6 +718,10 @@ void mutt_add_to_reference_headers (ENVE
    if (pp) *pp = p;
    if (qq) *qq = q;
    
@@ -6779,7 +6818,7 @@ diff -udprP mutt-1.5.13.orig/send.c mutt-1.5.13/send.c
  }
  
  static void 
-@@ -702,6 +766,16 @@ envelope_defaults (ENVELOPE *env, CONTEX
+@@ -719,6 +784,16 @@ envelope_defaults (ENVELOPE *env, CONTEX
  
    if (flags & SENDREPLY)
    {
@@ -6796,7 +6835,7 @@ diff -udprP mutt-1.5.13.orig/send.c mutt-1.5.13/send.c
      if (tag)
      {
        HEADER *h;
-@@ -848,7 +922,18 @@ void mutt_set_followup_to (ENVELOPE *e)
+@@ -865,7 +940,18 @@ void mutt_set_followup_to (ENVELOPE *e)
     * it hasn't already been set
     */
  
@@ -6816,7 +6855,17 @@ diff -udprP mutt-1.5.13.orig/send.c mutt-1.5.13/send.c
    {
      if (mutt_is_list_cc (0, e->to, e->cc))
      {
-@@ -1081,6 +1166,13 @@ ci_send_message (int flags,             /* send mod
+@@ -1027,6 +1113,9 @@ static int send_message (HEADER *msg)
+ #endif
+ #if USE_SMTP
++#ifdef USE_NNTP
++  if (!option (OPTNEWSSEND))
++#endif /* USE_NNTP */
+   if (SmtpUrl)
+       return mutt_smtp_send (msg->env->from, msg->env->to, msg->env->cc,
+                              msg->env->bcc, tempfile,
+@@ -1138,6 +1227,13 @@ ci_send_message (int flags,             /* send mod
  
    int rv = -1;
    
@@ -6830,7 +6879,7 @@ diff -udprP mutt-1.5.13.orig/send.c mutt-1.5.13/send.c
    if (!flags && !msg && quadoption (OPT_RECALL) != M_NO &&
        mutt_num_postponed (1))
    {
-@@ -1111,6 +1203,22 @@ ci_send_message (int flags,             /* send mod
+@@ -1168,6 +1264,22 @@ ci_send_message (int flags,             /* send mod
      {
        if ((flags = mutt_get_postponed (ctx, msg, &cur, fcc, sizeof (fcc))) < 0)
        goto cleanup;
@@ -6853,16 +6902,16 @@ diff -udprP mutt-1.5.13.orig/send.c mutt-1.5.13/send.c
      }
  
      if (flags & (SENDPOSTPONED|SENDRESEND))
-@@ -1215,11 +1323,16 @@ ci_send_message (int flags,            /* send mod
-     /* Expand aliases and remove duplicates/crossrefs */
-     mutt_fix_reply_recipients (msg->env);
+@@ -1262,11 +1374,16 @@ ci_send_message (int flags,            /* send mod
+     if (flags & SENDREPLY)
+       mutt_fix_reply_recipients (msg->env);
  
 +#ifdef USE_NNTP
 +    if ((flags & SENDNEWS) && ctx && ctx->magic == M_NNTP && !msg->env->newsgroups)
 +      msg->env->newsgroups = safe_strdup (((NNTP_DATA *)ctx->data)->group);
 +#endif
 +
-     if (! (flags & SENDMAILX) &&
+     if (! (flags & (SENDMAILX|SENDBATCH)) &&
        ! (option (OPTAUTOEDIT) && option (OPTEDITHDRS)) &&
        ! ((flags & SENDREPLY) && option (OPTFASTREPLY)))
      {
@@ -6871,7 +6920,7 @@ diff -udprP mutt-1.5.13.orig/send.c mutt-1.5.13/send.c
        goto cleanup;
      }
  
-@@ -1470,6 +1583,11 @@ main_loop:
+@@ -1534,6 +1651,11 @@ main_loop:
      if (i == -1)
      {
        /* abort */
@@ -6883,17 +6932,17 @@ diff -udprP mutt-1.5.13.orig/send.c mutt-1.5.13/send.c
        mutt_message _("Mail not sent.");
        goto cleanup;
      }
-@@ -1502,6 +1620,9 @@ main_loop:
+@@ -1566,6 +1688,9 @@ main_loop:
      }
    }
  
 +#ifdef USE_NNTP
 +  if (!(flags & SENDNEWS))
 +#endif
-   if (!msg->env->to && !msg->env->cc && !msg->env->bcc)
+   if (!has_recips (msg->env->to) && !has_recips (msg->env->cc) &&
+       !has_recips (msg->env->bcc))
    {
-     if (! (flags & SENDBATCH))
-@@ -1534,6 +1655,19 @@ main_loop:
+@@ -1599,6 +1724,19 @@ main_loop:
        mutt_error _("No subject specified.");
      goto main_loop;
    }
@@ -6913,7 +6962,7 @@ diff -udprP mutt-1.5.13.orig/send.c mutt-1.5.13/send.c
  
    if (msg->content->next)
      msg->content = mutt_make_multipart (msg->content);
-@@ -1739,7 +1873,12 @@ full_fcc:
+@@ -1805,7 +1943,12 @@ full_fcc:
      }
    }
    else if (!option (OPTNOCURSES) && ! (flags & SENDMAILX))
@@ -6927,40 +6976,50 @@ diff -udprP mutt-1.5.13.orig/send.c mutt-1.5.13/send.c
  
    if (WithCrypto && (msg->security & ENCRYPT))
      FREE (&pgpkeylist);
-diff -udprP mutt-1.5.13.orig/sendlib.c mutt-1.5.13/sendlib.c
---- mutt-1.5.13.orig/sendlib.c 2006-07-18 21:16:24.000000000 +0300
-+++ mutt-1.5.13/sendlib.c      2006-08-15 13:04:56.000000000 +0300
-@@ -45,6 +45,10 @@
+diff -udprP mutt-1.5.21.orig/sendlib.c mutt-1.5.21/sendlib.c
+--- mutt-1.5.21.orig/sendlib.c 2010-09-13 20:19:55.000000000 +0300
++++ mutt-1.5.21/sendlib.c      2010-09-16 13:14:39.000000000 +0300
+@@ -46,6 +46,10 @@
  #include <sys/wait.h>
  #include <fcntl.h>
  
 +#ifdef USE_NNTP
-+#include <nntp.h>
++#include "nntp.h"
 +#endif
 +
  #ifdef HAVE_SYSEXITS_H
  #include <sysexits.h>
  #else /* Make sure EX_OK is defined <philiph@pobox.com> */
-@@ -1496,7 +1500,7 @@ void mutt_write_address_list (ADDRESS *a
- /* need to write the list in reverse because they are stored in reverse order
-  * when parsed to speed up threading
-  */
--static void write_references (LIST *r, FILE *f)
-+void mutt_write_references (LIST *r, FILE *f)
+@@ -1543,6 +1547,14 @@ void mutt_write_references (LIST *r, FIL
  {
    LIST **ref = NULL;
    int refcnt = 0, refmax = 0;
-@@ -1541,6 +1545,9 @@ int mutt_write_rfc822_header (FILE *fp, 
-   LIST *tmp = env->userhdrs;
-   int has_agent = 0; /* user defined user-agent header field exists */
-   
-+#ifdef USE_NNTP
-+  if (!option (OPTNEWSSEND))
-+#endif
-   if (mode == 0 && !privacy)
-     fputs (mutt_make_date (buffer, sizeof(buffer)), fp);
++  int multiline = 1;
++  int space = 0;
++
++  if (trim < 0)
++  {
++    trim = -trim;
++    multiline = 0;
++  }
+   for ( ; (trim == 0 || refcnt < trim) && r ; r = r->next)
+   {
+@@ -1553,9 +1565,11 @@ void mutt_write_references (LIST *r, FIL
+   while (refcnt-- > 0)
+   {
+-    fputc (' ', f);
++    if (multiline || space)
++      fputc (' ', f);
++    space = 1;
+     fputs (ref[refcnt]->data, f);
+-    if (refcnt >= 1)
++    if (multiline && refcnt >= 1)
+       fputc ('\n', f);
+   }
  
-@@ -1560,6 +1567,9 @@ int mutt_write_rfc822_header (FILE *fp, 
+@@ -1962,6 +1976,9 @@ int mutt_write_rfc822_header (FILE *fp, 
      mutt_write_address_list (env->to, fp, 4, 0);
    }
    else if (mode > 0)
@@ -6970,7 +7029,7 @@ diff -udprP mutt-1.5.13.orig/sendlib.c mutt-1.5.13/sendlib.c
      fputs ("To: \n", fp);
  
    if (env->cc)
-@@ -1568,6 +1578,9 @@ int mutt_write_rfc822_header (FILE *fp, 
+@@ -1970,6 +1987,9 @@ int mutt_write_rfc822_header (FILE *fp, 
      mutt_write_address_list (env->cc, fp, 4, 0);
    }
    else if (mode > 0)
@@ -6980,7 +7039,7 @@ diff -udprP mutt-1.5.13.orig/sendlib.c mutt-1.5.13/sendlib.c
      fputs ("Cc: \n", fp);
  
    if (env->bcc)
-@@ -1579,8 +1592,28 @@ int mutt_write_rfc822_header (FILE *fp, 
+@@ -1981,8 +2001,28 @@ int mutt_write_rfc822_header (FILE *fp, 
      }
    }
    else if (mode > 0)
@@ -7007,9 +7066,9 @@ diff -udprP mutt-1.5.13.orig/sendlib.c mutt-1.5.13/sendlib.c
 +#endif
 +
    if (env->subject)
-     fprintf (fp, "Subject: %s\n", env->subject);
+     mutt_write_one_header (fp, "Subject", env->subject, NULL, 0, 0);
    else if (mode == 1)
-@@ -1599,6 +1632,9 @@ int mutt_write_rfc822_header (FILE *fp, 
+@@ -2001,6 +2041,9 @@ int mutt_write_rfc822_header (FILE *fp, 
      fputs ("Reply-To: \n", fp);
  
    if (env->mail_followup_to)
@@ -7019,25 +7078,7 @@ diff -udprP mutt-1.5.13.orig/sendlib.c mutt-1.5.13/sendlib.c
    {
      fputs ("Mail-Followup-To: ", fp);
      mutt_write_address_list (env->mail_followup_to, fp, 18, 0);
-@@ -1609,7 +1645,7 @@ int mutt_write_rfc822_header (FILE *fp, 
-     if (env->references)
-     {
-       fputs ("References:", fp);
--      write_references (env->references, fp);
-+      mutt_write_references (env->references, fp);
-       fputc('\n', fp);
-     }
-@@ -1621,7 +1657,7 @@ int mutt_write_rfc822_header (FILE *fp, 
-   if (env->in_reply_to)
-   {
-     fputs ("In-Reply-To:", fp);
--    write_references (env->in_reply_to, fp);
-+    mutt_write_references (env->in_reply_to, fp);
-     fputc ('\n', fp);
-   }
-   
-@@ -1921,11 +1957,30 @@ mutt_invoke_sendmail (ADDRESS *from,   /* 
+@@ -2339,11 +2382,30 @@ mutt_invoke_sendmail (ADDRESS *from,   /* 
                 const char *msg, /* file containing message */
                 int eightbit) /* message contains 8bit chars */
  {
@@ -7052,7 +7093,7 @@ diff -udprP mutt-1.5.13.orig/sendlib.c mutt-1.5.13/sendlib.c
 +  {
 +    char cmd[LONG_STRING];
 +
-+    mutt_FormatString (cmd, sizeof (cmd), NONULL (Inews), nntp_format_str, 0, 0);
++    mutt_FormatString (cmd, sizeof (cmd), 0, NONULL (Inews), nntp_format_str, 0, 0);
 +    if (!*cmd)
 +    {
 +      i = nntp_post (msg);
@@ -7069,7 +7110,7 @@ diff -udprP mutt-1.5.13.orig/sendlib.c mutt-1.5.13/sendlib.c
    ps = s;
    i = 0;
    while ((ps = strtok (ps, " ")))
-@@ -1949,6 +2004,10 @@ mutt_invoke_sendmail (ADDRESS *from,    /* 
+@@ -2367,6 +2429,10 @@ mutt_invoke_sendmail (ADDRESS *from,    /* 
      i++;
    }
  
@@ -7080,7 +7121,7 @@ diff -udprP mutt-1.5.13.orig/sendlib.c mutt-1.5.13/sendlib.c
    if (eightbit && option (OPTUSE8BITMIME))
      args = add_option (args, &argslen, &argsmax, "-B8BITMIME");
  
-@@ -1980,6 +2039,9 @@ mutt_invoke_sendmail (ADDRESS *from,     /* 
+@@ -2398,6 +2464,9 @@ mutt_invoke_sendmail (ADDRESS *from,     /* 
    args = add_args (args, &argslen, &argsmax, to);
    args = add_args (args, &argslen, &argsmax, cc);
    args = add_args (args, &argslen, &argsmax, bcc);
@@ -7090,8 +7131,8 @@ diff -udprP mutt-1.5.13.orig/sendlib.c mutt-1.5.13/sendlib.c
  
    if (argslen == argsmax)
      safe_realloc (&args, sizeof (char *) * (++argsmax));
-@@ -2112,6 +2174,9 @@ void mutt_prepare_envelope (ENVELOPE *en
-   rfc2047_encode_adrlist (env->reply_to, "Reply-To");
+@@ -2478,6 +2547,9 @@ void mutt_prepare_envelope (ENVELOPE *en
+   rfc2047_encode_string (&env->x_label);
  
    if (env->subject)
 +#ifdef USE_NNTP
@@ -7100,7 +7141,7 @@ diff -udprP mutt-1.5.13.orig/sendlib.c mutt-1.5.13/sendlib.c
    {
      rfc2047_encode_string (&env->subject);
    }
-@@ -2211,6 +2276,10 @@ int mutt_bounce_message (FILE *fp, HEADE
+@@ -2598,6 +2670,10 @@ int mutt_bounce_message (FILE *fp, HEADE
    }
    rfc822_write_address (resent_from, sizeof (resent_from), from, 0);
  
@@ -7111,10 +7152,10 @@ diff -udprP mutt-1.5.13.orig/sendlib.c mutt-1.5.13/sendlib.c
    ret = _mutt_bounce_message (fp, h, to, resent_from, from);
  
    rfc822_free_address (&from);
-diff -udprP mutt-1.5.13.orig/sort.c mutt-1.5.13/sort.c
---- mutt-1.5.13.orig/sort.c    2005-09-18 11:22:22.000000000 +0300
-+++ mutt-1.5.13/sort.c 2006-08-15 13:04:56.000000000 +0300
-@@ -149,6 +149,15 @@ int compare_order (const void *a, const 
+diff -udprP mutt-1.5.21.orig/sort.c mutt-1.5.21/sort.c
+--- mutt-1.5.21.orig/sort.c    2008-10-29 00:29:44.000000000 +0200
++++ mutt-1.5.21/sort.c 2010-09-16 13:14:39.000000000 +0300
+@@ -151,6 +151,15 @@ static int compare_order (const void *a,
    HEADER **ha = (HEADER **) a;
    HEADER **hb = (HEADER **) b;
  
@@ -7130,69 +7171,69 @@ diff -udprP mutt-1.5.13.orig/sort.c mutt-1.5.13/sort.c
    /* no need to auxsort because you will never have equality here */
    return (SORTCODE ((*ha)->index - (*hb)->index));
  }
-diff -udprP mutt-1.5.13.orig/url.c mutt-1.5.13/url.c
---- mutt-1.5.13.orig/url.c     2005-09-18 11:22:22.000000000 +0300
-+++ mutt-1.5.13/url.c  2006-08-15 13:04:56.000000000 +0300
+diff -udprP mutt-1.5.21.orig/url.c mutt-1.5.21/url.c
+--- mutt-1.5.21.orig/url.c     2010-08-24 19:34:21.000000000 +0300
++++ mutt-1.5.21/url.c  2010-09-16 13:14:39.000000000 +0300
 @@ -39,6 +39,8 @@ static struct mapping_t UrlMap[] =
    { "imaps",  U_IMAPS },
-   { "pop",    U_POP  },
-   { "pops",   U_POPS  },
-+  { "nntp",   U_NNTP },
-+  { "nntps",  U_NNTPS },
+   { "pop",    U_POP },
+   { "pops",   U_POPS },
++  { "news",   U_NNTP },
++  { "newss",  U_NNTPS },
    { "mailto", U_MAILTO },
-   { NULL,     U_UNKNOWN}
- };
-diff -udprP mutt-1.5.13.orig/url.h mutt-1.5.13/url.h
---- mutt-1.5.13.orig/url.h     2004-07-20 01:00:05.000000000 +0300
-+++ mutt-1.5.13/url.h  2006-08-15 13:04:56.000000000 +0300
+   { "smtp",     U_SMTP },
+   { "smtps",    U_SMTPS },
+diff -udprP mutt-1.5.21.orig/url.h mutt-1.5.21/url.h
+--- mutt-1.5.21.orig/url.h     2009-08-25 22:08:52.000000000 +0300
++++ mutt-1.5.21/url.h  2010-09-16 13:14:39.000000000 +0300
 @@ -8,6 +8,8 @@ typedef enum url_scheme
    U_POPS,
    U_IMAP,
    U_IMAPS,
 +  U_NNTP,
 +  U_NNTPS,
+   U_SMTP,
+   U_SMTPS,
    U_MAILTO,
-   U_UNKNOWN
- }
-diff -udprP mutt-1.5.13.orig/Makefile.am mutt-1.5.13/Makefile.am
---- mutt-1.5.13.orig/Makefile.am       2006-08-14 16:47:23.000000000 +0300
-+++ mutt-1.5.13/Makefile.am    2006-08-15 13:04:56.000000000 +0300
-@@ -63,6 +63,7 @@ EXTRA_mutt_SOURCES = account.c md5c.c mu
-       browser.h mbyte.h remailer.h url.h \
-       crypt-mod-pgp-classic.c crypt-mod-smime-classic.c \
-       pgppacket.c mutt_idna.h hcache.h hcache.c bcache.c bcache.h mutt_ssl_gnutls.c \
+diff -udprP mutt-1.5.21.orig/Makefile.am mutt-1.5.21/Makefile.am
+--- mutt-1.5.21.orig/Makefile.am       2010-08-24 19:34:21.000000000 +0300
++++ mutt-1.5.21/Makefile.am    2010-09-16 13:14:39.000000000 +0300
+@@ -57,6 +57,7 @@ EXTRA_mutt_SOURCES = account.c bcache.c 
+       mutt_idna.c mutt_sasl.c mutt_socket.c mutt_ssl.c mutt_ssl_gnutls.c \
+       mutt_tunnel.c pgp.c pgpinvoke.c pgpkey.c pgplib.c pgpmicalg.c \
+       pgppacket.c pop.c pop_auth.c pop_lib.c remailer.c resize.c sha1.c \
 +      nntp.c newsrc.c \
-       crypt-gpgme.c crypt-mod-pgp-gpgme.c crypt-mod-smime-gpgme.c
+       smime.c smtp.c utf8.c wcwidth.c \
+       bcache.h browser.h hcache.h mbyte.h mutt_idna.h remailer.h url.h
  
- EXTRA_DIST = COPYRIGHT GPL OPS OPS.PGP OPS.CRYPT OPS.SMIME TODO UPDATING \
-@@ -73,6 +74,7 @@ EXTRA_DIST = COPYRIGHT GPL OPS OPS.PGP O
+@@ -68,6 +69,7 @@ EXTRA_DIST = COPYRIGHT GPL OPS OPS.PGP O
        mutt_regex.h mutt_sasl.h mutt_socket.h mutt_ssl.h mutt_tunnel.h \
        mx.h pager.h pgp.h pop.h protos.h rfc1524.h rfc2047.h \
-       rfc2231.h rfc822.h sha1.h sort.h mime.types VERSION prepare \
+       rfc2231.h rfc822.h rfc3676.h sha1.h sort.h mime.types VERSION prepare \
 +      nntp.h ChangeLog.nntp \
        _regex.h OPS.MIX README.SECURITY remailer.c remailer.h browser.h \
-       mbyte.h lib.h extlib.c pgpewrap.c smime_keys.pl pgplib.h Muttrc.head Muttrc \
-       makedoc.c stamp-doc-rc README.SSL smime.h\
-diff -udprP mutt-1.5.13.orig/Makefile.in mutt-1.5.13/Makefile.in
---- mutt-1.5.13.orig/Makefile.in       2006-08-14 17:09:29.000000000 +0300
-+++ mutt-1.5.13/Makefile.in    2006-08-15 13:04:56.000000000 +0300
-@@ -325,6 +325,7 @@ EXTRA_mutt_SOURCES = account.c md5c.c mu
-       browser.h mbyte.h remailer.h url.h \
-       crypt-mod-pgp-classic.c crypt-mod-smime-classic.c \
-       pgppacket.c mutt_idna.h hcache.h hcache.c bcache.c bcache.h mutt_ssl_gnutls.c \
+       mbyte.h lib.h extlib.c pgpewrap.c smime_keys.pl pgplib.h \
+       README.SSL smime.h group.h \
+diff -udprP mutt-1.5.21.orig/Makefile.in mutt-1.5.21/Makefile.in
+--- mutt-1.5.21.orig/Makefile.in       2010-08-25 19:31:48.000000000 +0300
++++ mutt-1.5.21/Makefile.in    2010-09-16 13:14:39.000000000 +0300
+@@ -375,6 +375,7 @@ EXTRA_mutt_SOURCES = account.c bcache.c 
+       mutt_idna.c mutt_sasl.c mutt_socket.c mutt_ssl.c mutt_ssl_gnutls.c \
+       mutt_tunnel.c pgp.c pgpinvoke.c pgpkey.c pgplib.c pgpmicalg.c \
+       pgppacket.c pop.c pop_auth.c pop_lib.c remailer.c resize.c sha1.c \
 +      nntp.c newsrc.c \
-       crypt-gpgme.c crypt-mod-pgp-gpgme.c crypt-mod-smime-gpgme.c
+       smime.c smtp.c utf8.c wcwidth.c \
+       bcache.h browser.h hcache.h mbyte.h mutt_idna.h remailer.h url.h
  
- EXTRA_DIST = COPYRIGHT GPL OPS OPS.PGP OPS.CRYPT OPS.SMIME TODO UPDATING \
-@@ -335,6 +336,7 @@ EXTRA_DIST = COPYRIGHT GPL OPS OPS.PGP O
+@@ -386,6 +387,7 @@ EXTRA_DIST = COPYRIGHT GPL OPS OPS.PGP O
        mutt_regex.h mutt_sasl.h mutt_socket.h mutt_ssl.h mutt_tunnel.h \
        mx.h pager.h pgp.h pop.h protos.h rfc1524.h rfc2047.h \
-       rfc2231.h rfc822.h sha1.h sort.h mime.types VERSION prepare \
+       rfc2231.h rfc822.h rfc3676.h sha1.h sort.h mime.types VERSION prepare \
 +      nntp.h ChangeLog.nntp \
        _regex.h OPS.MIX README.SECURITY remailer.c remailer.h browser.h \
-       mbyte.h lib.h extlib.c pgpewrap.c smime_keys.pl pgplib.h Muttrc.head Muttrc \
-       makedoc.c stamp-doc-rc README.SSL smime.h\
-@@ -550,6 +552,8 @@ distclean-compile:
+       mbyte.h lib.h extlib.c pgpewrap.c smime_keys.pl pgplib.h \
+       README.SSL smime.h group.h \
+@@ -640,6 +642,8 @@ distclean-compile:
  @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mutt_tunnel.Po@am__quote@
  @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/muttlib.Po@am__quote@
  @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mx.Po@am__quote@
@@ -7201,11 +7242,43 @@ diff -udprP mutt-1.5.13.orig/Makefile.in mutt-1.5.13/Makefile.in
  @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pager.Po@am__quote@
  @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse.Po@am__quote@
  @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/patchlist.Po@am__quote@
-diff -udprP mutt-1.5.13.orig/Muttrc mutt-1.5.13/Muttrc
---- mutt-1.5.13.orig/Muttrc    2006-08-14 17:09:47.000000000 +0300
-+++ mutt-1.5.13/Muttrc 2006-08-15 13:04:56.000000000 +0300
-@@ -220,6 +220,28 @@ attachments   -I message/external-body
- # editing the body of an outgoing message.
+diff -udprP mutt-1.5.21.orig/configure mutt-1.5.21/configure
+--- mutt-1.5.21.orig/configure 2010-08-25 19:31:47.000000000 +0300
++++ mutt-1.5.21/configure      2010-09-16 13:14:39.000000000 +0300
+@@ -1427,6 +1427,7 @@ Optional Features:
+                           Force use of an external dotlock program
+   --enable-pop            Enable POP3 support
+   --enable-imap           Enable IMAP support
++  --enable-nntp           Enable NNTP support
+   --enable-smtp           include internal SMTP relay support
+   --enable-debug          Enable debugging support
+   --enable-flock          Use flock() to lock files
+@@ -10823,6 +10824,20 @@ _ACEOF
+ fi
+ done
++# Check whether --enable-nntp or --disable-nntp was given.
++if test "${enable_nntp+set}" = set; then
++  enableval="$enable_nntp"
++      if test x$enableval = xyes ; then
++              cat >>confdefs.h <<\_ACEOF
++#define USE_NNTP 1
++_ACEOF
++
++              MUTT_LIB_OBJECTS="$MUTT_LIB_OBJECTS nntp.o newsrc.o"
++              need_socket="yes"
++      fi
++
++fi;
++
+diff -udprP mutt-1.5.21.orig/doc/Muttrc mutt-1.5.21/doc/Muttrc
+--- mutt-1.5.21.orig/doc/Muttrc        2010-09-15 20:07:19.000000000 +0300
++++ mutt-1.5.21/doc/Muttrc     2010-09-16 13:14:39.000000000 +0300
+@@ -281,6 +281,28 @@ attachments   -I message/external-body
+ # of the value as shown above if included.
  # 
  # 
 +# set ask_follow_up=no
@@ -7233,8 +7306,8 @@ diff -udprP mutt-1.5.13.orig/Muttrc mutt-1.5.13/Muttrc
  # set attach_format="%u%D%I %t%4n %T%.40d%> [%.7m/%.10M, %.6e%?C?, %C?, %s] "
  #
  # Name: attach_format
-@@ -376,6 +398,17 @@ attachments   -I message/external-body
- # visual terminals don't permit making the cursor invisible.
+@@ -466,6 +488,17 @@ attachments   -I message/external-body
+ # set certificate_file=~/.mutt/certificates
  # 
  # 
 +# set catchup_newsgroup=ask-yes
@@ -7251,7 +7324,7 @@ diff -udprP mutt-1.5.13.orig/Muttrc mutt-1.5.13/Muttrc
  # set charset=""
  #
  # Name: charset
-@@ -862,6 +895,19 @@ attachments   -I message/external-body
+@@ -1122,6 +1155,19 @@ attachments   -I message/external-body
  # of the same email for you.
  # 
  # 
@@ -7271,8 +7344,8 @@ diff -udprP mutt-1.5.13.orig/Muttrc mutt-1.5.13/Muttrc
  # set force_name=no
  #
  # Name: force_name
-@@ -959,6 +1005,28 @@ attachments   -I message/external-body
- # "Franklin" to "Franklin, Steve".
+@@ -1232,6 +1278,28 @@ attachments   -I message/external-body
+ # ``Franklin'' to ``Franklin, Steve''.
  # 
  # 
 +# set group_index_format="%4C %M%N %5s  %-45.45f %d"
@@ -7300,24 +7373,31 @@ diff -udprP mutt-1.5.13.orig/Muttrc mutt-1.5.13/Muttrc
  # set hdrs=yes
  #
  # Name: hdrs
-@@ -1394,6 +1462,7 @@ attachments   -I message/external-body
+@@ -1780,6 +1848,7 @@ attachments   -I message/external-body
  # %E      number of messages in current thread
- # %f      entire From: line (address + real name)
+ # %f      sender (address + real name), either From: or Return-Path:
  # %F      author name, or recipient name if the message is from you
 +# %g      newsgroup name (if compiled with nntp support)
  # %H      spam attribute(s) of this message
  # %i      message-id of the current message
  # %l      number of lines in the message (does not work with maildir,
-@@ -1413,6 +1482,7 @@ attachments   -I message/external-body
+@@ -1795,12 +1864,14 @@ attachments   -I message/external-body
+ #         stashed the message: list name or recipient name
+ #         if not sent to a list
+ # %P      progress indicator for the built-in pager (how much of the file has been displayed)
++# %R      ``x-comment-to:'' field (if present and compiled with nntp support)
+ # %s      subject of the message
+ # %S      status of the message (``N''/``D''/``d''/``!''/``r''/*)
+ # %t      ``To:'' field (recipients)
  # %T      the appropriate character from the $to_chars string
  # %u      user (login) name of the author
  # %v      first name of the author, or the recipient if the message is from you
-+# %W      name of organization of author (`organization:' field)
++# %W      name of organization of author (``organization:'' field)
  # %X      number of attachments
  #         (please see the ``attachments'' section for possible speed effects)
- # %y      `x-label:' field, if present
-@@ -1438,6 +1508,22 @@ attachments   -I message/external-body
- # See also: ``$to_chars''.
+ # %y      ``X-Label:'' field, if present
+@@ -1836,6 +1907,22 @@ attachments   -I message/external-body
+ # ``save-hook'', ``fcc-hook'' and ``fcc-save-hook'', too.
  # 
  # 
 +# set inews=""
@@ -7336,10 +7416,10 @@ diff -udprP mutt-1.5.13.orig/Muttrc mutt-1.5.13/Muttrc
 +# Example: set inews="/usr/local/bin/inews -hS"
 +# 
 +# 
- # set ispell="/usr/bin/ispell"
+ # set ispell="ispell"
  #
  # Name: ispell
-@@ -1781,6 +1867,18 @@ attachments   -I message/external-body
+@@ -2205,6 +2292,18 @@ attachments   -I message/external-body
  # be attached to the newly composed message if this option is set.
  # 
  # 
@@ -7358,8 +7438,8 @@ diff -udprP mutt-1.5.13.orig/Muttrc mutt-1.5.13/Muttrc
  # set mix_entry_format="%4n %c %-16s %a"
  #
  # Name: mix_entry_format
-@@ -1873,6 +1971,118 @@ attachments   -I message/external-body
- # See also ``$read_inc'' and ``$write_inc''.
+@@ -2271,6 +2370,118 @@ attachments   -I message/external-body
+ # See also $read_inc, $write_inc and $net_inc.
  # 
  # 
 +# set news_cache_dir="~/.mutt"
@@ -7386,7 +7466,7 @@ diff -udprP mutt-1.5.13.orig/Muttrc mutt-1.5.13/Muttrc
 +# $NNTPSERVER or contained in the file /etc/nntpserver.  You can also
 +# specify username and an alternative port for each newsserver, ie:
 +# 
-+# [nntp[s]://][username[:password]@]newsserver[:port]
++# [news[s]://][username[:password]@]newsserver[:port]
 +# 
 +# 
 +# set newsrc="~/.newsrc"
@@ -7477,7 +7557,7 @@ diff -udprP mutt-1.5.13.orig/Muttrc mutt-1.5.13/Muttrc
  # set pager="builtin"
  #
  # Name: pager
-@@ -3076,6 +3286,19 @@ attachments   -I message/external-body
+@@ -2986,6 +3197,19 @@ attachments   -I message/external-body
  # string after the inclusion of a message which is being replied to.
  # 
  # 
@@ -7497,7 +7577,7 @@ diff -udprP mutt-1.5.13.orig/Muttrc mutt-1.5.13/Muttrc
  # set postpone=ask-yes
  #
  # Name: postpone
-@@ -3588,6 +3811,41 @@ attachments   -I message/external-body
+@@ -3563,6 +3787,41 @@ attachments   -I message/external-body
  # shell from /etc/passwd is used.
  # 
  # 
@@ -7539,8 +7619,8 @@ diff -udprP mutt-1.5.13.orig/Muttrc mutt-1.5.13/Muttrc
  # set sig_dashes=yes
  #
  # Name: sig_dashes
-@@ -4236,3 +4494,14 @@ attachments   -I message/external-body
- # messages to be sent.  Exim users may wish to unset this.
+@@ -4785,3 +5044,14 @@ attachments   -I message/external-body
+ # ``tuning'' section of the manual for performance considerations.
  # 
  # 
 +# set x_comment_to=no
@@ -7554,35 +7634,3 @@ diff -udprP mutt-1.5.13.orig/Muttrc mutt-1.5.13/Muttrc
 +# name of original article author) to article that followuped to newsgroup.
 +# 
 +# 
-diff -udprP mutt-1.5.13.orig/configure mutt-1.5.13/configure
---- mutt-1.5.13.orig/configure 2006-08-14 17:09:30.000000000 +0300
-+++ mutt-1.5.13/configure      2006-08-15 13:04:56.000000000 +0300
-@@ -859,6 +859,7 @@ Optional Features:
-                           Force use of an external dotlock program
-   --enable-pop            Enable POP3 support
-   --enable-imap           Enable IMAP support
-+  --enable-nntp           Enable NNTP support
-   --enable-debug          Enable debugging support
-   --enable-flock          Use flock() to lock files
-   --disable-fcntl         Do NOT use fcntl() to lock files
-@@ -11740,6 +11741,20 @@ fi
- fi
- done
-+# Check whether --enable-nntp or --disable-nntp was given.
-+if test "${enable_nntp+set}" = set; then
-+  enableval="$enable_nntp"
-+      if test x$enableval = xyes ; then
-+              cat >>confdefs.h <<\_ACEOF
-+#define USE_NNTP 1
-+_ACEOF
-+
-+              MUTT_LIB_OBJECTS="$MUTT_LIB_OBJECTS nntp.o newsrc.o"
-+              need_socket="yes"
-+      fi
-+
-+fi;
-+
- for ac_func in strftime
This page took 0.332758 seconds and 4 git commands to generate.