<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:syn="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/">
  <channel rdf:about="http://blog.gmane.org/gmane.mail.mutt.devel">
    <title>gmane.mail.mutt.devel</title>
    <link>http://blog.gmane.org/gmane.mail.mutt.devel</link>
    <description/>
    <syn:updatePeriod>hourly</syn:updatePeriod>
    <syn:updateFrequency>1</syn:updateFrequency>
    <syn:updateBase>1901-01-01T00:00+00:00</syn:updateBase>
    <items>
      <rdf:Seq>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.mail.mutt.devel/20770"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.mail.mutt.devel/20761"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.mail.mutt.devel/20739"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.mail.mutt.devel/20730"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.mail.mutt.devel/20700"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.mail.mutt.devel/20694"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.mail.mutt.devel/20675"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.mail.mutt.devel/20662"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.mail.mutt.devel/20640"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.mail.mutt.devel/20633"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.mail.mutt.devel/20631"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.mail.mutt.devel/20630"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.mail.mutt.devel/20626"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.mail.mutt.devel/20623"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.mail.mutt.devel/20611"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.mail.mutt.devel/20573"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.mail.mutt.devel/20567"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.mail.mutt.devel/20545"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.mail.mutt.devel/20541"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.mail.mutt.devel/20539"/>
      </rdf:Seq>
    </items>
    <image rdf:resource="http://gmane.org/img/gmane-25t.png"/>
    <textinput rdf:resource=""/>
  </channel>
  <image rdf:about="http://gmane.org/img/gmane-25t.png">
    <title>Gmane</title>
    <url>http://gmane.org/img/gmane-25t.png</url>
    <link>http://gmane.org</link>
  </image>
  <item rdf:about="http://comments.gmane.org/gmane.mail.mutt.devel/20770">
    <title>[Mutt] #3642: Missing header when building against S-Lang</title>
    <link>http://comments.gmane.org/gmane.mail.mutt.devel/20770</link>
    <description>&lt;pre&gt;#3642: Missing header when building against S-Lang
-------------------------+---------------------
 Reporter:  baskerville  |      Owner:  brendan
     Type:  defect       |     Status:  new
 Priority:  major        |  Milestone:
Component:  IMAP         |    Version:
 Keywords:               |
-------------------------+---------------------
 The following:

 {{{
 ./prepare \
     --prefix=/usr \
     --sysconfdir=/etc \
     --enable-gpgme \
     --enable-hcache \
     --with-slang=/usr \
     --with-regex \
     --with-idn
 make
 }}}

 yields

 {{{
 crypt-gpgme.c: In function ‘init_common’:
 crypt-gpgme.c:4369:15: error: ‘true’ undeclared (first use in this
 function)
      has_run = true;
 }}}

 The following patch ''solves'' the problem:
 {{{
 diff -r d498f0e91914 crypt-gpgme.c
 --- a/crypt-gpgme.c     Mon Mar 04 04:14:43 2013 +0000
 +++ b/crypt-gpgme.c     Sat Mar 23 11:58:04 2013 +0100
 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -39,6 +39,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
  #include &amp;lt;sys/wait.h&amp;gt;
  #include &amp;lt;string.h&amp;gt;
  #include &amp;lt;stdlib.h&amp;gt;
 +#include &amp;lt;stdbool.h&amp;gt;
  #include &amp;lt;unistd.h&amp;gt;
  #include &amp;lt;sys/stat.h&amp;gt;
  #include &amp;lt;errno.h&amp;gt;
 }}}

&lt;/pre&gt;</description>
    <dc:creator>Mutt</dc:creator>
    <dc:date>2013-05-03T18:41:21</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.mail.mutt.devel/20761">
    <title>[PATCH 0 of 3] Ticket #3082 preserve current input in history when cycling</title>
    <link>http://comments.gmane.org/gmane.mail.mutt.devel/20761</link>
    <description>&lt;pre&gt;I'm attaching a 3-part patch that is one possible solution to this. It
creates an extra slot in the History ring for a scratch buffer (at
h-&amp;gt;last). If you are editing inside that buffer, it is preserved when
you scroll up/down through the history. Editing while in other places in
history are *not* preserved with this patch.

I thought about creating a scratch history array instead, and trying to
preserve all edits in a temporary history array until done. But that
seemed a lot more complexity and work for a smaller usage case. Of
course if other people think that's important I'll be glad to work on
that alternative.

Another behavior change worth noting with this patch: the position
in history is now reset to the scratch buffer after each input
entry. Before, the position would be stay wherever it was - you didn't
restart at the "bottom" each time.

 history.c |  10 +++++-----
 enter.c   |   1 +
 history.c |  10 ++++++++++
 history.h |   1 +
 enter.c   |  10 ++++++++++
 history.c |  31 ++++++++++++++++++++++++++++---
 history.h |   2 ++
 7 files changed, 57 insertions(+), 8 deletions(-)

&lt;/pre&gt;</description>
    <dc:creator>Kevin J. McCarthy</dc:creator>
    <dc:date>2013-04-27T22:48:23</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.mail.mutt.devel/20739">
    <title>[Mutt] #3641: Latest commit causes mutt to quit after failedpassword attempt on OSX 10.8.3.</title>
    <link>http://comments.gmane.org/gmane.mail.mutt.devel/20739</link>
    <description>&lt;pre&gt;#3641: Latest commit causes mutt to quit after failed password attempt on OSX
10.8.3.
------------------------+---------------------
 Reporter:  balderdash  |      Owner:  brendan
     Type:  defect      |     Status:  new
 Priority:  major       |  Milestone:
Component:  IMAP        |    Version:
 Keywords:              |
------------------------+---------------------
 Mutt from tip, OSX 10.8.3.

 Suddenly, after the April 16 commit, the following occurs (never once
 happened before):

 I do 'mutt' at the prompt to login to the IMAP server holding my mail
 (it's Zimbra).

 Next I type the incorrect password (I have $imap_pass unset).

 Next mutt says "Zimbra IMAP server terminating connection" (or something
 very similar).  Then that message disappears and I see "Login failed".

 So far, so good.  This is as it has always been and how it should be.

 But after the Apr 16th commit, this is followed up by *mutt* quitting, and
 after it's quit I see output between the last bash prompt and the new one:
 "Login failed".

 Formerly, mutt wouldn't quit, and the "Login failed" message *inside* mutt
 would stay there until I hit another key.  I could then do, for example
 "c=" to get a fresh password prompt.

 This only seems to happen on the account that uses Zimbra.  Gmail and my
 other accounts (which is either Courier or Dovecot) don't exhibit this.
 And I've just verified that there is no problem with commit 4c5163.  It's
 d3096e that's done this.

&lt;/pre&gt;</description>
    <dc:creator>Mutt</dc:creator>
    <dc:date>2013-04-25T05:25:55</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.mail.mutt.devel/20730">
    <title>[Mutt] #3640: Hangs on index view when connected with gmail imapserver</title>
    <link>http://comments.gmane.org/gmane.mail.mutt.devel/20730</link>
    <description>&lt;pre&gt;#3640: Hangs on index view when connected with gmail imap server
---------------------+---------------------
 Reporter:  tarruda  |      Owner:  brendan
     Type:  defect   |     Status:  new
 Priority:  major    |  Milestone:
Component:  IMAP     |    Version:
 Keywords:           |
---------------------+---------------------
 Randomly hangs when connected with gmail

 When running 'strace' on the hanged mutt pid(983 in this example) I get:

     $ sudo strace -p 983
     Process 983 attached - interrupt to quit
     recv(3,

 which netstat shows to be the fd representing the IMAP connection. I also
 ran:

     $ cat /proc/983/fdinfo/3
     pos:    0
     flags:  02000002

 According to 'dalias'(#mutt on freenode) this bug seems to be related to a
 change google made in their ssl implementation about a week ago.

&lt;/pre&gt;</description>
    <dc:creator>Mutt</dc:creator>
    <dc:date>2013-04-24T15:43:26</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.mail.mutt.devel/20700">
    <title>mutt: Don't exit pager if quit=ask is answered "no".</title>
    <link>http://comments.gmane.org/gmane.mail.mutt.devel/20700</link>
    <description>&lt;pre&gt;changeset: 6305:d3096e8796e7
user:      Kevin McCarthy &amp;lt;kevin&amp;lt; at &amp;gt;8t8.us&amp;gt;
date:      Tue Apr 16 20:12:25 2013 -0700
link:      http://dev.mutt.org/hg/mutt/rev/d3096e8796e7

Don't exit pager if quit=ask is answered "no".

This patch addresses ticket 2788.

Currently if you quit ('Q') from inside the pager, with quit=ask-yes
or quit=ask-no, and you respond "no", mutt leaves you back in the index
menu.

This patch changes it so that mutt does not exit the pager.

diffs (19 lines):

diff -r 4c5163272b9c -r d3096e8796e7 pager.c
--- a/pager.cThu Apr 11 02:17:41 2013 +0000
+++ b/pager.cTue Apr 16 20:12:25 2013 -0700
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1927,6 +1927,15 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 ch = -1;
 break;
 
+      case OP_QUIT:
+if (query_quadoption (OPT_QUIT, _("Quit Mutt?")) == M_YES)
+{
+  /* avoid prompting again in the index menu */
+  set_quadoption (OPT_QUIT, M_YES);
+  ch = -1;
+}
+break;
+
       case OP_NEXT_PAGE:
 if (lineInfo[curline].offset &amp;lt; sb.st_size-1)
 {

&lt;/pre&gt;</description>
    <dc:creator>Brendan Cully</dc:creator>
    <dc:date>2013-04-22T06:21:38</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.mail.mutt.devel/20694">
    <title>[PATCH] Fix postpone/resume to not remove a Mail-Followup-To header</title>
    <link>http://comments.gmane.org/gmane.mail.mutt.devel/20694</link>
    <description>&lt;pre&gt;This solution changes mutt_prepare_template() to check whether the
message_id field is NULL to decide whether to wipe the message-id and
mail-followup-to headers when instantiating the message.

If we are resending a message, we don't want the previous message-id
and mail-followup-to headers.  If we are resuming a postponed message,
however, we want to keep the mail-followup-to header if any was set
before the postpone.


 postpone.c |  11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)


&lt;/pre&gt;</description>
    <dc:creator>Kevin J. McCarthy</dc:creator>
    <dc:date>2013-04-21T02:02:34</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.mail.mutt.devel/20675">
    <title>[PATCH] Don't exit pager if quit=ask is answered "no"</title>
    <link>http://comments.gmane.org/gmane.mail.mutt.devel/20675</link>
    <description>&lt;pre&gt;This patch addresses ticket 2788.

Currently if you quit ('Q') from inside the pager, with quit=ask-yes
or quit=ask-no, and you respond "no", mutt leaves you back in the index
menu.

This patch changes it so that mutt does not exit the pager.


 pager.c |  9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)


&lt;/pre&gt;</description>
    <dc:creator>Kevin J. McCarthy</dc:creator>
    <dc:date>2013-04-17T03:12:29</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.mail.mutt.devel/20662">
    <title>maildir file extensions</title>
    <link>http://comments.gmane.org/gmane.mail.mutt.devel/20662</link>
    <description>&lt;pre&gt;Hi,
First off I want to say how much I've enjoyed using mutt for the last 5 
years.  It really is a great program and does almost everything I could 
want.

In recent years, everyone seems to want instant searching/virtual 
folder type of features.  I know that's a bit out of mutt's scope.  
I know tools like mu and notmuch exists but their functionality and 
integration often leave something to be desired.

I run mutt on OS X.  As I'm sure many of you know, OS X has a system 
wide content indexing and search system called Spotlight.  Spotlight 
already indexes and searches emails stored individually as files 
(similar to maildir) and OS X also has a preview function for said 
files.  All they require is to have the extension '.eml'.

If mutt simply wrote out messages in a maildir format with a '.eml' 
extension, you'd get system wide search integration for free on OS X.

I've already played around with renaming some messages to have the 
'.eml' extension in a maildir, and mutt reads them fine.  Obviously, if 
you go to modify that message, mutt mangles the filename (it appears to 
assume the characters '.eml' are flags and resorts them).  I'm thinking, 
as a non-C programmer :), it's probably not *too* much work to get mutt 
to add said extension to messages it writes out in maildir.  I'm 
assuming one would also need to check for said extensions when reading 
and changing message flags.

How difficult would this be to implement?  I know this is an open source 
project, and if I want a feature, I should implement it myself.  I'll be 
honest with you, I don't really know C and mutt is a pretty mature 
project; it's a bit intimidating to jump into.  A few pointers would be 
appreciated.

Thanks,
Tim

&lt;/pre&gt;</description>
    <dc:creator>Tim Gray</dc:creator>
    <dc:date>2013-04-16T16:25:51</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.mail.mutt.devel/20640">
    <title>[PATCH 0 of 2] Ticket #3564: Allow empty user-id for pub record</title>
    <link>http://comments.gmane.org/gmane.mail.mutt.devel/20640</link>
    <description>&lt;pre&gt;This patch series fixes Ticket #3564.  Currently a key whose primary uid
has an empty User-ID can not be used for encryption in mutt.

The first patch changes parse_pub_line() to allow an empty User-ID field
for a pub record type.  This will allow the key to have an address
record generated, although it will have a null addr field.  The key
searching and key selection menus both iterate over address records, so
without at least one, the user is unable to search for or select such
a key.

The second patch wraps usages of addr in NONULL() where needed.  Most
of the mutt routines already have null checks in them.  A few debug
messages and a couple places in the pgp_select_key menu needed to be 
wrapped for safety. (They did not actually generate a segfault for me, but
better to be safe across platforms).

As a side note, in pgp_getkeybystr, the comparison:
  if (!*p || mutt_strcasecmp (p, pgp_keyid (k)) == 0 ||
      (!mutt_strncasecmp (p, "0x", 2) &amp;amp;&amp;amp; !mutt_strcasecmp (p + 2, pgp_keyid (k))) ||
      (option (OPTPGPLONGIDS) &amp;amp;&amp;amp; !mutt_strncasecmp (p, "0x", 2) &amp;amp;&amp;amp;
      !mutt_strcasecmp (p + 2, k-&amp;gt;keyid + 8)) ||
      mutt_stristr (a-&amp;gt;addr, p))
takes place inside the address matching loop.  Only the last one is
actually matching against the address.  The others could be pulled in
front of the loop.  I was tempted, but decided to be conservative with
my changes for now :-).

