+++ /dev/null
-More random file creation in /tmp to prevent DOS, see CVE CAN-2005-2351 and
-upstream http://bugs.mutt.org/3158
-
---- a/muttlib.c
-+++ b/muttlib.c
-@@ -748,7 +748,12 @@
-
- void _mutt_mktemp (char *s, const char *src, int line)
- {
-- snprintf (s, _POSIX_PATH_MAX, "%s/mutt-%s-%d-%d-%d", NONULL (Tempdir), NONULL(Hostname), (int) getuid(), (int) getpid (), Counter++);
-+ long sek;
-+
-+ time(&sek);
-+ srand(sek);
-+ snprintf (s, _POSIX_PATH_MAX, "%s/mutt-%s-%d-%d-%d%x%x", NONULL (Tempdir), NONULL(Hostname), (int) getuid(), (int) getpid (),
-+ Counter++, (unsigned int) rand(), (unsigned int) rand());
- dprint (3, (debugfile, "%s:%d: mutt_mktemp returns \"%s\".\n", src, line, s));
- unlink (s);
- }
+++ /dev/null
-For %F, display Bcc recipient if no other recipients found.
-Closes http://bugs.mutt.org/3157
-See also http://bugs.debian.org/350957
-
---- a/hdrline.c
-+++ b/hdrline.c
-@@ -121,6 +121,8 @@
- snprintf (buf, len, "To %s", mutt_get_name (hdr->to));
- else if (me && hdr->cc)
- snprintf (buf, len, "Cc %s", mutt_get_name (hdr->cc));
-+ else if (me && hdr->bcc)
-+ snprintf (buf, len, "Bcc %s", mutt_get_name (hdr->bcc));
- else if (hdr->from)
- strfcpy (buf, mutt_get_name (hdr->from), len);
- else
+++ /dev/null
-Actually reopen mbox/mmdf files in case we find modifications. Closes
-http://bugs.mutt.org/2725.
-
-Since the file is changed while we have it open in ctx->fp, we likely
-get wrong information when parsing the mailbox. Now we explicitely close
-and (re)open it.
-
-See http://bugs.debian.org/375530 for more info
-
---- a/mbox.c
-+++ b/mbox.c
-@@ -1119,17 +1119,13 @@
- {
- case M_MBOX:
- case M_MMDF:
-- if (fseek (ctx->fp, 0, SEEK_SET) != 0)
-- {
-- dprint (1, (debugfile, "mutt_reopen_mailbox: fseek() failed\n"));
-+ cmp_headers = mbox_strict_cmp_headers;
-+ safe_fclose (&ctx->fp);
-+ if (!(ctx->fp = safe_fopen (ctx->path, "r")))
- rc = -1;
-- }
-- else
-- {
-- cmp_headers = mbox_strict_cmp_headers;
-+ else
- rc = ((ctx->magic == M_MBOX) ? mbox_parse_mailbox
-- : mmdf_parse_mailbox) (ctx);
-- }
-+ : mmdf_parse_mailbox) (ctx);
- break;
-
- default:
+++ /dev/null
-Display text/x-diff with the internal viewer, see upstream bug
-http://bugs.mutt.org/3246
-
---- a/muttlib.c
-+++ b/muttlib.c
-@@ -622,11 +622,11 @@
- switch (m->type)
- {
- case TYPETEXT:
--
- if (!ascii_strcasecmp ("plain", m->subtype) ||
-- !ascii_strcasecmp ("rfc822-headers", m->subtype) ||
-- !ascii_strcasecmp ("enriched", m->subtype))
-- return 0;
-+ !ascii_strcasecmp ("rfc822-headers", m->subtype) ||
-+ !ascii_strcasecmp ("enriched", m->subtype) ||
-+ !ascii_strcasecmp ("x-diff", m->subtype))
-+ return 0;
- break;
-
- case TYPEAPPLICATION:
+++ /dev/null
-IMAP: only close socket when not already disconnected.
-closes http://bugs.mutt.org/3161 and
-http://bugs.debian.org/493719
-
---- a/imap/imap.c
-+++ b/imap/imap.c
-@@ -488,8 +488,11 @@
-
- void imap_close_connection(IMAP_DATA* idata)
- {
-- mutt_socket_close (idata->conn);
-- idata->state = IMAP_DISCONNECTED;
-+ if (idata->state != IMAP_DISCONNECTED)
-+ {
-+ mutt_socket_close (idata->conn);
-+ idata->state = IMAP_DISCONNECTED;
-+ }
- idata->seqno = idata->nextcmd = idata->lastcmd = idata->status = 0;
- memset (idata->cmds, 0, sizeof (IMAP_COMMAND) * idata->cmdslots);
- }
+++ /dev/null
-message cache partially invalid after network problem
-fixed by http://dev.mutt.org/trac/ticket/3163
-changeset http://dev.mutt.org/trac/changeset/da94a92c3ba0
-resolves http://bugs.debian.org/500016
-
---- mutt-1.5.19/bcache.c 2009-01-05 19:20:53.000000000 +0000
-+++ mutt-7ddf1d1cc490/bcache.c 2009-01-27 20:58:15.000000000 +0000
-@@ -136,6 +136,13 @@
- snprintf (path, sizeof (path), "%s%s%s", bcache->path, id,
- tmp ? ".tmp" : "");
-
-+ if ((fp = safe_fopen (path, "w+")))
-+ goto out;
-+
-+ if (errno == EEXIST)
-+ /* clean up leftover tmp file */
-+ mutt_unlink (path);
-+
- s = strchr (path + 1, '/');
- while (!(fp = safe_fopen (path, "w+")) && errno == ENOENT && s)
- {
-@@ -147,6 +154,7 @@
- s = strchr (s + 1, '/');
- }
-
-+ out:
- dprint (3, (debugfile, "bcache: put: '%s'\n", path));
-
- return fp;
+++ /dev/null
-clarify what attach_charset does, see http://bugs.mutt.org/3165
-and http://bugs.debian.org/502628
-
---- a/init.h
-+++ b/init.h
-@@ -197,7 +197,10 @@
- /*
- ** .pp
- ** This variable is a colon-separated list of character encoding
-- ** schemes for text file attachments.
-+ ** schemes for text file attachments. Mutt uses this setting to guess
-+ ** which encoding files being attached are encoded in to convert them to
-+ ** a proper character set given in $$send_charset.
-+ ** .pp
- ** If \fIunset\fP, the value of $$charset will be used instead.
- ** For example, the following configuration would work for Japanese
- ** text handling:
+++ /dev/null
-Mention account-hook in the docs for $tunnel, see http://bugs.mutt.org/3237
-and http://bugs.debian.org/504530
-
---- a/init.h
-+++ b/init.h
-@@ -2410,6 +2410,10 @@
- ** .pp
- ** Note: For this example to work, you must be able to log in to the
- ** remote machine without having to enter a password.
-+ ** .pp
-+ ** When set, Mutt uses the tunnel for all remote connections.
-+ ** Please see ``$account-hook'' in the manual for how to use different
-+ ** tunnel commands per connection.
- */
- #endif /* USE_SOCKET */
- { "print", DT_QUAD, R_NONE, OPT_PRINT, M_ASKNO },
+++ /dev/null
-fixed by http://dev.mutt.org/trac/ticket/3163
-changeset http://dev.mutt.org/trac/changeset/eb918af802ec
-resolves http://bugs.debian.org/508988
-
-This commit introduces an unconditional inode-sort to fix the slowness with big
-maildirs
-
---- mutt-1.5.19/mh.c 2009-01-05 19:20:53.000000000 +0000
-+++ mutt-7ddf1d1cc490/mh.c 2009-01-27 20:58:15.000000000 +0000
-@@ -1,5 +1,5 @@
- /*
-- * Copyright (C) 1996-2002,2007 Michael R. Elkins <me@mutt.org>
-+ * Copyright (C) 1996-2002,2007,2009 Michael R. Elkins <me@mutt.org>
- * Copyright (C) 1999-2005 Thomas Roessler <roessler@does-not-exist.org>
- *
- * This program is free software; you can redistribute it and/or modify
-@@ -1027,13 +1027,14 @@
- if (!ctx->quiet && progress)
- mutt_progress_update (progress, count, -1);
-
-+ DO_SORT();
-+
- snprintf (fn, sizeof (fn), "%s/%s", ctx->path, p->h->path);
-
- #if USE_HCACHE
- if (option(OPTHCACHEVERIFY))
- {
-- DO_SORT();
-- ret = stat(fn, &lastchanged);
-+ ret = stat(fn, &lastchanged);
- }
- else
- {
-@@ -1057,7 +1058,6 @@
- {
- #endif /* USE_HCACHE */
-
-- DO_SORT();
- if (maildir_parse_message (ctx->magic, fn, p->h->old, p->h))
- {
- p->header_parsed = 1;
+++ /dev/null
-The new version of gnutls introduced this new option which mutt did not
-know about, if the cert is signed with an insecure algorithm (md5) it will
-set a particular bit; if the cert is in the cache of the user we will
-unset all bits so this has to be unset as well
-See http://bugs.mutt.org/3229 and http://bugs.debian.org/514960
-
---- a/mutt_ssl_gnutls.c
-+++ b/mutt_ssl_gnutls.c
-@@ -614,6 +614,13 @@
- in our cache. */
- certstat ^= GNUTLS_CERT_SIGNER_NOT_CA;
- }
-+
-+ if (certstat & GNUTLS_CERT_INSECURE_ALGORITHM)
-+ {
-+ /* if the certificate is in the cache the user is happy with
-+ using an insecure algorithm */
-+ certstat ^= GNUTLS_CERT_INSECURE_ALGORITHM;
-+ }
- }
-
- if (certstat & GNUTLS_CERT_REVOKED)
+++ /dev/null
-Mutt crashes when connection that used SASL is closed
-and reopened again (e.g. network problem)
-see http://bugs.debian.org/524420 and http://bugs.mutt.org/3206
-
---- a/mutt_sasl.c
-+++ b/mutt_sasl.c
-@@ -481,6 +481,7 @@
- conn->conn_close = sasldata->msasl_close;
- conn->conn_read = sasldata->msasl_read;
- conn->conn_write = sasldata->msasl_write;
-+ conn->conn_poll = sasldata->msasl_poll;
-
- /* release sasl resources */
- sasl_dispose (&sasldata->saslconn);
+++ /dev/null
-This patch is taken up from upstream http://bugs.mutt.org/3235
-The new way getopt is called broke the possibility to use
-"mutt -a attachfile recipient"
-now -- is mandatory to separate file and recipient, even if only
-a single file is attached, this patch fixes the documentation
-to make -- mandatory
-
---- a/doc/mutt.man
-+++ b/doc/mutt.man
-@@ -82,8 +82,10 @@
- An expanded version of the given alias is passed to stdout.
- .IP "-a \fIfile\fP [...]"
- Attach a file to your message using MIME.
--To attach multiple files, separating filenames and recipient addresses with
--"\-\-" is mandatory, e.g. \fBmutt \-a img.jpg *.png \-\- addr1 addr2\fP.
-+When attaching single or multiple files, separating filenames and recipient addresses with
-+"\-\-" is mandatory, e.g. \fBmutt \-a image.jpg \-\- addr1\fP or
-+\fBmutt \-a img.jpg *.png \-\- addr1 addr2\fP.
-+The \-a option must be placed at the end of command line options.
- .IP "-b \fIaddress\fP"
- Specify a blind-carbon-copy (BCC) recipient
- .IP "-c \fIaddress\fP"
---- a/doc/manual.xml.head
-+++ b/doc/manual.xml.head
-@@ -6995,9 +6995,6 @@
- <arg choice="opt"><option>-F</option>
- <replaceable>muttrc</replaceable>
- </arg>
--<arg choice="opt"><option>-a</option>
--<replaceable>file</replaceable>
--</arg>
- <arg choice="opt"><option>-c</option>
- <replaceable>address</replaceable>
- </arg>
-@@ -7008,15 +7005,12 @@
- <replaceable>subject</replaceable>
- </arg>
- <arg choice="opt">
--<arg choice="opt" rep="repeat">
-+<option>-a</option>
- <replaceable>file</replaceable>
-+<arg choice="opt" rep="repeat"/>
-+--
- </arg>
--<arg choice="plain">--</arg>
--</arg>
--<arg choice="plain">
--<replaceable>address</replaceable>
--</arg>
--<arg choice="opt" rep="repeat">
-+<arg choice="plain" rep="repeat">
- <replaceable>address</replaceable>
- </arg>
- </cmdsynopsis>
+++ /dev/null
-This patch fixes the following two bugs:
-*) http://bugs.debian.org/530887
- mutt: fails to move read messages even with move=yes
-
-*) http://bugs.debian.org/530671
- mutt: does not want to open dot subdirs via imap anymore
-
-the second one happens with dovecot which uses / as a delimeter for mailbox,
-so without this patch is not possible to access subdirs on imap accounts
-hosted on dovecot
-
---- a/imap/util.c
-+++ b/imap/util.c
-@@ -393,19 +393,19 @@
- size_t plen)
- {
- int i = 0;
-- char delim;
-+ char delim = '\0';
-
- if (idata)
- delim = idata->delim;
-- else if (ImapDelimChars && ImapDelimChars[0])
-- delim = ImapDelimChars[0];
-- else
-- delim = '/';
-
- while (mailbox && *mailbox && i < plen - 1)
- {
-- if (strchr(ImapDelimChars, *mailbox) || *mailbox == delim)
-+ if ((ImapDelimChars && strchr(ImapDelimChars, *mailbox))
-+ || *mailbox == delim)
- {
-+ /* use connection delimiter if known. Otherwise use user delimiter */
-+ if (!idata)
-+ delim = *mailbox;
- while (*mailbox &&
- (strchr(ImapDelimChars, *mailbox) || *mailbox == delim))
- mailbox++;
+++ /dev/null
-mutt is calling mutt_perror twice, so the error messages are
-sometimes confused, see upstream #3268
-
---- a/mx.c
-+++ b/mx.c
-@@ -415,7 +415,6 @@
- {
- dprint (1, (debugfile, "mx_get_magic(): unable to open file %s for reading.\n",
- path));
-- mutt_perror (path);
- return (-1);
- }
-
+++ /dev/null
-inline pgp messages were displayed incorrectly when pgp_auto_decode=yes, see
-upstream http://bugs.mutt.org/3269
-
---- a/crypt-gpgme.c
-+++ b/crypt-gpgme.c
-@@ -2371,16 +2371,14 @@
- safe_fclose (&pgpout);
- }
- }
--#if 0
- else
- {
-- /* why would we want to display this at all? */
-+ /* A traditional PGP part may mix signed and unsigned content */
- /* XXX - we may wish to recode here */
- if (s->prefix)
- state_puts (s->prefix, s);
- state_puts (buf, s);
- }
--#endif
- }
-
- m->goodsig = (maybe_goodsig && have_any_sigs);
---- a/pgp.c
-+++ b/pgp.c
-@@ -482,7 +482,6 @@
- state_attach_puts (_("[-- END PGP SIGNED MESSAGE --]\n"), s);
- }
- }
--#if 0
- else
- {
- /* why would we want to display this at all? */
-@@ -491,7 +490,6 @@
- state_puts (s->prefix, s);
- state_puts (buf, s);
- }
--#endif
- }
-
- rc = 0;
+++ /dev/null
-upstream test patch to fix the atime issue
-(See #533439 and upstream #3271, #1372)
-
---- a/mbox.c
-+++ b/mbox.c
-@@ -685,22 +685,30 @@
-
- /* if mailbox has at least 1 new message, sets mtime > atime of mailbox
- * so buffy check reports new mail */
--static void reset_atime (CONTEXT *ctx)
-+void mbox_reset_atime (CONTEXT *ctx, struct stat *st)
- {
- struct utimbuf utimebuf;
-- int i;
-- time_t now = time (NULL);
-+ int i, found = 0;
-+ struct stat _st;
-
-- for (i = 0; i < ctx->msgcount; i++)
-+ if (!st)
- {
-- if (!ctx->hdrs[i]->deleted && !ctx->hdrs[i]->read && !ctx->hdrs[i]->old)
-- {
-- utimebuf.actime = now - 1;
-- utimebuf.modtime = now;
-- utime (ctx->path, &utimebuf);
-+ if (stat (ctx->path, &_st) < 0)
- return;
-- }
-+ st = &_st;
- }
-+
-+ utimebuf.actime = st->st_atime;
-+ utimebuf.modtime = st->st_mtime;
-+
-+ for (i = 0; !found && i < ctx->msgcount; i++)
-+ if (!ctx->hdrs[i]->deleted && !ctx->hdrs[i]->read && !ctx->hdrs[i]->old)
-+ found = 1;
-+
-+ if (found && utimebuf.actime >= utimebuf.modtime)
-+ utimebuf.actime = utimebuf.modtime - 1;
-+
-+ utime (ctx->path, &utimebuf);
- }
-
- /* return values:
-@@ -716,6 +724,7 @@
- int need_sort = 0; /* flag to resort mailbox if new mail arrives */
- int first = -1; /* first message to be written */
- LOFF_T offset; /* location in mailbox to write changed messages */
-+ struct stat statbuf;
- struct m_update_t *newOffset = NULL;
- struct m_update_t *oldOffset = NULL;
- FILE *fp = NULL;
-@@ -907,6 +916,15 @@
- }
- fp = NULL;
-
-+ /* Save the state of this folder. */
-+ if (stat (ctx->path, &statbuf) == -1)
-+ {
-+ mutt_perror (ctx->path);
-+ mutt_sleep (5);
-+ unlink (tempfile);
-+ goto bail;
-+ }
-+
- if ((fp = fopen (tempfile, "r")) == NULL)
- {
- mutt_unblock_signals ();
-@@ -976,6 +994,9 @@
- return (-1);
- }
-
-+ /* Restore the previous access/modification times */
-+ mbox_reset_atime (ctx, &statbuf);
-+
- /* reopen the mailbox in read-only mode */
- if ((ctx->fp = fopen (ctx->path, "r")) == NULL)
- {
-@@ -1002,11 +1023,6 @@
- unlink (tempfile); /* remove partial copy of the mailbox */
- mutt_unblock_signals ();
-
-- /* if mailbox has new mail, mangle atime+mtime to make buffy check
-- * report new mail for it */
-- if (!option (OPTCHECKMBOXSIZE))
-- reset_atime (ctx);
--
- return (0); /* signal success */
-
- bail: /* Come here in case of disaster */
---- a/mx.c
-+++ b/mx.c
-@@ -1005,6 +1005,8 @@
- {
- if (!ctx->quiet)
- mutt_message _("Mailbox is unchanged.");
-+ if (ctx->magic == M_MBOX || ctx->magic == M_MMDF)
-+ mbox_reset_atime (ctx, NULL);
- mx_fastclose_mailbox (ctx);
- return 0;
- }
---- a/mx.h
-+++ b/mx.h
-@@ -59,6 +59,7 @@
- int mmdf_parse_mailbox (CONTEXT *);
- void mbox_unlock_mailbox (CONTEXT *);
- int mbox_check_empty (const char *);
-+void mbox_reset_atime (CONTEXT *, struct stat *);
-
- int mh_read_dir (CONTEXT *, const char *);
- int mh_sync_mailbox (CONTEXT *, int *);
+++ /dev/null
-mutt segfaults everytime the 'unmailboxes' command is used
-(see upstream #3273)
-
---- a/buffy.c
-+++ b/buffy.c
-@@ -236,7 +236,6 @@
- {
- if(*tmp)
- {
-- FREE (&((*tmp)->path));
- tmp1=(*tmp)->next;
- FREE (tmp); /* __FREE_CHECKED__ */
- *tmp=tmp1;
+++ /dev/null
-before this patch mutt failed to highlight some signatures if text_flowed was
-set to yes (see upstream http://bugs.mutt.org/3275)
-
---- a/handler.c
-+++ b/handler.c
-@@ -1500,7 +1500,7 @@
- l = mutt_strlen (buf);
- if (l > 0 && buf[l-1] == '\n')
- buf[--l] = 0;
-- if (option (OPTTEXTFLOWED))
-+ if (mutt_strcmp (buf, "-- ") != 0 && option (OPTTEXTFLOWED))
- {
- while (l > 0 && buf[l-1] == ' ')
- buf[--l] = 0;
+++ /dev/null
-a bug in 1.5.20 upstream prevented mutt from correctly parsing the port
-in an IMAP url (imap[s]://...:<port>), this was fixed by upstream bug
-3264 and backported to the Debian package in 534543
-
-Index: mutt/url.c
-===================================================================
---- mutt.orig/url.c 2009-06-25 12:37:59.000000000 +0200
-+++ mutt/url.c 2009-06-25 12:39:05.000000000 +0200
-@@ -143,9 +143,11 @@
-
- if ((p = strchr (t, ':')))
- {
-+ int t;
- *p++ = '\0';
-- if (mutt_atos (p, (short*) &ciss->port) < 0)
-+ if (mutt_atoi (p, &t) < 0 || t < 0 || t > 0xffff)
- return NULL;
-+ ciss->port = (unsigned short)t;
- }
- else
- ciss->port = 0;
+++ /dev/null
-This patch will allow the user to specify a port, as it was before 1.5.20, see
-upstream bug http://bugs.mutt.org/3322
-
---- a/pop_lib.c
-+++ b/pop_lib.c
-@@ -43,6 +43,7 @@
- /* Defaults */
- acct->flags = 0;
- acct->type = M_ACCT_TYPE_POP;
-+ acct->port = 0;
-
- c = safe_strdup (path);
- url_parse_ciss (&url, c);
-@@ -60,10 +61,12 @@
- acct->flags |= M_ACCT_SSL;
-
- service = getservbyname (url.scheme == U_POP ? "pop3" : "pop3s", "tcp");
-- if (service)
-- acct->port = ntohs (service->s_port);
-- else
-- acct->port = url.scheme == U_POP ? POP_PORT : POP_SSL_PORT;;
-+ if (!acct->port) {
-+ if (service)
-+ acct->port = ntohs (service->s_port);
-+ else
-+ acct->port = url.scheme == U_POP ? POP_PORT : POP_SSL_PORT;;
-+ }
-
- FREE (&c);
- return 0;
+++ /dev/null
-this fixes a problem with new mail detection on MH folder, for a
-more detailed history see mutt bugs #3308 and #3312 and debian
-bug 538128
-
---- a/mh.c
-+++ b/mh.c
-@@ -146,7 +146,7 @@
- if ((p = strchr (t, '-')))
- {
- *p++ = '\0';
-- if (mutt_atoi (t, first) < 0 || mutt_atoi (t, last) < 0)
-+ if (mutt_atoi (t, first) < 0 || mutt_atoi (p, last) < 0)
- return -1;
- }
- else
-@@ -167,7 +167,7 @@
- size_t sz = 0;
-
- short f;
-- int first, last, rc;
-+ int first, last, rc = 0;
-
- char pathname[_POSIX_PATH_MAX];
- snprintf (pathname, sizeof (pathname), "%s/.mh_sequences", path);
-@@ -207,7 +207,7 @@
- out:
- FREE (&buff);
- safe_fclose (&fp);
-- return 0;
-+ return rc;
- }
-
- static inline mode_t mh_umask (CONTEXT* ctx)
-@@ -238,6 +238,7 @@
- for (i = 0; !r && i <= mhs.max; i++)
- if (mhs_check (&mhs, i) & MH_SEQ_UNSEEN)
- r = 1;
-+ mhs_free_sequences (&mhs);
- return r;
- }
-
-@@ -1155,7 +1156,7 @@
-
- if (ctx->magic == M_MH)
- {
-- if (mh_read_sequences (&mhs, ctx->path) >= 0)
-+ if (mh_read_sequences (&mhs, ctx->path) < 0)
- return -1;
- mh_update_maildir (md, &mhs);
- mhs_free_sequences (&mhs);
+++ /dev/null
-changeset: 5945:5f590adfdf1a
-branch: HEAD
-user: Rocco Rutte <pdmef@gmx.net>
-date: Thu Jun 25 17:31:27 2009 +0200
-summary: header folding: treat From_ specially, never wrap on sending side
-
---- a/sendlib.c
-+++ b/sendlib.c
-@@ -1630,9 +1630,9 @@ static int fold_one_header (FILE *fp, co
- dprint(4,(debugfile,"mwoh: pfx=[%s], tag=[%s], flags=%d value=[%s]\n",
- pfx, tag, flags, value));
-
-- if (fprintf (fp, "%s%s: ", NONULL (pfx), tag) < 0)
-+ if (tag && *tag && fprintf (fp, "%s%s: ", NONULL (pfx), tag) < 0)
- return -1;
-- col = mutt_strlen (tag) + 2 + mutt_strlen (pfx);
-+ col = mutt_strlen (tag) + (tag && *tag ? 2 : 0) + mutt_strlen (pfx);
-
- while (p && *p)
- {
-@@ -1717,9 +1717,12 @@ static int write_one_header (FILE *fp, i
- int flags)
- {
- char *tagbuf, *valbuf, *t;
-+ int is_from = ((end - start) > 5 &&
-+ ascii_strncasecmp (start, "from ", 5) == 0);
-
-- /* only pass through folding machinery if necessary for sending */
-- if (!(flags & CH_DISPLAY) && pfxw + max <= wraplen)
-+ /* only pass through folding machinery if necessary for sending,
-+ never wrap From_ headers on sending */
-+ if (!(flags & CH_DISPLAY) && (pfxw + max <= wraplen || is_from))
- {
- valbuf = mutt_substrdup (start, end);
- dprint(4,(debugfile,"mwoh: buf[%s%s] short enough, "
-@@ -1738,8 +1741,16 @@ static int write_one_header (FILE *fp, i
- else
- {
- t = strchr (start, ':');
-- tagbuf = mutt_substrdup (start, t);
-- valbuf = mutt_substrdup (t + 2, end);
-+ if (is_from)
-+ {
-+ tagbuf = NULL;
-+ valbuf = mutt_substrdup (start, end);
-+ }
-+ else
-+ {
-+ tagbuf = mutt_substrdup (start, t);
-+ valbuf = mutt_substrdup (t + 2, end);
-+ }
- dprint(4,(debugfile,"mwoh: buf[%s%s] too long, "
- "max width = %d > %dn",
- NONULL(pfx), valbuf, max, wraplen));
+++ /dev/null
-Fixes a segfault that happened when searching "~b something =", see upstream
-bugs http://bugs.mutt.org/3314 and http://bugs.mutt.org/3315
-
---- a/pattern.c
-+++ b/pattern.c
-@@ -822,7 +822,13 @@
- case '%':
- case '=':
- case '~':
-- if (*(ps.dptr + 1) == '(')
-+ if (!*(ps.dptr + 1))
-+ {
-+ snprintf (err->data, err->dsize, _("missing pattern: %s"), ps.dptr);
-+ mutt_pattern_free (&curlist);
-+ return NULL;
-+ }
-+ if (*(ps.dptr + 1) == '(')
- {
- ps.dptr ++; /* skip ~ */
- p = find_matching_paren (ps.dptr + 1);
+++ /dev/null
-patch to fix a problem in the Italian translation, it was submitted to upstream
-on bugs http://bugs.mutt.org/3336
-
---- a/po/it.po
-+++ b/po/it.po
-@@ -3233,7 +3233,7 @@
-
- #: muttlib.c:938
- msgid "yna"
--msgstr "yna"
-+msgstr "snt"
-
- #: muttlib.c:954
- msgid "File is a directory, save under it?"
+++ /dev/null
-Without this patch mutt fails to send messages and ask for a password even if
-smtp_user and smtp_pass are defined in .muttrc, see upstream bug
-http://bugs.mutt.org/3289
-
---- a/account.c
-+++ b/account.c
-@@ -155,6 +155,8 @@
- else if ((account->type == M_ACCT_TYPE_POP) && PopUser)
- strfcpy (account->user, PopUser, sizeof (account->user));
- #endif
-+ else if (option (OPTNOCURSES))
-+ return -1;
- /* prompt (defaults to unix username), copy into account->user */
- else
- {
-@@ -215,6 +217,8 @@
- else if ((account->type == M_ACCT_TYPE_SMTP) && SmtpPass)
- strfcpy (account->pass, SmtpPass, sizeof (account->pass));
- #endif
-+ else if (option (OPTNOCURSES))
-+ return -1;
- else
- {
- snprintf (prompt, sizeof (prompt), _("Password for %s@%s: "),
---- a/mutt_sasl.c
-+++ b/mutt_sasl.c
-@@ -304,7 +304,7 @@
-
- snprintf (prompt, sizeof (prompt), "%s: ", interaction->prompt);
- resp[0] = '\0';
-- if (mutt_get_field (prompt, resp, sizeof (resp), 0))
-+ if (option (OPTNOCURSES) || mutt_get_field (prompt, resp, sizeof (resp), 0))
- return SASL_FAIL;
-
- interaction->len = mutt_strlen (resp)+1;
---- a/smtp.c
-+++ b/smtp.c
-@@ -172,7 +172,7 @@
- progress_t progress;
- struct stat st;
- int r, term = 0;
-- size_t buflen;
-+ size_t buflen = 0;
-
- fp = fopen (msgfile, "r");
- if (!fp)
-@@ -454,12 +454,6 @@
- }
-
- #ifdef USE_SASL
-- if (!(conn->account.flags & M_ACCT_PASS) && option (OPTNOCURSES))
-- {
-- mutt_error (_("Interactive SMTP authentication not supported"));
-- mutt_sleep (1);
-- return -1;
-- }
- return smtp_auth (conn);
- #else
- mutt_error (_("SMTP authentication requires SASL"));
-@@ -603,7 +597,7 @@
- }
- }
- strfcpy (buf + len, "\r\n", sizeof (buf) - len);
-- } while (rc == smtp_ready);
-+ } while (rc == smtp_ready && saslrc != SASL_FAIL);
-
- if (smtp_success (rc))
- {
+++ /dev/null
-Do not store the header color into hcache, see http://bugs.mutt.org/3376 and
-http://dev.mutt.org/trac/changeset/b7d2cb7c7ce1 for more info
-
---- a/hcache.c
-+++ b/hcache.c
-@@ -623,6 +623,7 @@
- nh.limited = 0;
- nh.num_hidden = 0;
- nh.recipient = 0;
-+ nh.pair = 0;
- nh.attach_valid = 0;
- nh.path = NULL;
- nh.tree = NULL;
+++ /dev/null
-Minor typos in manual.txt, see upstream http://bugs.mutt.org/3379
-
---- a/doc/manual.xml.head
-+++ b/doc/manual.xml.head
-@@ -1511,7 +1511,7 @@
-
- <para>
- After editing the initial message text and before entering
--the compose menu, Mutt properly space-stuffes the message.
-+the compose menu, Mutt properly space-stuffs the message.
- <emphasis>Space-stuffing</emphasis> is required by RfC3676 defining
- <literal>format=flowed</literal> and means to prepend a space to:
- </para>
-@@ -2507,7 +2507,7 @@
-
- <itemizedlist>
- <listitem><para>attachment</para></listitem>
--<listitem><para>bold (hiliting bold patterns in the body of messages)</para></listitem>
-+<listitem><para>bold (highlighting bold patterns in the body of messages)</para></listitem>
- <listitem><para>error (error messages printed by Mutt)</para></listitem>
- <listitem><para>hdrdefault (default color of the message header in the pager)</para></listitem>
- <listitem><para>indicator (arrow or bar used to indicate the current item in a menu)</para></listitem>
-@@ -2516,11 +2516,11 @@
- <listitem><para>normal</para></listitem>
- <listitem><para>quoted (text matching <link linkend="quote-regexp">$quote_regexp</link> in the body of a message)</para></listitem>
- <listitem><para>quoted1, quoted2, ..., quoted<emphasis>N</emphasis> (higher levels of quoting)</para></listitem>
--<listitem><para>search (hiliting of words in the pager)</para></listitem>
-+<listitem><para>search (highlighting of words in the pager)</para></listitem>
- <listitem><para>signature</para></listitem><listitem><para>status (mode lines used to display info about the mailbox or message)</para></listitem>
- <listitem><para>tilde (the <quote>˜</quote> used to pad blank lines in the pager)</para></listitem>
- <listitem><para>tree (thread tree drawn in the message index and attachment menu)</para></listitem>
--<listitem><para>underline (hiliting underlined patterns in the body of messages)</para></listitem>
-+<listitem><para>underline (highlighting underlined patterns in the body of messages)</para></listitem>
- </itemizedlist>
-
- <para>
-@@ -3095,7 +3095,7 @@
- the command is executed, so if these names contain <link linkend="shortcuts">shortcut characters</link> (such as <quote>=</quote> and <quote>!</quote>), any variable
- definition that affects these characters (like <link linkend="folder">$folder</link> and <link linkend="spoolfile">$spoolfile</link>)
- should be set before the <command>mailboxes</command> command. If
--none of these shorcuts are used, a local path should be absolute as
-+none of these shortcuts are used, a local path should be absolute as
- otherwise Mutt tries to find it relative to the directory
- from where Mutt was started which may not always be desired.
- </para>
-@@ -5841,7 +5841,7 @@
- If the <emphasis>command</emphasis> is empty, this operation is
- disabled for this file type. In this case, the folder will be open and
- closed again (using <link linkend="open-hook">open-hook</link> and
--<link linkend="close-hook">close-hook</link>respectively) each time you
-+<link linkend="close-hook">close-hook</link> respectively) each time you
- will add to it.
- </para>
- </sect2>
-@@ -6811,7 +6811,7 @@
- ## line is unnecessary if you already have "attach-allow */.*", of
- ## course. These are off by default! The MIME elements contained
- ## within a message/* or multipart/* are still examined, even if the
--## containers themseves don't qualify.
-+## containers themselves don't qualify.
- ##
- #attachments +A message/.* multipart/.*
- #attachments +I message/.* multipart/.*
-@@ -7465,7 +7465,7 @@
- the current chain position, use <literal><select-entry></literal> or <literal><append></literal>.
- You can also delete entries from the chain, using the corresponding
- function. Finally, to abandon your changes, leave the menu, or
--<literal><accept></literal> them pressing (by default) the <literal>Return</literal> key.
-+<literal><accept></literal> them, pressing (by default) the <literal>Return</literal> key.
- </para>
-
- <para>
---- a/doc/Muttrc
-+++ b/doc/Muttrc
-@@ -1991,7 +1991,7 @@
- #
- #
- # The default mailbox type used when creating new folders. May be any of
--# ``mbox'', ``MMDF'', ``MH'' and ``Maildir''. This is overriden by the
-+# ``mbox'', ``MMDF'', ``MH'' and ``Maildir''. This is overridden by the
- # -m command-line option.
- #
- #
---- a/doc/manual.txt
-+++ b/doc/manual.txt
-@@ -7405,7 +7405,7 @@
- Default: mbox
-
- The default mailbox type used when creating new folders. May be any of ?mbox?,
--?MMDF?, ?MH? and ?Maildir?. This is overriden by the -m command-line option.
-+?MMDF?, ?MH? and ?Maildir?. This is overridden by the -m command-line option.
-
- 3.128. menu_context
-
---- a/edit.c
-+++ b/edit.c
-@@ -39,7 +39,7 @@
- * declared "static" (sigh)
- */
- static char* EditorHelp1 = N_("\
--~~ insert a line begining with a single ~\n\
-+~~ insert a line beginning with a single ~\n\
- ~b users add users to the Bcc: field\n\
- ~c users add users to the Cc: field\n\
- ~f messages include messages\n\
---- a/recvattach.c
-+++ b/recvattach.c
-@@ -698,7 +698,7 @@
- {
- if (!mutt_can_decode (top))
- {
-- mutt_error (_("I dont know how to print %s attachments!"), type);
-+ mutt_error (_("I don't know how to print %s attachments!"), type);
- return (0);
- }
- }
---- a/init.h
-+++ b/init.h
-@@ -1413,7 +1413,7 @@
- /*
- ** .pp
- ** The default mailbox type used when creating new folders. May be any of
-- ** ``mbox'', ``MMDF'', ``MH'' and ``Maildir''. This is overriden by the
-+ ** ``mbox'', ``MMDF'', ``MH'' and ``Maildir''. This is overridden by the
- ** \fC-m\fP command-line option.
- */
- { "menu_context", DT_NUM, R_NONE, UL &MenuContext, 0 },
+++ /dev/null
-Fix a swedish word, the patch was forwarded upstream to
-http://dev.mutt.org/trac/ticket/3370
-
---- a/po/sv.po
-+++ b/po/sv.po
-@@ -74,7 +74,7 @@
- #: alias.c:307 send.c:206
- #, c-format
- msgid "Error: '%s' is a bad IDN."
--msgstr "Fel: '%s' är ett dåligt IDN."
-+msgstr "Fel: '%s' är ett felaktigt IDN."
-
- #: alias.c:319
- msgid "Personal name: "
-@@ -417,7 +417,7 @@
- #: commands.c:298 recvcmd.c:190
- #, c-format
- msgid "Bad IDN: '%s'"
--msgstr "Dåligt IDN: \"%s\""
-+msgstr "Felaktigt IDN: \"%s\""
-
- #: commands.c:309 recvcmd.c:204
- #, c-format
-@@ -640,7 +640,7 @@
- #: compose.c:302
- #, c-format
- msgid "Warning: '%s' is a bad IDN."
--msgstr "Varning: \"%s\" är ett dåligt IDN."
-+msgstr "Varning: \"%s\" är ett felaktigt IDN."
-
- #: compose.c:325
- msgid "You may not delete the only attachment."
-@@ -649,7 +649,7 @@
- #: compose.c:600 send.c:1591
- #, c-format
- msgid "Bad IDN in \"%s\": '%s'"
--msgstr "Dåligt IDN i \"%s\": \"%s\""
-+msgstr "Felaktigt IDN i \"%s\": \"%s\""
-
- #: compose.c:683
- msgid "Attaching selected files..."
-@@ -1788,7 +1788,7 @@
- #: edit.c:446
- #, c-format
- msgid "Bad IDN in %s: '%s'\n"
--msgstr "Dåligt IDN i %s: \"%s\"\n"
-+msgstr "Felaktigt IDN i %s: \"%s\"\n"
-
- #: edit.c:464
- #, c-format
-@@ -1999,7 +1999,7 @@
- #: history.c:77 history.c:114 history.c:140
- #, c-format
- msgid "Bad history file format (line %d)"
--msgstr "Dåligt filformat för historia (rad %d)"
-+msgstr "Felaktigt filformat för historik (rad %d)"
-
- #: hook.c:251
- #, c-format
-@@ -2186,7 +2186,7 @@
-
- #: imap/imap.c:1826
- msgid "Bad mailbox name"
--msgstr "Dåligt namn på brevlåda"
-+msgstr "Felaktigt namn på brevlåda"
-
- #: imap/imap.c:1851
- #, c-format
-@@ -2260,7 +2260,7 @@
- #: init.c:466
- #, c-format
- msgid "Bad regexp: %s"
--msgstr "Dåligt reguljärt uttryck: %s"
-+msgstr "Felaktigt reguljärt uttryck: %s"
-
- #: init.c:523
- #, c-format
-@@ -2282,7 +2282,7 @@
- #: init.c:901
- #, c-format
- msgid "Warning: Bad IDN '%s'.\n"
--msgstr "Varning: Dåligt IDN \"%s\".\n"
-+msgstr "Varning: Felaktigtt IDN \"%s\".\n"
-
- #: init.c:1109
- msgid "attachments: no disposition"
-@@ -2307,7 +2307,7 @@
- #: init.c:1359
- #, c-format
- msgid "Warning: Bad IDN '%s' in alias '%s'.\n"
--msgstr "Varning: Dåligt IDN \"%s\" i alias \"%s\".\n"
-+msgstr "Varning: Felaktigt IDN \"%s\" i alias \"%s\".\n"
-
- #: init.c:1447
- msgid "invalid header field"
-@@ -2925,7 +2925,7 @@
- #: mutt_socket.c:470 mutt_socket.c:529
- #, c-format
- msgid "Bad IDN \"%s\"."
--msgstr "Dåligt IDN \"%s\"."
-+msgstr "Felaktigt IDN \"%s\"."
-
- #: mutt_socket.c:478 mutt_socket.c:537
- #, c-format
-@@ -4066,7 +4066,7 @@
- #: sendlib.c:2500
- #, c-format
- msgid "Bad IDN %s while preparing resent-from."
--msgstr "Dåligt IDN %s vid förberedning av \"resent-from\"."
-+msgstr "Felaktigt IDN %s vid förberedning av \"resent-from\"."
-
- #: signal.c:43
- #, c-format
+++ /dev/null
-Small fix in a German translation, the original bug submission was amended after
-consulting a native speaker (gregoa@)
-
---- a/po/de.po
-+++ b/po/de.po
-@@ -1648,7 +1648,7 @@
-
- #: curs_main.c:1317 curs_main.c:1361
- msgid "No undeleted messages."
--msgstr "Alle Nachrichten gelöscht."
-+msgstr "Keine ungelöschten Nachrichten."
-
- #: curs_main.c:1354 curs_main.c:1378
- msgid "You are on the first message."
+++ /dev/null
-Small fix to the muttrc manpage
-
---- a/init.h
-+++ b/init.h
-@@ -559,7 +559,7 @@
- ** .pp
- ** If \fI``yes''\fP, always attempt to verify PGP or S/MIME signatures.
- ** If \fI``ask-*''\fP, ask whether or not to verify the signature.
-- ** If \Fi``no''\fP, never attempt to verify cryptographic signatures.
-+ ** If \fI``no''\fP, never attempt to verify cryptographic signatures.
- ** (Crypto only)
- */
- { "date_format", DT_STR, R_BOTH, UL &DateFmt, UL "!%a, %b %d, %Y at %I:%M:%S%p %Z" },
+++ /dev/null
-changeset: 5949:b2b97c7a2ae6
-branch: HEAD
-user: Brendan Cully <brendan@kublai.com>
-date: Fri Jun 26 21:47:34 2009 -0700
-summary: Set internaldate of messages appended to IMAP mailboxes
-
---- a/imap/imap_private.h
-+++ b/imap/imap_private.h
-@@ -70,6 +70,9 @@
- #define IMAP_CMD_PASS (1<<1)
- #define IMAP_CMD_QUEUE (1<<2)
-
-+/* length of "DD-MMM-YYYY HH:MM:SS +ZZzz" (null-terminated) */
-+#define IMAP_DATELEN 27
-+
- enum
- {
- IMAP_FATAL = 1,
-@@ -281,6 +284,7 @@ char* imap_get_qualifier (char* buf);
- int imap_mxcmp (const char* mx1, const char* mx2);
- char* imap_next_word (char* s);
- time_t imap_parse_date (char* s);
-+void imap_make_date (char* buf, time_t timestamp);
- void imap_qualify_path (char *dest, size_t len, IMAP_MBOX *mx, char* path);
- void imap_quote_string (char* dest, size_t slen, const char* src);
- void imap_unquote_string (char* s);
---- a/imap/message.c
-+++ b/imap/message.c
-@@ -600,6 +600,7 @@ int imap_append_message (CONTEXT *ctx, M
- char buf[LONG_STRING];
- char mbox[LONG_STRING];
- char mailbox[LONG_STRING];
-+ char internaldate[IMAP_DATELEN];
- size_t len;
- progress_t progressbar;
- size_t sent;
-@@ -641,12 +642,14 @@ int imap_append_message (CONTEXT *ctx, M
- M_PROGRESS_SIZE, NetInc, len);
-
- imap_munge_mbox_name (mbox, sizeof (mbox), mailbox);
-- snprintf (buf, sizeof (buf), "APPEND %s (%s%s%s%s%s) {%lu}", mbox,
-+ imap_make_date (internaldate, msg->received);
-+ snprintf (buf, sizeof (buf), "APPEND %s (%s%s%s%s%s) \"%s\" {%lu}", mbox,
- msg->flags.read ? "\\Seen" : "",
- msg->flags.read && (msg->flags.replied || msg->flags.flagged) ? " " : "",
- msg->flags.replied ? "\\Answered" : "",
- msg->flags.replied && msg->flags.flagged ? " " : "",
- msg->flags.flagged ? "\\Flagged" : "",
-+ internaldate,
- (unsigned long) len);
-
- imap_cmd_start (idata, buf);
---- a/imap/util.c
-+++ b/imap/util.c
-@@ -577,6 +577,21 @@ time_t imap_parse_date (char *s)
- return (mutt_mktime (&t, 0) + tz);
- }
-
-+/* format date in IMAP style: DD-MMM-YYYY HH:MM:SS +ZZzz.
-+ * Caller should provide a buffer of IMAP_DATELEN bytes */
-+void imap_make_date (char *buf, time_t timestamp)
-+{
-+ struct tm* tm = localtime (×tamp);
-+ time_t tz = mutt_local_tz (timestamp);
-+
-+ tz /= 60;
-+
-+ snprintf (buf, IMAP_DATELEN, "%02d-%s-%d %02d:%02d:%02d %+03d%02d",
-+ tm->tm_mday, Months[tm->tm_mon], tm->tm_year + 1900,
-+ tm->tm_hour, tm->tm_min, tm->tm_sec,
-+ (int) tz / 60, (int) abs (tz) % 60);
-+}
-+
- /* imap_qualify_path: make an absolute IMAP folder target, given IMAP_MBOX
- * and relative path. */
- void imap_qualify_path (char *dest, size_t len, IMAP_MBOX *mx, char* path)