From 90f310b4fb8903898ead674059584737e448eb8a Mon Sep 17 00:00:00 2001 From: Jani Nikula Date: Sun, 4 Mar 2012 10:25:38 +0200 Subject: [PATCH 1/3] emacs: fix MML quoting in replies The reply MML quoting added in commit ae438cc unintentionally MML quotes also the signature/encryption MML tags added via message-setup-hook, causing the reply not to be signed/encrypted. MML quote just the original message in the temp buffer before inserting it to the message buffer, to not interfere with message mode hooks or message construction in general. See [1] and [2] for bug reports. Thanks to Tim Bielawa for testing. [1] id:"87hay78x6l.fsf@wyzanski.jamesvasile.com" [2] id:"1330812262-28272-1-git-send-email-tbielawa@redhat.com". Signed-off-by: Jani Nikula --- emacs/notmuch-mua.el | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el index 4be7c13d..13244eb8 100644 --- a/emacs/notmuch-mua.el +++ b/emacs/notmuch-mua.el @@ -95,6 +95,9 @@ list." (goto-char (point-min)) (setq headers (mail-header-extract))))) (forward-line 1) + ;; Original message may contain (malicious) MML tags. We must + ;; properly quote them in the reply. + (mml-quote-region (point) (point-max)) (setq body (buffer-substring (point) (point-max)))) ;; If sender is non-nil, set the From: header to its value. (when sender @@ -116,12 +119,7 @@ list." (push-mark)) (set-buffer-modified-p nil) - (message-goto-body) - ;; Original message may contain (malicious) MML tags. We must - ;; properly quote them in the reply. Note that using `point-max' - ;; instead of `mark' here is wrong. The buffer may include user's - ;; signature which should not be MML-quoted. - (mml-quote-region (point) (mark))) + (message-goto-body)) (defun notmuch-mua-forward-message () (message-forward) From 353577ad5733b78b71d93c9bdbaae0b062d32331 Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Tue, 6 Mar 2012 18:26:57 +0000 Subject: [PATCH 2/3] Handle errors in mime_node_open --- mime-node.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/mime-node.c b/mime-node.c index d6b4506c..a95bdabc 100644 --- a/mime-node.c +++ b/mime-node.c @@ -97,11 +97,26 @@ mime_node_open (const void *ctx, notmuch_message_t *message, } mctx->stream = g_mime_stream_file_new (mctx->file); + if (!mctx->stream) { + fprintf (stderr, "Out of memory.\n"); + status = NOTMUCH_STATUS_OUT_OF_MEMORY; + goto DONE; + } g_mime_stream_file_set_owner (GMIME_STREAM_FILE (mctx->stream), FALSE); mctx->parser = g_mime_parser_new_with_stream (mctx->stream); + if (!mctx->parser) { + fprintf (stderr, "Out of memory.\n"); + status = NOTMUCH_STATUS_OUT_OF_MEMORY; + goto DONE; + } mctx->mime_message = g_mime_parser_construct_message (mctx->parser); + if (!mctx->mime_message) { + fprintf (stderr, "Failed to parse %s\n", filename); + status = NOTMUCH_STATUS_FILE_ERROR; + goto DONE; + } mctx->cryptoctx = cryptoctx; mctx->decrypt = decrypt; From 4d136995cebb3a339faf844fa3106f398562aad7 Mon Sep 17 00:00:00 2001 From: Jameson Graef Rollins Date: Thu, 8 Mar 2012 08:45:01 -0800 Subject: [PATCH 3/3] Fix configure script to properly detect gmime-2.6 if available. Previously, the configure script would appear to detect gmime-2.6 if present. However, the binaries would end up being compiled against gmime-2.4. The addition of a break fixes things so that now gmime-2.6 will be used if available, falling back to gmime-2.4. --- configure | 1 + 1 file changed, 1 insertion(+) diff --git a/configure b/configure index 8b85b9d9..dedb7d87 100755 --- a/configure +++ b/configure @@ -281,6 +281,7 @@ for gmimepc in gmime-2.6 gmime-2.4; do have_gmime=1 gmime_cflags=$(pkg-config --cflags $gmimepc) gmime_ldflags=$(pkg-config --libs $gmimepc) + break fi done if [ "$have_gmime" = "0" ]; then