Gpgme does not seem to be affected by this bug.

 gnupgparse.c |  15 +++++++++++----
 gnupgparse.c |   2 +-
 pgpkey.c     |   6 +++---
 3 files changed, 15 insertions(+), 8 deletions(-)

&lt;/pre&gt;</description>
    <dc:creator>Kevin J. McCarthy</dc:creator>
    <dc:date>2013-04-10T21:58:57</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.mail.mutt.devel/20633">
    <title>mutt: backout c1371176ea45</title>
    <link>http://comments.gmane.org/gmane.mail.mutt.devel/20633</link>
    <description>&lt;pre&gt;changeset: 6304:4c5163272b9c
user:      Michael Elkins &amp;lt;me&amp;lt; at &amp;gt;sigpipe.org&amp;gt;
date:      Thu Apr 11 02:17:41 2013 +0000
link:      http://dev.mutt.org/hg/mutt/rev/4c5163272b9c

backout c1371176ea45

diffs (313 lines):

diff -r f99e91980f0f -r 4c5163272b9c browser.c
--- a/browser.cThu Apr 11 01:59:26 2013 +0000
+++ b/browser.cThu Apr 11 02:17:41 2013 +0000
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -615,11 +615,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
       }
       else
       {
-if (getcwd (LastDir, sizeof (LastDir)) == NULL)
-{
-  dprint(1, (debugfile, "%s:%d getcwd() returned NULL\n", __FILE__, __LINE__));
-  LastDir[0] = '\0';
-}
+getcwd (LastDir, sizeof (LastDir));
 safe_strcat (LastDir, sizeof (LastDir), "/");
 safe_strncat (LastDir, sizeof (LastDir), f, i);
       }
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -629,13 +625,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
       if (f[0] == '/')
 strcpy (LastDir, "/");/* __STRCPY_CHECKED__ */
       else
-      {
-if (getcwd (LastDir, sizeof (LastDir)) == NULL)
-{
-  dprint(1, (debugfile, "%s:%d getcwd() returned NULL\n", __FILE__, __LINE__));
-  LastDir[0] = '\0';
-}
-      }
+getcwd (LastDir, sizeof (LastDir));
     }
 
     if (i &amp;lt;= 0 &amp;amp;&amp;amp; f[0] != '/')
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -650,13 +640,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
   else 
   {
     if (!folder)
-    {
-      if (getcwd (LastDir, sizeof (LastDir)) == NULL)
-      {
-dprint(1, (debugfile, "%s:%d getcwd() returned NULL\n", __FILE__, __LINE__));
-LastDir[0] = '\0';
-      }
-    }
+      getcwd (LastDir, sizeof (LastDir));
     else if (!LastDir[0])
       strfcpy (LastDir, NONULL(Maildir), sizeof (LastDir));
     
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -675,13 +659,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
       while (i &amp;amp;&amp;amp; LastDir[--i] == '/')
         LastDir[i] = '\0';
       if (!LastDir[0])
-      {
-        if (getcwd (LastDir, sizeof (LastDir)) == NULL)
-{
-  dprint(1, (debugfile, "%s:%d getcwd() returned NULL\n", __FILE__, __LINE__));
-  LastDir[0] = '\0';
-}
-      }
+        getcwd (LastDir, sizeof (LastDir));
     }
   }
 
diff -r f99e91980f0f -r 4c5163272b9c enter.c
--- a/enter.cThu Apr 11 01:59:26 2013 +0000
+++ b/enter.cThu Apr 11 02:17:41 2013 +0000
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -28,7 +28,6 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 #include "history.h"
 
 #include &amp;lt;string.h&amp;gt;
-#include &amp;lt;errno.h&amp;gt;
 
 /* redraw flags for mutt_enter_string() */
 enum
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -95,8 +94,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 
   /* If this works, we can stop now */
   if (dlen &amp;gt;= MB_LEN_MAX) {
-    if (wcrtomb (dest, 0, &amp;amp;st) == (size_t) -1)
-      dprint(1, (debugfile, "%s:%d wcrtomb() returned -1, errno=%d\n", __FILE__, __LINE__, errno));
+    wcrtomb (dest, 0, &amp;amp;st);
     return;
   }
 
diff -r f99e91980f0f -r 4c5163272b9c imap/message.c
--- a/imap/message.cThu Apr 11 01:59:26 2013 +0000
+++ b/imap/message.cThu Apr 11 02:17:41 2013 +0000
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -561,13 +561,11 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
   }
 
   h-&amp;gt;lines = 0;
-  if (fgets (buf, sizeof (buf), msg-&amp;gt;fp) == NULL)
-      ; /* EOF checked below */
+  fgets (buf, sizeof (buf), msg-&amp;gt;fp);
   while (!feof (msg-&amp;gt;fp))
   {
     h-&amp;gt;lines++;
-    if (fgets (buf, sizeof (buf), msg-&amp;gt;fp) == NULL)
-; /* EOF checked in while loop condition */
+    fgets (buf, sizeof (buf), msg-&amp;gt;fp);
   }
 
   h-&amp;gt;content-&amp;gt;length = ftell (msg-&amp;gt;fp) - h-&amp;gt;content-&amp;gt;offset;
diff -r f99e91980f0f -r 4c5163272b9c init.c
--- a/init.cThu Apr 11 01:59:26 2013 +0000
+++ b/init.cThu Apr 11 02:17:41 2013 +0000
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -2822,6 +2822,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 #ifdef DEBUG
 static void start_debug (void)
 {
+  time_t t;
   int i;
   char buf[_POSIX_PATH_MAX];
   char buf2[_POSIX_PATH_MAX];
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -2835,6 +2836,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
   }
   if ((debugfile = safe_fopen(buf, "w")) != NULL)
   {
+    t = time (0);
     setbuf (debugfile, NULL); /* don't buffer the debugging output! */
     dprint(1,(debugfile,"Mutt/%s (%s) debugging at level %d\n",
       MUTT_VERSION, ReleaseDate, debuglevel));
diff -r f99e91980f0f -r 4c5163272b9c mbox.c
--- a/mbox.cThu Apr 11 01:59:26 2013 +0000
+++ b/mbox.cThu Apr 11 02:17:41 2013 +0000
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -968,11 +968,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
     if (i == 0)
     {
       ctx-&amp;gt;size = ftello (ctx-&amp;gt;fp); /* update the size of the mailbox */
-      if (ftruncate (fileno (ctx-&amp;gt;fp), ctx-&amp;gt;size) == -1)
-      {
-dprint(1, (debugfile, "%s:%d ftrunctate() returned -1, errno=%d\n", __FILE__, __LINE__, errno));
-i = -1;
-      }
+      ftruncate (fileno (ctx-&amp;gt;fp), ctx-&amp;gt;size);
     }
   }
 
diff -r f99e91980f0f -r 4c5163272b9c muttlib.c
--- a/muttlib.cThu Apr 11 01:59:26 2013 +0000
+++ b/muttlib.cThu Apr 11 02:17:41 2013 +0000
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -67,7 +67,6 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
   char buf[_POSIX_PATH_MAX];
   char tmp[_POSIX_PATH_MAX];
   char *period;
-  char *r;
   size_t sl;
   struct stat sb;
   
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -76,9 +75,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
   if (s[0] == '\0')
   {
     snprintf (s, l, "%s/muttXXXXXX", buf);
-    r = mktemp (s);
-    if (*r == '\0')
-      dprint (1, (debugfile, "%s:%d mktemp returned an empty string (errno=%d)\n", __FILE__, __LINE__, errno));
+    mktemp (s);
   }
   else
   {
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -90,9 +87,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
     if ((period = strrchr (tmp, '.')) != NULL)
       *period = 0;
     snprintf (s, l, "%s/%s.XXXXXX", buf, tmp);
-    r = mktemp (s);
-    if (*r == '\0')
-      dprint (1, (debugfile, "%s:%d mktemp returned an empty string (errno=%d)\n", __FILE__, __LINE__, errno));
+    mktemp (s);
     if (period != NULL)
     {
       *period = '.';
diff -r f99e91980f0f -r 4c5163272b9c mx.c
--- a/mx.cThu Apr 11 01:59:26 2013 +0000
+++ b/mx.cThu Apr 11 02:17:41 2013 +0000
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -379,7 +379,6 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
   }
   else if (st.st_size == 0)
   {
-zero_size_file:
     /* hard to tell what zero-length files are, so assume the default magic */
     if (DefaultMagic == M_MBOX || DefaultMagic == M_MMDF)
       return (DefaultMagic);
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -390,12 +389,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
   {
     struct utimbuf times;
 
-    if (fgets (tmp, sizeof (tmp), f) == NULL)
-    {
-      /* This situation should not occur since we check for size==0 above.. */
-      dprint(1, (debugfile, "%s:%d fgets() returned NULL.  this should not happen!\n", __FILE__, __LINE__));
-      goto zero_size_file;
-    }
+    fgets (tmp, sizeof (tmp), f);
     if (mutt_strncmp ("From ", tmp, 5) == 0)
       magic = M_MBOX;
     else if (mutt_strcmp (MMDF_SEP, tmp) == 0)
diff -r f99e91980f0f -r 4c5163272b9c pop.c
--- a/pop.cThu Apr 11 01:59:26 2013 +0000
+++ b/pop.cThu Apr 11 02:17:41 2013 +0000
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -67,7 +67,6 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
   long length;
   char buf[LONG_STRING];
   char tempfile[_POSIX_PATH_MAX];
-  int rv;
 
   mutt_mktemp (tempfile, sizeof (tempfile));
   if (!(f = safe_fopen (tempfile, "w+")))
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -80,8 +79,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
   ret = pop_query (pop_data, buf, sizeof (buf));
   if (ret == 0)
   {
-    if ((rv = sscanf (buf, "+OK %d %ld", &amp;amp;index, &amp;amp;length)) &amp;lt; 2)
-      dprint(1, (debugfile, "%s:%d sscanf() returned %d\n", __FILE__, __LINE__, rv));
+    sscanf (buf, "+OK %d %ld", &amp;amp;index, &amp;amp;length);
 
     snprintf (buf, sizeof (buf), "TOP %d 0\r\n", h-&amp;gt;refno);
     ret = pop_fetch_data (pop_data, buf, NULL, fetch_message, f);
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -112,21 +110,12 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
     {
       rewind (f);
       h-&amp;gt;env = mutt_read_rfc822_header (f, h, 0, 0);
-      /*
-       * The following code seems to be trying to alter the content length by
-       * removing the CR characters for the header.  Note that this value is
-       * still incorrect, since "TOP 0" only returns the message header, so it
-       * only ends up accounting for the CR characters in the header.  The
-       * correct length is set when the entire message is downloaded by
-       * pop_fetch_message().
-       */
       h-&amp;gt;content-&amp;gt;length = length - h-&amp;gt;content-&amp;gt;offset + 1;
       rewind (f);
       while (!feof (f))
       {
 h-&amp;gt;content-&amp;gt;length--;
-if (fgets (buf, sizeof (buf), f) == NULL)
-  ; /* EOF checked in while loop condition */
+fgets (buf, sizeof (buf), f);
       }
       break;
     }
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -649,13 +638,11 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 
   h-&amp;gt;data = uidl;
   h-&amp;gt;lines = 0;
-  if (fgets (buf, sizeof (buf), msg-&amp;gt;fp) == NULL)
-    ; /* EOF checked in following while loop condition */
+  fgets (buf, sizeof (buf), msg-&amp;gt;fp);
   while (!feof (msg-&amp;gt;fp))
   {
     ctx-&amp;gt;hdrs[msgno]-&amp;gt;lines++;
-    if (fgets (buf, sizeof (buf), msg-&amp;gt;fp) == NULL)
-      ; /* EOF checked in following while loop condition */
+    fgets (buf, sizeof (buf), msg-&amp;gt;fp);
   }
 
   h-&amp;gt;content-&amp;gt;length = ftello (msg-&amp;gt;fp) - h-&amp;gt;content-&amp;gt;offset;
diff -r f99e91980f0f -r 4c5163272b9c query.c
--- a/query.cThu Apr 11 01:59:26 2013 +0000
+++ b/query.cThu Apr 11 02:17:41 2013 +0000
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -93,12 +93,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
   }
   if (!quiet)
     mutt_message _("Waiting for response...");
-  if (fgets (msg, sizeof (msg), fp) == NULL)
-  {
-    dprint(1, (debugfile, "%s:%d query_command produced no output (fgets() returned NULL)\n", __FILE__, __LINE__));
-    return 0;
-  }
-
+  fgets (msg, sizeof (msg), fp);
   if ((p = strrchr (msg, '\n')))
     *p = '\0';
   while ((buf = mutt_read_line (buf, &amp;amp;buflen, fp, &amp;amp;dummy, 0)) != NULL)
diff -r f99e91980f0f -r 4c5163272b9c smime.c
--- a/smime.cThu Apr 11 01:59:26 2013 +0000
+++ b/smime.cThu Apr 11 02:17:41 2013 +0000
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -391,24 +391,8 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
     while (!feof(index)) {
         numFields = fscanf (index, MUTT_FORMAT(STRING) " %x.%i " MUTT_FORMAT(STRING), fields[0], &amp;amp;hash,
           &amp;amp;hash_suffix, fields[2]);
-/*
- * ensure good values for these fields since they may not be set if
- * `public` is false, and they are used below.
- */
-fields[3][0] = '\0';
-fields[4][0] = '\0';
         if (public)
-{
-  /*
-   * The original code here did not check the return value of fscanf,
-   * so I'm unsure whether the entire line should be ignored upon
-   * error.  Just log it for now.
-   */
-  int rv;
-          rv = fscanf (index, MUTT_FORMAT(STRING) " " MUTT_FORMAT(STRING) "\n", fields[3], fields[4]);
-  if (rv &amp;lt; 2)
-   dprint (1, (debugfile, "%s:%d fscanf() returned %d\n", __FILE__, __LINE__, errno));
-}
+          fscanf (index, MUTT_FORMAT(STRING) " " MUTT_FORMAT(STRING) "\n", fields[3], fields[4]);
   
       /* 0=email 1=name 2=nick 3=intermediate 4=trust */
       if (numFields &amp;lt; 2) continue;
diff -r f99e91980f0f -r 4c5163272b9c system.c
--- a/system.cThu Apr 11 01:59:26 2013 +0000
+++ b/system.cThu Apr 11 02:17:41 2013 +0000
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -92,8 +92,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
   close (1);
   close (2);
 #endif
-  if (chdir ("/") == -1)
-    _exit (127);
+  chdir ("/");
   act.sa_handler = SIG_DFL;
   sigaction (SIGCHLD, &amp;amp;act, NULL);
   break;

&lt;/pre&gt;</description>
    <dc:creator>Brendan Cully</dc:creator>
    <dc:date>2013-04-11T02:17:31</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.mail.mutt.devel/20631">
    <title>mutt: Backed out changeset 1142ed8974fa</title>
    <link>http://comments.gmane.org/gmane.mail.mutt.devel/20631</link>
    <description>&lt;pre&gt;changeset: 6303:f99e91980f0f
user:      Michael Elkins &amp;lt;me&amp;lt; at &amp;gt;sigpipe.org&amp;gt;
date:      Thu Apr 11 01:59:26 2013 +0000
link:      http://dev.mutt.org/hg/mutt/rev/f99e91980f0f

Backed out changeset 1142ed8974fa

diffs (161 lines):

diff -r 1142ed8974fa -r f99e91980f0f getdomain.c
--- a/getdomain.cWed Apr 10 23:40:18 2013 +0000
+++ b/getdomain.cThu Apr 11 01:59:26 2013 +0000
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -6,10 +6,6 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 #include &amp;lt;ctype.h&amp;gt;
 #include &amp;lt;string.h&amp;gt;
 
-/* for getaddrinfo() */
-#include &amp;lt;sys/types.h&amp;gt;
-#include &amp;lt;netdb.h&amp;gt;
-
 #include "mutt.h"
 
 #ifndef STDC_HEADERS
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -33,63 +29,40 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 
 int getdnsdomainname (char *s, size_t l)
 {
-#ifdef DOMAIN
-  /* specified at compile time */
-  snprintf(s, l, "%s.%s", Hostname, DOMAIN);
-#else
   FILE *f;
   char tmp[1024];
   char *p = NULL;
   char *q;
-  struct addrinfo hints;
-  struct addrinfo *res;
 
-  /* Try a DNS lookup on the hostname to find the canonical name. */
-  memset(&amp;amp;hints, 0, sizeof(hints));
-  hints.ai_flags = AI_CANONNAME;
-  if (getaddrinfo(Hostname, NULL, &amp;amp;hints, &amp;amp;res) == 0)
+  if ((f = fopen ("/etc/resolv.conf", "r")) == NULL) return (-1);
+
+  tmp[sizeof (tmp) - 1] = 0;
+
+  l--; /* save room for the terminal \0 */
+
+  while (fgets (tmp, sizeof (tmp) - 1, f) != NULL)
   {
-    snprintf(s, l, "%s", res-&amp;gt;ai_canonname);
-    freeaddrinfo(res);
+    p = tmp;
+    while (ISSPACE (*p)) p++;
+    if (mutt_strncmp ("domain", p, 6) == 0 || mutt_strncmp ("search", p, 6) == 0)
+    {
+      p += 6;
+      
+      for (q = strtok (p, " \t\n"); q; q = strtok (NULL, " \t\n"))
+if (strcmp (q, "."))
+  break;
+
+      if (q)
+      {
+strip_trailing_dot (q);
+strfcpy (s, q, l);
+safe_fclose (&amp;amp;f);
+return 0;
+      }
+      
+    }
   }
-  else
-  {
-    /* Otherwise inspect /etc/resolve.conf for a hint. */
 
-    if ((f = fopen ("/etc/resolv.conf", "r")) == NULL) return (-1);
-
-    tmp[sizeof (tmp) - 1] = 0;
-
-    l--; /* save room for the terminal \0 */
-
-    while (fgets (tmp, sizeof (tmp) - 1, f) != NULL)
-    {
-      p = tmp;
-      while (ISSPACE (*p)) p++;
-      if (mutt_strncmp ("domain", p, 6) == 0 || mutt_strncmp ("search", p, 6) == 0)
-      {
-p += 6;
-
-for (q = strtok (p, " \t\n"); q; q = strtok (NULL, " \t\n"))
-  if (strcmp (q, "."))
-    break;
-
-if (q)
-{
-  strip_trailing_dot (q);
-  snprintf (s, l, "%s.%s", Hostname, q);
-  safe_fclose (&amp;amp;f);
-  return 0;
-}
-
-      }
-    }
-
-    safe_fclose (&amp;amp;f);
-
-    /* fall back to using just the bare hostname */
-    snprintf(s, l, "%s", Hostname);
-  }
-#endif
-  return 0;
+  safe_fclose (&amp;amp;f);
+  return (-1);
 }
diff -r 1142ed8974fa -r f99e91980f0f init.c
--- a/init.cWed Apr 10 23:40:18 2013 +0000
+++ b/init.cThu Apr 11 01:59:26 2013 +0000
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -2887,6 +2887,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 void mutt_init (int skip_sys_rc, LIST *commands)
 {
   struct passwd *pw;
+  struct utsname utsname;
   char *p, buffer[STRING];
   int i, default_rc = 0, need_pause = 0;
   BUFFER err;
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -2952,21 +2953,30 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 #endif
 
   /* And about the host... */
+  uname (&amp;amp;utsname);
+  /* some systems report the FQDN instead of just the hostname */
+  if ((p = strchr (utsname.nodename, '.')))
   {
-    size_t namelen = sysconf(_SC_HOST_NAME_MAX);
-    char *name = safe_malloc(namelen + 1);
-    if (gethostname(name, namelen) == -1)
-    {
-      fputs (_("unable to determine hostname"), stderr);
-      exit (1);
-    }
-    Hostname = safe_strdup(name);
-    FREE (&amp;amp;name);
+    Hostname = mutt_substrdup (utsname.nodename, p);
+    p++;
+    strfcpy (buffer, p, sizeof (buffer)); /* save the domain for below */
   }
-
-  /* determine the DNS domain name */
-  getdnsdomainname (buffer, sizeof (buffer));
-  Fqdn = safe_strdup(buffer);
+  else
+    Hostname = safe_strdup (utsname.nodename);
+
+#ifndef DOMAIN
+#define DOMAIN buffer
+  if (!p &amp;amp;&amp;amp; getdnsdomainname (buffer, sizeof (buffer)) == -1)
+    Fqdn = safe_strdup ("&amp;lt; at &amp;gt;");
+  else
+#endif /* DOMAIN */
+    if (*DOMAIN != '&amp;lt; at &amp;gt;')
+  {
+    Fqdn = safe_malloc (mutt_strlen (DOMAIN) + mutt_strlen (Hostname) + 2);
+    sprintf (Fqdn, "%s.%s", NONULL(Hostname), DOMAIN);/* __SPRINTF_CHECKED__ */
+  }
+  else
+    Fqdn = safe_strdup(NONULL(Hostname));
 
   if ((p = getenv ("MAIL")))
     Spoolfile = safe_strdup (p);

&lt;/pre&gt;</description>
    <dc:creator>Brendan Cully</dc:creator>
    <dc:date>2013-04-11T01:59:17</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.mail.mutt.devel/20630">
    <title>[PATCH 0 of 2] Ticket #3564: Allow empty user-id for pub record</title>
    <link>http://comments.gmane.org/gmane.mail.mutt.devel/20630</link>
    <description>&lt;pre&gt;[Apologies if this is a dup.  It appears the mailing list ate my
previous patchbomb set.]

This patch series fixes Ticket #3564.  Currently a key whose primary uid
has an empty User-ID can not be used for encryption in mutt.

The first patch changes parse_pub_line() to allow an empty User-ID field
for a pub record type.  This will allow the key to have an address
record generated, although it will have a null addr field.  The key
searching and key selection menus both iterate over address records, so
without at least one, the user is unable to search for or select such
a key.

The second patch wraps usages of addr in NONULL() where needed.  Most
of the mutt routines already have null checks in them.  A few debug
messages and a couple places in the pgp_select_key menu needed to be
wrapped for safety. (They did not actually generate a segfault for me, but
better to be safe across platforms).

As a side note, in pgp_getkeybystr, the comparison:
  if (!*p || mutt_strcasecmp (p, pgp_keyid (k)) == 0 ||
      (!mutt_strncasecmp (p, "0x", 2) &amp;amp;&amp;amp; !mutt_strcasecmp (p + 2, pgp_keyid (k))) ||
      (option (OPTPGPLONGIDS) &amp;amp;&amp;amp; !mutt_strncasecmp (p, "0x", 2) &amp;amp;&amp;amp;
      !mutt_strcasecmp (p + 2, k-&amp;gt;keyid + 8)) ||
      mutt_stristr (a-&amp;gt;addr, p))
takes place inside the address matching loop.  Only the last one is
actually matching against the address.  The others could be pulled in
front of the loop.  I was tempted, but decided to be conservative with
my changes for now :-).

Gpgme does not seem to be affected by this bug.

 gnupgparse.c |  15 +++++++++++----
 gnupgparse.c |   2 +-
 pgpkey.c     |   6 +++---
 3 files changed, 15 insertions(+), 8 deletions(-)

&lt;/pre&gt;</description>
    <dc:creator>Kevin J. McCarthy</dc:creator>
    <dc:date>2013-04-11T01:22:04</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.mail.mutt.devel/20626">
    <title>mutt: use gethostname() to determine the system host name</title>
    <link>http://comments.gmane.org/gmane.mail.mutt.devel/20626</link>
    <description>&lt;pre&gt;changeset: 6302:1142ed8974fa
user:      Michael Elkins &amp;lt;me&amp;lt; at &amp;gt;sigpipe.org&amp;gt;
date:      Wed Apr 10 23:40:18 2013 +0000
link:      http://dev.mutt.org/hg/mutt/rev/1142ed8974fa

use gethostname() to determine the system host name

use getaddrinfo() to look up canonical DNS name, and fall back to hinting from /etc/resolv.conf

see #3298

diffs (156 lines):

diff -r c1371176ea45 -r 1142ed8974fa getdomain.c
--- a/getdomain.cWed Apr 10 22:38:47 2013 +0000
+++ b/getdomain.cWed Apr 10 23:40:18 2013 +0000
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -6,6 +6,10 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 #include &amp;lt;ctype.h&amp;gt;
 #include &amp;lt;string.h&amp;gt;
 
+/* for getaddrinfo() */
+#include &amp;lt;sys/types.h&amp;gt;
+#include &amp;lt;netdb.h&amp;gt;
+
 #include "mutt.h"
 
 #ifndef STDC_HEADERS
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -29,40 +33,63 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 
 int getdnsdomainname (char *s, size_t l)
 {
+#ifdef DOMAIN
+  /* specified at compile time */
+  snprintf(s, l, "%s.%s", Hostname, DOMAIN);
+#else
   FILE *f;
   char tmp[1024];
   char *p = NULL;
   char *q;
+  struct addrinfo hints;
+  struct addrinfo *res;
 
-  if ((f = fopen ("/etc/resolv.conf", "r")) == NULL) return (-1);
+  /* Try a DNS lookup on the hostname to find the canonical name. */
+  memset(&amp;amp;hints, 0, sizeof(hints));
+  hints.ai_flags = AI_CANONNAME;
+  if (getaddrinfo(Hostname, NULL, &amp;amp;hints, &amp;amp;res) == 0)
+  {
+    snprintf(s, l, "%s", res-&amp;gt;ai_canonname);
+    freeaddrinfo(res);
+  }
+  else
+  {
+    /* Otherwise inspect /etc/resolve.conf for a hint. */
 
-  tmp[sizeof (tmp) - 1] = 0;
+    if ((f = fopen ("/etc/resolv.conf", "r")) == NULL) return (-1);
 
-  l--; /* save room for the terminal \0 */
+    tmp[sizeof (tmp) - 1] = 0;
 
-  while (fgets (tmp, sizeof (tmp) - 1, f) != NULL)
-  {
-    p = tmp;
-    while (ISSPACE (*p)) p++;
-    if (mutt_strncmp ("domain", p, 6) == 0 || mutt_strncmp ("search", p, 6) == 0)
+    l--; /* save room for the terminal \0 */
+
+    while (fgets (tmp, sizeof (tmp) - 1, f) != NULL)
     {
-      p += 6;
-      
-      for (q = strtok (p, " \t\n"); q; q = strtok (NULL, " \t\n"))
-if (strcmp (q, "."))
-  break;
+      p = tmp;
+      while (ISSPACE (*p)) p++;
+      if (mutt_strncmp ("domain", p, 6) == 0 || mutt_strncmp ("search", p, 6) == 0)
+      {
+p += 6;
 
-      if (q)
-      {
-strip_trailing_dot (q);
-strfcpy (s, q, l);
-safe_fclose (&amp;amp;f);
-return 0;
+for (q = strtok (p, " \t\n"); q; q = strtok (NULL, " \t\n"))
+  if (strcmp (q, "."))
+    break;
+
+if (q)
+{
+  strip_trailing_dot (q);
+  snprintf (s, l, "%s.%s", Hostname, q);
+  safe_fclose (&amp;amp;f);
+  return 0;
+}
+
       }
-      
     }
+
+    safe_fclose (&amp;amp;f);
+
+    /* fall back to using just the bare hostname */
+    snprintf(s, l, "%s", Hostname);
   }
-
-  safe_fclose (&amp;amp;f);
-  return (-1);
+#endif
+  return 0;
 }
diff -r c1371176ea45 -r 1142ed8974fa init.c
--- a/init.cWed Apr 10 22:38:47 2013 +0000
+++ b/init.cWed Apr 10 23:40:18 2013 +0000
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -2887,7 +2887,6 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 void mutt_init (int skip_sys_rc, LIST *commands)
 {
   struct passwd *pw;
-  struct utsname utsname;
   char *p, buffer[STRING];
   int i, default_rc = 0, need_pause = 0;
   BUFFER err;
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -2953,30 +2952,21 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 #endif
 
   /* And about the host... */
-  uname (&amp;amp;utsname);
-  /* some systems report the FQDN instead of just the hostname */
-  if ((p = strchr (utsname.nodename, '.')))
   {
-    Hostname = mutt_substrdup (utsname.nodename, p);
-    p++;
-    strfcpy (buffer, p, sizeof (buffer)); /* save the domain for below */
+    size_t namelen = sysconf(_SC_HOST_NAME_MAX);
+    char *name = safe_malloc(namelen + 1);
+    if (gethostname(name, namelen) == -1)
+    {
+      fputs (_("unable to determine hostname"), stderr);
+      exit (1);
+    }
+    Hostname = safe_strdup(name);
+    FREE (&amp;amp;name);
   }
-  else
-    Hostname = safe_strdup (utsname.nodename);
-
-#ifndef DOMAIN
-#define DOMAIN buffer
-  if (!p &amp;amp;&amp;amp; getdnsdomainname (buffer, sizeof (buffer)) == -1)
-    Fqdn = safe_strdup ("&amp;lt; at &amp;gt;");
-  else
-#endif /* DOMAIN */
-    if (*DOMAIN != '&amp;lt; at &amp;gt;')
-  {
-    Fqdn = safe_malloc (mutt_strlen (DOMAIN) + mutt_strlen (Hostname) + 2);
-    sprintf (Fqdn, "%s.%s", NONULL(Hostname), DOMAIN);/* __SPRINTF_CHECKED__ */
-  }
-  else
-    Fqdn = safe_strdup(NONULL(Hostname));
+
+  /* determine the DNS domain name */
+  getdnsdomainname (buffer, sizeof (buffer));
+  Fqdn = safe_strdup(buffer);
 
   if ((p = getenv ("MAIL")))
     Spoolfile = safe_strdup (p);

&lt;/pre&gt;</description>
    <dc:creator>Brendan Cully</dc:creator>
    <dc:date>2013-04-10T23:40:10</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.mail.mutt.devel/20623">
    <title>mutt: fix various compiler warnings; most were due to unchecked ...</title>
    <link>http://comments.gmane.org/gmane.mail.mutt.devel/20623</link>
    <description>&lt;pre&gt;changeset: 6301:c1371176ea45
user:      Michael Elkins &amp;lt;me&amp;lt; at &amp;gt;sigpipe.org&amp;gt;
date:      Wed Apr 10 22:38:47 2013 +0000
link:      http://dev.mutt.org/hg/mutt/rev/c1371176ea45

fix various compiler warnings; most were due to unchecked return values from system calls.

diffs (313 lines):

diff -r d498f0e91914 -r c1371176ea45 browser.c
--- a/browser.cMon Mar 04 04:14:43 2013 +0000
+++ b/browser.cWed Apr 10 22:38:47 2013 +0000
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -615,7 +615,11 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
       }
       else
       {
-getcwd (LastDir, sizeof (LastDir));
+if (getcwd (LastDir, sizeof (LastDir)) == NULL)
+{
+  dprint(1, (debugfile, "%s:%d getcwd() returned NULL\n", __FILE__, __LINE__));
+  LastDir[0] = '\0';
+}
 safe_strcat (LastDir, sizeof (LastDir), "/");
 safe_strncat (LastDir, sizeof (LastDir), f, i);
       }
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -625,7 +629,13 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
       if (f[0] == '/')
 strcpy (LastDir, "/");/* __STRCPY_CHECKED__ */
       else
-getcwd (LastDir, sizeof (LastDir));
+      {
+if (getcwd (LastDir, sizeof (LastDir)) == NULL)
+{
+  dprint(1, (debugfile, "%s:%d getcwd() returned NULL\n", __FILE__, __LINE__));
+  LastDir[0] = '\0';
+}
+      }
     }
 
     if (i &amp;lt;= 0 &amp;amp;&amp;amp; f[0] != '/')
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -640,7 +650,13 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
   else 
   {
     if (!folder)
-      getcwd (LastDir, sizeof (LastDir));
+    {
+      if (getcwd (LastDir, sizeof (LastDir)) == NULL)
+      {
+dprint(1, (debugfile, "%s:%d getcwd() returned NULL\n", __FILE__, __LINE__));
+LastDir[0] = '\0';
+      }
+    }
     else if (!LastDir[0])
       strfcpy (LastDir, NONULL(Maildir), sizeof (LastDir));
     
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -659,7 +675,13 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
       while (i &amp;amp;&amp;amp; LastDir[--i] == '/')
         LastDir[i] = '\0';
       if (!LastDir[0])
-        getcwd (LastDir, sizeof (LastDir));
+      {
+        if (getcwd (LastDir, sizeof (LastDir)) == NULL)
+{
+  dprint(1, (debugfile, "%s:%d getcwd() returned NULL\n", __FILE__, __LINE__));
+  LastDir[0] = '\0';
+}
+      }
     }
   }
 
diff -r d498f0e91914 -r c1371176ea45 enter.c
--- a/enter.cMon Mar 04 04:14:43 2013 +0000
+++ b/enter.cWed Apr 10 22:38:47 2013 +0000
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -28,6 +28,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 #include "history.h"
 
 #include &amp;lt;string.h&amp;gt;
+#include &amp;lt;errno.h&amp;gt;
 
 /* redraw flags for mutt_enter_string() */
 enum
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -94,7 +95,8 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 
   /* If this works, we can stop now */
   if (dlen &amp;gt;= MB_LEN_MAX) {
-    wcrtomb (dest, 0, &amp;amp;st);
+    if (wcrtomb (dest, 0, &amp;amp;st) == (size_t) -1)
+      dprint(1, (debugfile, "%s:%d wcrtomb() returned -1, errno=%d\n", __FILE__, __LINE__, errno));
     return;
   }
 
diff -r d498f0e91914 -r c1371176ea45 imap/message.c
--- a/imap/message.cMon Mar 04 04:14:43 2013 +0000
+++ b/imap/message.cWed Apr 10 22:38:47 2013 +0000
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -561,11 +561,13 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
   }
 
   h-&amp;gt;lines = 0;
-  fgets (buf, sizeof (buf), msg-&amp;gt;fp);
+  if (fgets (buf, sizeof (buf), msg-&amp;gt;fp) == NULL)
+      ; /* EOF checked below */
   while (!feof (msg-&amp;gt;fp))
   {
     h-&amp;gt;lines++;
-    fgets (buf, sizeof (buf), msg-&amp;gt;fp);
+    if (fgets (buf, sizeof (buf), msg-&amp;gt;fp) == NULL)
+; /* EOF checked in while loop condition */
   }
 
   h-&amp;gt;content-&amp;gt;length = ftell (msg-&amp;gt;fp) - h-&amp;gt;content-&amp;gt;offset;
diff -r d498f0e91914 -r c1371176ea45 init.c
--- a/init.cMon Mar 04 04:14:43 2013 +0000
+++ b/init.cWed Apr 10 22:38:47 2013 +0000
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -2822,7 +2822,6 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 #ifdef DEBUG
 static void start_debug (void)
 {
-  time_t t;
   int i;
   char buf[_POSIX_PATH_MAX];
   char buf2[_POSIX_PATH_MAX];
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -2836,7 +2835,6 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
   }
   if ((debugfile = safe_fopen(buf, "w")) != NULL)
   {
-    t = time (0);
     setbuf (debugfile, NULL); /* don't buffer the debugging output! */
     dprint(1,(debugfile,"Mutt/%s (%s) debugging at level %d\n",
       MUTT_VERSION, ReleaseDate, debuglevel));
diff -r d498f0e91914 -r c1371176ea45 mbox.c
--- a/mbox.cMon Mar 04 04:14:43 2013 +0000
+++ b/mbox.cWed Apr 10 22:38:47 2013 +0000
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -968,7 +968,11 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
     if (i == 0)
     {
       ctx-&amp;gt;size = ftello (ctx-&amp;gt;fp); /* update the size of the mailbox */
-      ftruncate (fileno (ctx-&amp;gt;fp), ctx-&amp;gt;size);
+      if (ftruncate (fileno (ctx-&amp;gt;fp), ctx-&amp;gt;size) == -1)
+      {
+dprint(1, (debugfile, "%s:%d ftrunctate() returned -1, errno=%d\n", __FILE__, __LINE__, errno));
+i = -1;
+      }
     }
   }
 
diff -r d498f0e91914 -r c1371176ea45 muttlib.c
--- a/muttlib.cMon Mar 04 04:14:43 2013 +0000
+++ b/muttlib.cWed Apr 10 22:38:47 2013 +0000
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -67,6 +67,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
   char buf[_POSIX_PATH_MAX];
   char tmp[_POSIX_PATH_MAX];
   char *period;
+  char *r;
   size_t sl;
   struct stat sb;
   
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -75,7 +76,9 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
   if (s[0] == '\0')
   {
     snprintf (s, l, "%s/muttXXXXXX", buf);
-    mktemp (s);
+    r = mktemp (s);
+    if (*r == '\0')
+      dprint (1, (debugfile, "%s:%d mktemp returned an empty string (errno=%d)\n", __FILE__, __LINE__, errno));
   }
   else
   {
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -87,7 +90,9 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
     if ((period = strrchr (tmp, '.')) != NULL)
       *period = 0;
     snprintf (s, l, "%s/%s.XXXXXX", buf, tmp);
-    mktemp (s);
+    r = mktemp (s);
+    if (*r == '\0')
+      dprint (1, (debugfile, "%s:%d mktemp returned an empty string (errno=%d)\n", __FILE__, __LINE__, errno));
     if (period != NULL)
     {
       *period = '.';
diff -r d498f0e91914 -r c1371176ea45 mx.c
--- a/mx.cMon Mar 04 04:14:43 2013 +0000
+++ b/mx.cWed Apr 10 22:38:47 2013 +0000
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -379,6 +379,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
   }
   else if (st.st_size == 0)
   {
+zero_size_file:
     /* hard to tell what zero-length files are, so assume the default magic */
     if (DefaultMagic == M_MBOX || DefaultMagic == M_MMDF)
       return (DefaultMagic);
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -389,7 +390,12 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
   {
     struct utimbuf times;
 
-    fgets (tmp, sizeof (tmp), f);
+    if (fgets (tmp, sizeof (tmp), f) == NULL)
+    {
+      /* This situation should not occur since we check for size==0 above.. */
+      dprint(1, (debugfile, "%s:%d fgets() returned NULL.  this should not happen!\n", __FILE__, __LINE__));
+      goto zero_size_file;
+    }
     if (mutt_strncmp ("From ", tmp, 5) == 0)
       magic = M_MBOX;
     else if (mutt_strcmp (MMDF_SEP, tmp) == 0)
diff -r d498f0e91914 -r c1371176ea45 pop.c
--- a/pop.cMon Mar 04 04:14:43 2013 +0000
+++ b/pop.cWed Apr 10 22:38:47 2013 +0000
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -67,6 +67,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
   long length;
   char buf[LONG_STRING];
   char tempfile[_POSIX_PATH_MAX];
+  int rv;
 
   mutt_mktemp (tempfile, sizeof (tempfile));
   if (!(f = safe_fopen (tempfile, "w+")))
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -79,7 +80,8 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
   ret = pop_query (pop_data, buf, sizeof (buf));
   if (ret == 0)
   {
-    sscanf (buf, "+OK %d %ld", &amp;amp;index, &amp;amp;length);
+    if ((rv = sscanf (buf, "+OK %d %ld", &amp;amp;index, &amp;amp;length)) &amp;lt; 2)
+      dprint(1, (debugfile, "%s:%d sscanf() returned %d\n", __FILE__, __LINE__, rv));
 
     snprintf (buf, sizeof (buf), "TOP %d 0\r\n", h-&amp;gt;refno);
     ret = pop_fetch_data (pop_data, buf, NULL, fetch_message, f);
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -110,12 +112,21 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
     {
       rewind (f);
       h-&amp;gt;env = mutt_read_rfc822_header (f, h, 0, 0);
+      /*
+       * The following code seems to be trying to alter the content length by
+       * removing the CR characters for the header.  Note that this value is
+       * still incorrect, since "TOP 0" only returns the message header, so it
+       * only ends up accounting for the CR characters in the header.  The
+       * correct length is set when the entire message is downloaded by
+       * pop_fetch_message().
+       */
       h-&amp;gt;content-&amp;gt;length = length - h-&amp;gt;content-&amp;gt;offset + 1;
       rewind (f);
       while (!feof (f))
       {
 h-&amp;gt;content-&amp;gt;length--;
-fgets (buf, sizeof (buf), f);
+if (fgets (buf, sizeof (buf), f) == NULL)
+  ; /* EOF checked in while loop condition */
       }
       break;
     }
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -638,11 +649,13 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 
   h-&amp;gt;data = uidl;
   h-&amp;gt;lines = 0;
-  fgets (buf, sizeof (buf), msg-&amp;gt;fp);
+  if (fgets (buf, sizeof (buf), msg-&amp;gt;fp) == NULL)
+    ; /* EOF checked in following while loop condition */
   while (!feof (msg-&amp;gt;fp))
   {
     ctx-&amp;gt;hdrs[msgno]-&amp;gt;lines++;
-    fgets (buf, sizeof (buf), msg-&amp;gt;fp);
+    if (fgets (buf, sizeof (buf), msg-&amp;gt;fp) == NULL)
+      ; /* EOF checked in following while loop condition */
   }
 
   h-&amp;gt;content-&amp;gt;length = ftello (msg-&amp;gt;fp) - h-&amp;gt;content-&amp;gt;offset;
diff -r d498f0e91914 -r c1371176ea45 query.c
--- a/query.cMon Mar 04 04:14:43 2013 +0000
+++ b/query.cWed Apr 10 22:38:47 2013 +0000
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -93,7 +93,12 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
   }
   if (!quiet)
     mutt_message _("Waiting for response...");
-  fgets (msg, sizeof (msg), fp);
+  if (fgets (msg, sizeof (msg), fp) == NULL)
+  {
+    dprint(1, (debugfile, "%s:%d query_command produced no output (fgets() returned NULL)\n", __FILE__, __LINE__));
+    return 0;
+  }
+
   if ((p = strrchr (msg, '\n')))
     *p = '\0';
   while ((buf = mutt_read_line (buf, &amp;amp;buflen, fp, &amp;amp;dummy, 0)) != NULL)
diff -r d498f0e91914 -r c1371176ea45 smime.c
--- a/smime.cMon Mar 04 04:14:43 2013 +0000
+++ b/smime.cWed Apr 10 22:38:47 2013 +0000
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -391,8 +391,24 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
     while (!feof(index)) {
         numFields = fscanf (index, MUTT_FORMAT(STRING) " %x.%i " MUTT_FORMAT(STRING), fields[0], &amp;amp;hash,
           &amp;amp;hash_suffix, fields[2]);
+/*
+ * ensure good values for these fields since they may not be set if
+ * `public` is false, and they are used below.
+ */
+fields[3][0] = '\0';
+fields[4][0] = '\0';
         if (public)
-          fscanf (index, MUTT_FORMAT(STRING) " " MUTT_FORMAT(STRING) "\n", fields[3], fields[4]);
+{
+  /*
+   * The original code here did not check the return value of fscanf,
+   * so I'm unsure whether the entire line should be ignored upon
+   * error.  Just log it for now.
+   */
+  int rv;
+          rv = fscanf (index, MUTT_FORMAT(STRING) " " MUTT_FORMAT(STRING) "\n", fields[3], fields[4]);
+  if (rv &amp;lt; 2)
+   dprint (1, (debugfile, "%s:%d fscanf() returned %d\n", __FILE__, __LINE__, errno));
+}
   
       /* 0=email 1=name 2=nick 3=intermediate 4=trust */
       if (numFields &amp;lt; 2) continue;
diff -r d498f0e91914 -r c1371176ea45 system.c
--- a/system.cMon Mar 04 04:14:43 2013 +0000
+++ b/system.cWed Apr 10 22:38:47 2013 +0000
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -92,7 +92,8 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
   close (1);
   close (2);
 #endif
-  chdir ("/");
+  if (chdir ("/") == -1)
+    _exit (127);
   act.sa_handler = SIG_DFL;
   sigaction (SIGCHLD, &amp;amp;act, NULL);
   break;

&lt;/pre&gt;</description>
    <dc:creator>Brendan Cully</dc:creator>
    <dc:date>2013-04-10T22:38:39</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.mail.mutt.devel/20611">
    <title>Question about gpg keys missing a uid</title>
    <link>http://comments.gmane.org/gmane.mail.mutt.devel/20611</link>
    <description>&lt;pre&gt;I'm working on ticket 3564.  The reporter is unable to use a particular
key for encrypting an email.  The essence of the problem is that the
key's primary uid record has an empty User-ID field.

The "gpg --list-keys" command returns no uid records, and the pub record
has an empty User-ID field too.  This is resulting in a pgp_key_t with
no address records.

Since "gpg --list-keys --with-colons" merges the primary uid and primary
key record, I wonder if it would be okay to modify parse_pub_line() to
*not* ignore an empty Field 10 for a pub record type.

So basically the patch would be something like:
   case 10:                  /* name             */
   {
-    if (!pend || !*p)
+    if (!(pend &amp;amp;&amp;amp; (*p || is_pub)))
        break;                    /* empty field or no trailing colon */

This would create an address record, recording the trust and flags, but
with a null addr field.

Can anyone think of an adverse effect from doing this?  (I believe)
this would at least allow the primary key to be selected and used for
encryption.

Thank you,

-Kevin
&lt;/pre&gt;</description>
    <dc:creator>Kevin J. McCarthy</dc:creator>
    <dc:date>2013-04-10T03:25:00</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.mail.mutt.devel/20573">
    <title>Preserve Deleted flag when saving</title>
    <link>http://comments.gmane.org/gmane.mail.mutt.devel/20573</link>
    <description>&lt;pre&gt;I've been wondering for a while whether it is possible to completely
save a mailbox (i.e. mbox) in exactly its current state, deleted
messages and all, without actually purging deleted messages? In other
words, I would like to preserve the "Deleted" flag for a message,
maybe through the Status: header, so that the next time I open mutt,
the "Deleted" messages are still present and marked "Deleted".

Can this be achieved via configuration, or is anyone aware of a patch?
I've seen references to one or more patches that use a trash folder,
but that's not what I'm looking for.

&lt;/pre&gt;</description>
    <dc:creator>isdtor</dc:creator>
    <dc:date>2013-03-27T17:04:03</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.mail.mutt.devel/20567">
    <title>[PATCH 0 of 6] Add crypt_opportunistic_encrypt option</title>
    <link>http://comments.gmane.org/gmane.mail.mutt.devel/20567</link>
    <description>&lt;pre&gt;This patch set implements crypt_opportunistic_encrypt.  This option
allows mutt to automatically turn encryption on and off based on the
message recipients.

When emailing one person, a hook turning on crypt_autoencrypt works well
enough, but for multiple recipients it breaks down.  The hook will turn
on encryption if one of the recipients matches the hook, whether the
other recipients support encryption or not.

This patch allows mutt to make the decision for you.  It modifies
the various find_key methods to query whether all recipients have a
crypt-hook or have a key that can be automatically determined.

I have tested this for classic pgp and gpgme modes, but don't currently
use smime.  (The patch is much less invasive for smime, but feedback on
whether that works properly would be appreicated.)

This is my first large patch to mutt, but I think it would be useful and
many people would take advantage of it.  I welcome feedback and hope I
can improve it enough to be accepted.

-Kevin

 crypt-gpgme.c             |   42 +++--------------
 crypt-gpgme.h             |    4 +-
 crypt-mod-pgp-classic.c   |    4 +-
 crypt-mod-pgp-gpgme.c     |    4 +-
 crypt-mod-smime-classic.c |    4 +-
 crypt-mod-smime-gpgme.c   |    4 +-
 crypt-mod.h               |    3 +-
 crypt.c                   |   25 +++++++++-
 cryptglue.c               |    8 +-
 mutt_crypt.h              |    4 +-
 pgp.c                     |   31 +------------
 pgp.h                     |    2 +-
 smime.c                   |   34 +--------------
 smime.h                   |    2 +-
 crypt-gpgme.c             |   14 +++--
 crypt-gpgme.h             |    4 +-
 crypt-mod-pgp-classic.c   |    4 +-
 crypt-mod-pgp-gpgme.c     |    4 +-
 crypt-mod-smime-classic.c |    4 +-
 crypt-mod-smime-gpgme.c   |    4 +-
 crypt-mod.h               |    2 +-
 crypt.c                   |    4 +-
 cryptglue.c               |   16 ++++--
 mutt_crypt.h              |   12 +++-
 pgp.c                     |    4 +-
 pgp.h                     |    2 +-
 smime.c                   |    4 +-
 smime.h                   |    2 +-
 crypt.c                   |   20 ++++++++
 mutt_crypt.h              |    3 +
 pgp.c                     |   17 +------
 crypt-gpgme.c             |  105 ++++++++++++++++++++++++++++-----------------
 pgp.c                     |   42 ++++++++++-------
 pgp.h                     |    2 +-
 pgpkey.c                  |   24 ++++++++--
 smime.c                   |    6 +-
 crypt.c                   |   30 +++++++++++-
 mutt_crypt.h              |   10 +++-
 send.c                    |    2 +-
 compose.c                 |   17 +++++++
 init.h                    |    8 +++
 mutt.h                    |    1 +
 send.c                    |    8 +++-
 43 files changed, 307 insertions(+), 239 deletions(-)

&lt;/pre&gt;</description>
    <dc:creator>Kevin J. McCarthy</dc:creator>
    <dc:date>2013-03-16T04:03:47</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.mail.mutt.devel/20545">
    <title>mutt: use mkdtemp() to create temporary directory rather than mk...</title>
    <link>http://comments.gmane.org/gmane.mail.mutt.devel/20545</link>
    <description>&lt;pre&gt;changeset: 6300:d498f0e91914
user:      is&amp;lt; at &amp;gt;netbsd.org
date:      Mon Mar 04 04:14:43 2013 +0000
link:      http://dev.mutt.org/hg/mutt/rev/d498f0e91914

use mkdtemp() to create temporary directory rather than mktemp() followed by mkdir()

closes #3637

diffs (40 lines):

diff -r 4c16c0d1ba9e -r d498f0e91914 lib.c
--- a/lib.cSat Feb 23 03:12:43 2013 +0000
+++ b/lib.cMon Mar 04 04:14:43 2013 +0000
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -548,7 +548,6 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
   const char *basename;
   char parent[_POSIX_PATH_MAX];
   char *p;
-  int rv;
 
   strfcpy (parent, NONULL (path), sizeof (parent));
   
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -563,17 +562,19 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
     basename = path;
   }
 
-  do 
+  snprintf (newdir, ndlen, "%s/%s", parent, ".muttXXXXXX");
+  if (mkdtemp(newdir) == NULL)
   {
-    snprintf (newdir, ndlen, "%s/%s", parent, ".muttXXXXXX");
-    mktemp (newdir);
-  } 
-  while ((rv = mkdir (newdir, 0700)) == -1 &amp;amp;&amp;amp; errno == EEXIST);
+      dprint(1, (debugfile, "mutt_mkwrapdir: mkdtemp() failed\n"));
+      return -1;
+  }
   
-  if (rv == -1)
-    return -1;
-  
-  snprintf (newfile, nflen, "%s/%s", newdir, NONULL(basename));
+  if (snprintf (newfile, nflen, "%s/%s", newdir, NONULL(basename)) &amp;gt;= nflen)
+  {
+      rmdir(newdir);
+      dprint(1, (debugfile, "mutt_mkwrapdir: string was truncated\n"));
+      return -1;
+  }
   return 0;  
 }
 

&lt;/pre&gt;</description>
    <dc:creator>Brendan Cully</dc:creator>
    <dc:date>2013-03-07T21:47:35</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.mail.mutt.devel/20541">
    <title>[Mutt] #3639: Handling of inconsistent smime signed messages.</title>
    <link>http://comments.gmane.org/gmane.mail.mutt.devel/20541</link>
    <description>&lt;pre&gt;#3639: Handling of inconsistent smime signed messages.
---------------------------------------------+----------------------
 Reporter:  chris                            |      Owner:  mutt-dev
     Type:  defect                           |     Status:  new
 Priority:  minor                            |  Milestone:  1.6
Component:  crypto                           |    Version:  1.5.21
 Keywords:  patch, smime, s/mime, signature  |
---------------------------------------------+----------------------
 Some email clients generate s/mime multipart/signed emails with
 inconsistent Content-Type headers. The Content-Type of such messages have
 a protocol of "application/x-pkcs7-signature" whereas the Content-type of
 the individual smime.p7s part is listed as "application/pkcs7-signature"
 (without the "x-"). This discrepancy does not affect the validity of the
 signature which can be manually verified with openssl. However, mutt wont
 even attempt verification of the signature because the mismatched Content-
 Type of the message and the smime.p7s part causes an "Inconsistent
 multipart/signed structure!" error before verification can occur.

 This issue is present in both 1.5.21 and tip.

 In this situation, it is more important to determine the validity of the
 email's signature rather than reject it out-of-hand due to an idiosyncrasy
 of the sender's client. I've attached a patch that should do just that
 without sacrificing too much in the way of consistency checking.

&lt;/pre&gt;</description>
    <dc:creator>Mutt</dc:creator>
    <dc:date>2013-03-05T18:54:38</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.mail.mutt.devel/20539">
    <title>[PATCH] Add support for changing X-Label</title>
    <link>http://comments.gmane.org/gmane.mail.mutt.devel/20539</link>
    <description>&lt;pre&gt;# HG changeset patch
# User Jiri Denemark &amp;lt;jirka&amp;lt; at &amp;gt;mamuti.net&amp;gt;
# Date 1362434347 -3600
# Branch HEAD
# Node ID a5f8b3b34a5a1780850c85687d22a1883083aacb
# Parent  4c16c0d1ba9e0d81608a0fbccebd08daa28d76f5
Add support for changing X-Label

Mutt supports ~y pattern which matches X-Label content but does not provide an
easy way to change this header. This adds two new functions called set-label
and clear-label for index and pager for changing X-Label header.

diff --git a/OPS b/OPS
--- a/OPS
+++ b/OPS
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -172,6 +172,8 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 OP_UNDELETE "undelete the current entry"
 OP_UNDELETE_THREAD "undelete all messages in thread"
 OP_UNDELETE_SUBTHREAD "undelete all messages in subthread"
+OP_SET_LABEL "set x-label header"
+OP_CLEAR_LABEL "clear x-label header"
 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 --git a/commands.c b/commands.c
--- a/commands.c
+++ b/commands.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -502,6 +502,25 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
       PipeSep);
 }
 
+void mutt_set_label (HEADER *h, int clear)
+{
+  char buffer[LONG_STRING];
+
+  if (clear)
+    FREE (&amp;amp;h-&amp;gt;env-&amp;gt;x_label);
+  else
+  {
+    buffer[0] = 0;
+    if (mutt_get_field (_("Label message: "), buffer, sizeof (buffer), 0) != 0
+        || !buffer[0])
+      return;
+
+    mutt_str_replace (&amp;amp;h-&amp;gt;env-&amp;gt;x_label, buffer);
+  }
+
+  h-&amp;gt;env-&amp;gt;label_changed = h-&amp;gt;changed = 1;
+}
+
 void mutt_print_message (HEADER *h)
 {
 
diff --git a/copy.c b/copy.c
--- a/copy.c
+++ b/copy.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -98,6 +98,9 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
     (ascii_strncasecmp ("Status:", buf, 7) == 0 ||
      ascii_strncasecmp ("X-Status:", buf, 9) == 0))
   continue;
+if ((flags &amp;amp; CH_UPDATE_LABEL) &amp;amp;&amp;amp;
+    ascii_strncasecmp ("X-Label:", buf, 8) == 0)
+  continue;
 if ((flags &amp;amp; (CH_UPDATE_LEN | CH_XMIT | CH_NOLEN)) &amp;amp;&amp;amp;
     (ascii_strncasecmp ("Content-Length:", buf, 15) == 0 ||
      ascii_strncasecmp ("Lines:", buf, 6) == 0))
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -198,6 +201,9 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
   (ascii_strncasecmp ("Status:", buf, 7) == 0 ||
    ascii_strncasecmp ("X-Status:", buf, 9) == 0))
 continue;
+      if ((flags &amp;amp; CH_UPDATE_LABEL) &amp;amp;&amp;amp;
+          ascii_strncasecmp ("X-Label:", buf, 8) == 0)
+        continue;
       if ((flags &amp;amp; (CH_UPDATE_LEN | CH_XMIT | CH_NOLEN)) &amp;amp;&amp;amp;
   (ascii_strncasecmp ("Content-Length:", buf, 15) == 0 ||
    ascii_strncasecmp ("Lines:", buf, 6) == 0))
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -333,6 +339,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 CH_NOQFROM      ignore "&amp;gt;From " line
 CH_UPDATE_IRTupdate the In-Reply-To: header
 CH_UPDATE_REFSupdate the References: header
+CH_UPDATE_LABEL update the X-Label: header
 
    prefix
    string to use if CH_PREFIX is set
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -345,7 +352,8 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 
   if (h-&amp;gt;env)
     flags |= (h-&amp;gt;env-&amp;gt;irt_changed ? CH_UPDATE_IRT : 0)
-      | (h-&amp;gt;env-&amp;gt;refs_changed ? CH_UPDATE_REFS : 0);
+      | (h-&amp;gt;env-&amp;gt;refs_changed ? CH_UPDATE_REFS : 0)
+      | (h-&amp;gt;env-&amp;gt;label_changed ? CH_UPDATE_LABEL : 0);
   
   if (mutt_copy_hdr (in, out, h-&amp;gt;offset, h-&amp;gt;content-&amp;gt;offset, flags, prefix) == -1)
     return -1;
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -404,6 +412,9 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
     }
   }
 
+  if ((flags &amp;amp; CH_UPDATE_LABEL) &amp;amp;&amp;amp; (h-&amp;gt;env-&amp;gt;x_label))
+    fprintf (out, "X-Label: %s\n", h-&amp;gt;env-&amp;gt;x_label);
+
   if (flags &amp;amp; CH_UPDATE_LEN &amp;amp;&amp;amp;
       (flags &amp;amp; CH_NOLEN) == 0)
   {
diff --git a/copy.h b/copy.h
--- a/copy.h
+++ b/copy.h
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -53,6 +53,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 #define CH_UPDATE_IRT     (1&amp;lt;&amp;lt;16) /* update In-Reply-To: */
 #define CH_UPDATE_REFS    (1&amp;lt;&amp;lt;17) /* update References: */
 #define CH_DISPLAY        (1&amp;lt;&amp;lt;18) /* display result to user */
+#define CH_UPDATE_LABEL   (1&amp;lt;&amp;lt;19) /* update X-Label: */
 
 
 int mutt_copy_hdr (FILE *, FILE *, LOFF_T, LOFF_T, int, const char *);
diff --git a/curs_main.c b/curs_main.c
--- a/curs_main.c
+++ b/curs_main.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -2185,6 +2185,33 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 }
 break;
 
+      case OP_SET_LABEL:
+      case OP_CLEAR_LABEL:
+CHECK_MSGCOUNT;
+CHECK_VISIBLE;
+CHECK_READONLY;
+
+if (op == OP_CLEAR_LABEL)
+{
+  mutt_set_label (CURHDR, 1);
+  mutt_message _("Label cleared");
+}
+else
+{
+  mutt_set_label (CURHDR, 0);
+  mutt_message _("Label changed");
+}
+Context-&amp;gt;changed = 1;
+
+if (menu-&amp;gt;menu == MENU_PAGER)
+{
+  op = OP_DISPLAY_MESSAGE;
+  continue;
+}
+else
+  menu-&amp;gt;redraw |= REDRAW_CURRENT;
+break;
+
       case OP_VERSION:
 mutt_version ();
 break;
diff --git a/functions.h b/functions.h
--- a/functions.h
+++ b/functions.h
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -159,6 +159,8 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
   { "next-unread",OP_MAIN_NEXT_UNREAD,NULL },
   { "previous-unread",OP_MAIN_PREV_UNREAD,NULL },
   { "parent-message",OP_MAIN_PARENT_MESSAGE,"P" },
+  { "set-label",OP_SET_LABEL,NULL },
+  { "clear-label",OP_CLEAR_LABEL,NULL },
 
 
   { "extract-keys",OP_EXTRACT_KEYS,"\013" },
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -259,6 +261,8 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
   { "previous-line",OP_PREV_LINE,NULL },
   { "bottom",OP_PAGER_BOTTOM,NULL },
   { "parent-message",OP_MAIN_PARENT_MESSAGE,"P" },
+  { "set-label",OP_SET_LABEL,NULL },
+  { "clear-label",OP_CLEAR_LABEL,NULL },
 
 
 
diff --git a/mh.c b/mh.c
--- a/mh.c
+++ b/mh.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1613,7 +1613,8 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
   HEADER *h = ctx-&amp;gt;hdrs[msgno];
 
   if (h-&amp;gt;attach_del || 
-      (h-&amp;gt;env &amp;amp;&amp;amp; (h-&amp;gt;env-&amp;gt;refs_changed || h-&amp;gt;env-&amp;gt;irt_changed)))
+      (h-&amp;gt;env &amp;amp;&amp;amp;
+       (h-&amp;gt;env-&amp;gt;refs_changed || h-&amp;gt;env-&amp;gt;irt_changed || h-&amp;gt;env-&amp;gt;label_changed)))
     if (mh_rewrite_message (ctx, msgno) != 0)
       return -1;
 
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1625,7 +1626,8 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
   HEADER *h = ctx-&amp;gt;hdrs[msgno];
 
   if (h-&amp;gt;attach_del || 
-      (h-&amp;gt;env &amp;amp;&amp;amp; (h-&amp;gt;env-&amp;gt;refs_changed || h-&amp;gt;env-&amp;gt;irt_changed)))
+      (h-&amp;gt;env &amp;amp;&amp;amp;
+       (h-&amp;gt;env-&amp;gt;refs_changed || h-&amp;gt;env-&amp;gt;irt_changed || h-&amp;gt;env-&amp;gt;label_changed)))
   {
     /* when doing attachment deletion/rethreading, fall back to the MH case. */
     if (mh_rewrite_message (ctx, msgno) != 0)
diff --git a/mutt.h b/mutt.h
--- a/mutt.h
+++ b/mutt.h
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -595,6 +595,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 
   unsigned int irt_changed : 1; /* In-Reply-To changed to link/break threads */
   unsigned int refs_changed : 1; /* References changed to break thread */
+  unsigned int label_changed : 1; /* X-Label header changed */
 } ENVELOPE;
 
 typedef struct parameter
diff --git a/muttlib.c b/muttlib.c
--- a/muttlib.c
+++ b/muttlib.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -750,7 +750,10 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
   MOVE_ELEM(message_id);
   MOVE_ELEM(supersedes);
   MOVE_ELEM(date);
-  MOVE_ELEM(x_label);
+  if (!base-&amp;gt;label_changed)
+  {
+    MOVE_ELEM(x_label);
+  }
   if (!base-&amp;gt;refs_changed)
   {
     MOVE_ELEM(references);
diff --git a/protos.h b/protos.h
--- a/protos.h
+++ b/protos.h
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -372,6 +372,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 void mutt_set_header_color(CONTEXT *, HEADER *);
 void mutt_sleep (short);
 int mutt_save_confirm (const char  *, struct stat *);
+void mutt_set_label(HEADER *, int);
 
 int mh_valid_message (const char *);
 

&lt;/pre&gt;</description>
    <dc:creator>Jiri Denemark</dc:creator>
    <dc:date>2013-03-04T22:16:32</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.mail.mutt.devel/20538">
    <title>[Mutt] #3638: Compilation errors for 1.6</title>
    <link>http://comments.gmane.org/gmane.mail.mutt.devel/20538</link>
    <description>&lt;pre&gt;#3638: Compilation errors for 1.6
----------------------+----------------------
 Reporter:  grarpamp  |      Owner:  mutt-dev
     Type:  defect    |     Status:  new
 Priority:  major     |  Milestone:  1.6
Component:  mutt      |    Version:  1.5.21
 Keywords:            |
----------------------+----------------------
 FreeBSD 8.3 i386
 mutt 1.5.21 hg (today's daily)

 Here are all the compile errors on the above with hg to look through for
 upcoming 1.6 release...

 imap.c:283: warning: dereferencing type-punned pointer will break strict-
 aliasing rules
 imap.c:1355: warning: dereferencing type-punned pointer will break strict-
 aliasing rules
 message.c:63: warning: unused variable 'buf'
 main.c:75: warning: string length '558' is greater than the length '509'
 ISO C90 compilers are required to support
 ascii.h:35: warning: 'ascii_tolower' declared inline after being called
 ascii.h:35: warning: previous declaration of 'ascii_tolower' was here
 pop_lib.c:67: warning: implicit declaration of function 'ntohs'
 lib.c:569: warning: warning: mktemp() possibly used unsafely; consider
 using mkstemp()

 byteorder(3) says ntohs is in either:
  #include &amp;lt;arpa/inet.h&amp;gt;
  #include &amp;lt;netinet/in.h&amp;gt;

 mkstemp(3) actually creates the file returning fd, thus securing against
 races.
 I'd consider having configure test for it and implementing it in
 muttlib.c.

 I also get this difference when using LDFLAGS=-static ...

 &amp;lt; checking for idna_to_unicode_8z8z... yes
 &amp;gt; checking for idna_to_unicode_8z8z... no
 &amp;lt; checking for idna_to_ascii_8z... yes
 &amp;lt; checking for idna_to_ascii_lz... yes
 &amp;gt; checking for idna_to_ascii_8z... no
 &amp;gt; checking for idna_to_ascii_lz... no

 I can pull and retest as needed. Thanks.

&lt;/pre&gt;</description>
    <dc:creator>Mutt</dc:creator>
    <dc:date>2013-03-03T21:10:49</dc:date>
  </item>
  <textinput rdf:about="http://search.gmane.org/?group=$group=gmane.mail.mutt.devel">
    <title>Search Engine</title>
    <description>Search the mailing list at Gmane</description>
    <name>query</name>
    <link>http://search.gmane.org/?group=$group=gmane.mail.mutt.devel</link>
  </textinput>
</rdf:RDF>
