]> git.cworth.org Git - notmuch/commitdiff
Merge branch 'release'
authorDavid Bremner <david@tethera.net>
Thu, 26 May 2022 11:35:16 +0000 (08:35 -0300)
committerDavid Bremner <david@tethera.net>
Thu, 26 May 2022 11:35:16 +0000 (08:35 -0300)
15 files changed:
configure
doc/conf.py
doc/man1/notmuch-config.rst
doc/man1/notmuch-insert.rst
doc/man1/notmuch-new.rst
doc/man1/notmuch-show.rst
doc/man7/notmuch-sexp-queries.rst
doc/notmuch-emacs.rst
emacs/notmuch-lib.el
emacs/notmuch-mua.el
emacs/notmuch-show.el
test/T450-emacs-show.sh
test/T453-emacs-reply.sh [new file with mode: 0755]
test/corpora/attachment/x-gtar-compressed.eml [new file with mode: 0644]
test/emacs-show.expected-output/notmuch-show-multipart-alternative [new file with mode: 0644]

index 2f6d8b687b46eea3d84f7ec4af8291a5f8b76ed3..30fee6ab06e0983297d3efaad80739f99549c91a 100755 (executable)
--- a/configure
+++ b/configure
@@ -564,7 +564,6 @@ int main () {
     GMimeSignature *sig = NULL;
     GMimeCertificate *cert = NULL;
     GMimeObject *output = NULL;
-    GMimeValidity validity = GMIME_VALIDITY_UNKNOWN;
     int len;
 
     g_mime_init ();
@@ -586,7 +585,7 @@ int main () {
     cert = g_mime_signature_get_certificate (sig);
     if (cert == NULL) return !! fprintf (stderr, "no GMimeCertificate found\n");
 #ifdef CHECK_VALIDITY
-    validity = g_mime_certificate_get_id_validity (cert);
+    GMimeValidity validity = g_mime_certificate_get_id_validity (cert);
     if (validity != GMIME_VALIDITY_FULL) return !! fprintf (stderr, "Got validity %d, expected %d\n", validity, GMIME_VALIDITY_FULL);
 #endif
 #ifdef CHECK_EMAIL
index e46e1d4e47faa089c45553f747a6f95003dba9a4..6afeac06e53d4da8d6123ecb7c3b1ac55d2ff891 100644 (file)
@@ -200,3 +200,10 @@ texinfo_documents += [
         x[2],                          # description
         'Miscellaneous'                        # category
     ) for x in man_pages]
+
+def setup(app):
+    import docutils.nodes
+    # define nmconfig role and directive for config items.
+    app.add_object_type('nmconfig','nmconfig',
+                        indextemplate='pair: configuration item; %s',
+                        ref_nodeclass=docutils.nodes.generated)
index acc5ecec6b01282c30d7b9bd821fde9ac1e8e2bf..36d4872505f015fdcdb7c18ab988eb3829c94eb9 100644 (file)
@@ -55,13 +55,14 @@ The available configuration items are described below. Non-absolute
 paths are presumed relative to `$HOME` for items in section
 **database**.
 
-built_with.<name>
+.. nmconfig:: built_with.<name>
+
     Compile time feature <name>. Current possibilities include
     "retry_lock" (configure option, included by default).
     (since notmuch 0.30, "compact" and "field_processor" are
     always included.)
 
-database.autocommit
+.. nmconfig:: database.autocommit
 
     How often to commit transactions to disk. `0` means wait until
     command completes, otherwise an integer `n` specifies to commit to
@@ -69,7 +70,8 @@ database.autocommit
 
     History: this configuration value was introduced in notmuch 0.33.
 
-database.backup_dir
+.. nmconfig:: database.backup_dir
+
     Directory to store tag dumps when upgrading database.
 
     History: this configuration value was introduced in notmuch 0.32.
@@ -77,7 +79,8 @@ database.backup_dir
     Default: A sibling directory of the Xapian database called
     `backups`.
 
-database.hook_dir
+.. nmconfig:: database.hook_dir
+
     Directory containing hooks run by notmuch commands. See
     :any:`notmuch-hooks(5)`.
 
@@ -85,9 +88,8 @@ database.hook_dir
 
     Default: See HOOKS, below.
 
-.. _database.mail_root:
+.. nmconfig:: database.mail_root
 
-database.mail_root
     The top-level directory where your mail currently exists and to
     where mail will be delivered in the future. Files should be
     individual email messages.
@@ -95,18 +97,18 @@ database.mail_root
     History: this configuration value was introduced in notmuch 0.32.
 
     Default: For compatibility with older configurations, the value of
-    database.path is used if **database.mail\_root** is unset.
+    database.path is used if :nmconfig:`database.mail_root` is unset.
+
+.. nmconfig:: database.path
 
-database.path
     Notmuch will store its database here, (in
-    sub-directory named ``.notmuch`` if **database.mail\_root**
+    sub-directory named ``.notmuch`` if :nmconfig:`database.mail_root`
     is unset).
 
     Default: see :ref:`database`
 
-.. _index.decrypt:
+.. nmconfig:: index.decrypt
 
-index.decrypt
     Policy for decrypting encrypted messages during indexing.  Must be
     one of: ``false``, ``auto``, ``nostash``, or ``true``.
 
@@ -161,7 +163,8 @@ index.decrypt
 
 .. _index.header:
 
-index.header.<prefix>
+.. nmconfig:: index.header.<prefix>
+
     Define the query prefix <prefix>, based on a mail header. For
     example ``index.header.List=List-Id`` will add a probabilistic
     prefix ``List:`` that searches the ``List-Id`` field.  User
@@ -170,9 +173,8 @@ index.header.<prefix>
     supported. See :any:`notmuch-search-terms(7)` for a list of existing
     prefixes, and an explanation of probabilistic prefixes.
 
-.. _maildir.synchronize_flags:
+.. nmconfig:: maildir.synchronize_flags
 
-maildir.synchronize\_flags
     If true, then the following maildir flags (in message filenames)
     will be synchronized with the corresponding notmuch tags:
 
@@ -205,9 +207,8 @@ maildir.synchronize\_flags
 
     Default: ``true``.
 
-.. _new.ignore:
+.. nmconfig:: new.ignore
 
-new.ignore
     A list to specify files and directories that will not be searched
     for messages by :any:`notmuch-new(1)`. Each entry in the list is either:
 
@@ -225,20 +226,21 @@ new.ignore
 
     Default: empty list.
 
-.. _new.tags:
+.. nmconfig:: new.tags
 
-new.tags
     A list of tags that will be added to all messages incorporated by
     **notmuch new**.
 
     Default: ``unread;inbox``.
 
-query.<name>
+.. nmconfig:: query.<name>
+
     Expansion for named query called <name>. See
     :any:`notmuch-search-terms(7)` for more information about named
     queries.
 
-search.exclude\_tags
+.. nmconfig:: search.exclude_tags
+
     A list of tags that will be excluded from search results by
     default. Using an excluded tag in a query will override that
     exclusion.
@@ -246,9 +248,7 @@ search.exclude\_tags
     Default: empty list. Note that :any:`notmuch-setup(1)` puts
     ``deleted;spam`` here when creating new configuration file.
 
-.. _show.extra_headers:
-
-show.extra\_headers
+.. nmconfig:: show.extra_headers
 
     By default :any:`notmuch-show(1)` includes the following headers
     in structured output if they are present in the message:
@@ -260,26 +260,28 @@ show.extra\_headers
 
     Default: empty list.
 
-squery.<name>
+.. nmconfig:: squery.<name>
+
     Expansion for named query called <name>, using s-expression syntax. See
     :any:`notmuch-sexp-queries(7)` for more information about s-expression
     queries.
 
-user.name
+.. nmconfig:: user.name
+
     Your full name.
 
     Default: ``$NAME`` variable if set, otherwise read from
     ``/etc/passwd``.
 
-user.other\_email
+.. nmconfig:: user.other_email
+
     A list of other email addresses at which you receive email
-    (see also, :ref:`user.primary_email <user.primary_email>`).
+    (see also, :nmconfig:`user.primary_email`)
 
     Default: not set.
 
-.. _user.primary_email:
+.. nmconfig:: user.primary_email
 
-user.primary\_email
     Your primary email address.
 
     Default: ``$EMAIL`` variable if set, otherwise constructed from
index fe2bf26b1395063ae9c90fbddd9c84d83a71c2ad..e05bd0b5730507bd1bed22ee30016713ed36d569 100644 (file)
@@ -14,12 +14,12 @@ DESCRIPTION
 
 **notmuch insert** reads a message from standard input and delivers it
 into the maildir directory given by configuration option
-:ref:`database.mail_root <database.mail_root>`, then incorporates the message into the notmuch
+:nmconfig:`database.mail_root`, then incorporates the message into the notmuch
 database. It is an alternative to using a separate tool to deliver the
 message then running :any:`notmuch-new(1)` afterwards.
 
 The new message will be tagged with the tags specified by the
-:ref:`new.tags <new.tags>` configuration option, then by operations specified on the
+:nmconfig:`new.tags` configuration option, then by operations specified on the
 command-line: tags prefixed by '+' are added while those prefixed by '-'
 are removed.
 
@@ -38,7 +38,7 @@ Supported options for **insert** include
 .. option:: --folder=<folder>
 
    Deliver the message to the specified folder, relative to the
-   top-level directory given by the value of **database.mail_root**. The
+   top-level directory given by the value of :nmconfig:`database.mail_root`. The
    default is the empty string, which means delivering to the
    top-level directory.
 
@@ -86,16 +86,15 @@ Supported options for **insert** include
    ``--decrypt=nostash`` without considering the security of your
    index.
 
-   See also :ref:`index.decrypt <index.decrypt>` in :any:`notmuch-config(1)`.
+   See also :nmconfig:`index.decrypt` in :any:`notmuch-config(1)`.
 
 CONFIGURATION
 =============
 
 Indexing is influenced by the configuration options
-:ref:`index.decrypt <index.decrypt>` and :ref:`index.header
-<index.header>`.  Tagging
-is controlled by :ref:`new.tags <new.tags>` and
-:ref:`maildir.synchronize_flags <maildir.synchronize_flags>`.  See
+:nmconfig:`index.decrypt` and :nmconfig:`index.header.\<prefix\>`.  Tagging
+is controlled by options :nmconfig:`new.tags` and
+:nmconfig:`maildir.synchronize_flags`.  See
 :any:`notmuch-config(1)` for details.
 
 EXIT STATUS
index 398f8813a834f464ea0b63eb6ce26df84fad6591..f0ed8eb836ffa6bfab11c77849947063692a6ce7 100644 (file)
@@ -82,10 +82,10 @@ CONFIGURATION
 =============
 
 Indexing is influenced by the configuration options
-:ref:`index.decrypt <index.decrypt>`, :ref:`index.header
-<index.header>`, and :ref:`new.ignore <new.ignore>`.  Tagging
-is controlled by :ref:`new.tags <new.tags>` and
-:ref:`maildir.synchronize_flags <maildir.synchronize_flags>`.  See
+:nmconfig:`index.decrypt`, :nmconfig:`index.header.\<prefix\>`
+and :nmconfig:`new.ignore`.  Tagging
+is controlled by :nmconfig:`new.tags` and
+:nmconfig:`maildir.synchronize_flags`.  See
 :any:`notmuch-config(1)` for details.
 
 EXIT STATUS
index 1b02d4079a34d4e9b5ba471eb2f90f9eadd458b4..5535392153654b7dcae91585ac002e58d67da54e 100644 (file)
@@ -225,7 +225,7 @@ CONFIGURATION
 =============
 
 Structured output (json / sexp) is influenced by the configuration
-option :ref:`show.extra_headers <show.extra_headers>`. See
+option :nmconfig:`show.extra_headers`. See
 :any:`notmuch-config(1)` for details.
 
 EXIT STATUS
index bc8e5086f342be9568cfc3baafac3e700c5c623b..1d7e0ae9a5aa1b63639c92660d4b4c62a7330bd2 100644 (file)
@@ -221,7 +221,7 @@ EXAMPLES
 
 ``(not Bob Marley)``
 
-    Match messages containing neither "Bob" nor "Marley", nor their stems,
+    Match messages containing neither "Bob" nor "Marley", nor their stems.
 
 ``"quick fox"`` ``quick-fox`` ``quick@fox``
 
@@ -230,11 +230,11 @@ EXAMPLES
 
 ``(folder (of (id 1234@invalid)))``
 
-    Match any message in the same folder as the one with Message-Id "1234@invalid"
+    Match any message in the same folder as the one with Message-Id "1234\@invalid".
 
 ``(id 1234@invalid blah@test)``
 
-    Matches Message-Id "1234@invalid" *or* Message-Id "blah@test"
+    Matches Message-Id "1234\@invalid" *or* Message-Id "blah\@test".
 
 ``(and (infix "date:2009-11-18..2009-11-18") (tag unread))``
 
@@ -260,18 +260,18 @@ EXAMPLES
 
 ``(thread (of (id 1234@invalid)))``
 
-    Match any message in the same thread as the one with Message-Id "1234@invalid"
+    Match any message in the same thread as the one with Message-Id "1234\@invalid".
 
 ``(thread (matching (from bob@example.com) (to bob@example.com)))``
 
     Match any (messages in) a thread containing a message from
-    "bob@example.com" and a (possibly distinct) message to "bob at
-    example.com")
+    "bob\@example.com" and a (possibly distinct) message to
+    "bob\@example.com".
 
 ``(to (or bob@example.com mallory@example.org))`` ``(or (to bob@example.com) (to mallory@example.org))``
 
-    Match in the "To" or "Cc" headers, "bob@example.com",
-    "mallory@example.org", and also "bob@example.com.au" since it
+    Match in the "To" or "Cc" headers, "bob\@example.com",
+    "mallory\@example.org", and also "bob\@example.com.au" since it
     contains the adjacent triple "bob", "example", "com".
 
 ``(not (to *))``
@@ -281,7 +281,7 @@ EXAMPLES
 ``(List *)``
 
     Match messages with a non-empty List-Id header, assuming
-    configuration ``index.header.List=List-Id``
+    configuration ``index.header.List=List-Id``.
 
 .. _macro_examples:
 
index 41f62390b79c8dee4590eadba30f2ffca5dc32ea..ec7dee78ac80867b345f412e4667af14825fbc8a 100644 (file)
@@ -221,6 +221,9 @@ pressing RET after positioning the cursor on a hidden part.
 ``+,-``
     Add or remove arbitrary tags from the current message.
 
+``!``
+    |docstring::notmuch-show-toggle-elide-non-matching|
+
 ``?``
     Display full set of key bindings
 
@@ -235,6 +238,27 @@ Display of messages can be controlled by the following variables
 :index:`notmuch-show-header-line`
        |docstring::notmuch-show-header-line|
 
+:index:`notmuch-multipart/alternative-discouraged`
+
+   Which mime types to hide by default for multipart messages.
+
+   Can either be a list of mime types (as strings) or a function
+   mapping a plist representing the current message to such a list.
+   The following example function would discourage `text/html` and
+   `multipart/related` generally, but discourage `text/plain` should
+   the message be sent from `whatever@example.com`.
+
+   .. code:: lisp
+
+      (defun my--determine-discouraged (msg)
+        (let* ((headers (plist-get msg :headers))
+               (from (or (plist-get headers :From) "")))
+          (cond
+           ((string-match "whatever@example.com" from)
+            (list "text/plain"))
+           (t
+            (list "text/html" "multipart/related")))))
+
 .. _show-copy:
 
 Copy to kill-ring
index 6fc71cc737995a5f4a66d205a0be58e458281ab3..1e631d0eb0147a19da00bed2f8af6dbd3dff1dcf 100644 (file)
@@ -567,12 +567,20 @@ Take wildcards into account."
           (string= (downcase t1)
                    (downcase t2))))))
 
-(defvar notmuch-multipart/alternative-discouraged
+(defcustom notmuch-multipart/alternative-discouraged
   '(;; Avoid HTML parts.
     "text/html"
     ;; multipart/related usually contain a text/html part and some
     ;; associated graphics.
-    "multipart/related"))
+    "multipart/related")
+  "Which mime types to hide by default for multipart messages.
+
+Can either be a list of mime types (as strings) or a function
+mapping a plist representing the current message to such a list.
+See Info node `(notmuch-emacs) notmuch-show' for a sample function."
+  :group 'notmuch-show
+  :type '(radio (repeat :tag "MIME Types" string)
+               (function :tag "Function")))
 
 (defun notmuch-multipart/alternative-determine-discouraged (msg)
   "Return the discouraged alternatives for the specified message."
@@ -1037,6 +1045,14 @@ region if the region is active, or both `point' otherwise."
   'notmuch-interactive-region
   "notmuch 0.29")
 
+(defun notmuch--inline-override-types ()
+  "Override mm-inline-override-types to stop application/*
+parts from being displayed unless the user has customized
+it themselves."
+  (if (equal mm-inline-override-types
+            (eval (car (get 'mm-inline-override-types 'standard-value))))
+      (cons "application/.*" mm-inline-override-types)
+    mm-inline-override-types))
 ;;; _
 
 (provide 'notmuch-lib)
index c679373b175955092858c7bfe8366a4aa088c91e..60801f4be7d331269a578599c00abc2c0cc5c831 100644 (file)
@@ -316,7 +316,9 @@ Typically this is added to `notmuch-mua-send-hook'."
                ;; text.
                (notmuch-show-process-crypto process-crypto)
                ;; Don't indent multipart sub-parts.
-               (notmuch-show-indent-multipart nil))
+               (notmuch-show-indent-multipart nil)
+               ;; Stop certain mime types from being inlined
+               (mm-inline-override-types (notmuch--inline-override-types)))
             ;; We don't want sigstatus buttons (an information leak and usually wrong anyway).
             (cl-letf (((symbol-function 'notmuch-crypto-insert-sigstatus-button) #'ignore)
                       ((symbol-function 'notmuch-crypto-insert-encstatus-button) #'ignore))
index 7c1f02c92f1499be58df08929863d4e1aa013118..69f6c845571976965567c84d6de586f2ba8a587a 100644 (file)
@@ -1264,14 +1264,8 @@ matched."
   (let ((buffer-name (generate-new-buffer-name
                      (or buffer-name
                          (concat "*notmuch-" thread-id "*"))))
-       ;; We override mm-inline-override-types to stop application/*
-       ;; parts from being displayed unless the user has customized
-       ;; it themselves.
-       (mm-inline-override-types
-        (if (equal mm-inline-override-types
-                   (eval (car (get 'mm-inline-override-types 'standard-value))))
-            (cons "application/*" mm-inline-override-types)
-          mm-inline-override-types)))
+       (mm-inline-override-types (notmuch--inline-override-types)))
+
     (pop-to-buffer-same-window (get-buffer-create buffer-name))
     ;; No need to track undo information for this buffer.
     (setq buffer-undo-list t)
index 057ad37ee30e1a1e90fef01f82edac906c5101f4..678efd8b02a503a0e2559fff2c23a0b8f8259f8c 100755 (executable)
@@ -209,6 +209,10 @@ test_emacs '(notmuch-show "id:'$gen_msg_id'")
 output=$(head -1 OUTPUT.raw|cut -f1-4 -d' ')
 test_expect_equal "$output" "Notmuch Test Suite <test_suite@notmuchmail.org>"
 
+test_begin_subtest "multipart/alternative hides html by default"
+test_emacs '(notmuch-show "id:cf0c4d610911171136h1713aa59w9cf9aa31f052ad0a@mail.gmail.com")
+           (test-visible-output)'
+test_expect_equal_file $EXPECTED/notmuch-show-multipart-alternative OUTPUT
 
 # switching to the crypto corpus, using gpg from here on:
 add_gnupg_home
@@ -245,4 +249,26 @@ test_emacs "(test-log-error
                (notmuch-show \"$tid\")))"
 test_expect_equal "$(cat MESSAGES)" "COMPLETE"
 
+add_email_corpus attachment
+
+test_begin_subtest "tar not inlined by default"
+test_emacs '(notmuch-show "id:874llc2bkp.fsf@curie.anarc.at")
+       (test-visible-output "OUTPUT")'
+cat <<EOF > EXPECTED
+Antoine Beaupré <anarcat@orangeseeds.org> (2018-03-19) (attachment inbox)
+Subject: Re: bug: "no top level messages" crash on Zen email loops
+To: David Bremner <david@tethera.net>, notmuch@notmuchmail.org
+Date: Mon, 19 Mar 2018 13:56:54 -0400
+
+[ multipart/mixed ]
+[ text/plain ]
+And obviously I forget the frigging attachment.
+[ zendesk-email-loop2.tgz: application/x-gtar-compressed ]
+[ text/plain ]
+
+PS: don't we have a "you forgot to actually attach the damn file" plugin
+when we detect the word "attachment" and there's no attach? :p
+EOF
+test_expect_equal_file EXPECTED OUTPUT
+
 test_done
diff --git a/test/T453-emacs-reply.sh b/test/T453-emacs-reply.sh
new file mode 100755 (executable)
index 0000000..c26c447
--- /dev/null
@@ -0,0 +1,34 @@
+#!/usr/bin/env bash
+
+test_description="emacs reply"
+. $(dirname "$0")/test-lib.sh || exit 1
+. $NOTMUCH_SRCDIR/test/test-lib-emacs.sh || exit 1
+
+EXPECTED=$NOTMUCH_SRCDIR/test/emacs-show.expected-output
+
+test_require_emacs
+
+add_email_corpus attachment
+
+test_begin_subtest "tar not inlined by default"
+test_emacs '(notmuch-mua-new-reply "id:874llc2bkp.fsf@curie.anarc.at")
+       (test-visible-output "OUTPUT.raw")'
+cat <<EOF > EXPECTED
+From: Notmuch Test Suite <test_suite@notmuchmail.org>
+To: Antoine Beaupré <anarcat@orangeseeds.org>
+Subject: Re: bug: "no top level messages" crash on Zen email loops
+In-Reply-To: <874llc2bkp.fsf@curie.anarc.at>
+Fcc: MAIL_DIR/sent
+--text follows this line--
+Antoine Beaupré <anarcat@orangeseeds.org> writes:
+
+> And obviously I forget the frigging attachment.
+>
+>
+> PS: don't we have a "you forgot to actually attach the damn file" plugin
+> when we detect the word "attachment" and there's no attach? :p
+EOF
+notmuch_dir_sanitize < OUTPUT.raw > OUTPUT
+test_expect_equal_file EXPECTED OUTPUT
+
+test_done
diff --git a/test/corpora/attachment/x-gtar-compressed.eml b/test/corpora/attachment/x-gtar-compressed.eml
new file mode 100644 (file)
index 0000000..258a74d
--- /dev/null
@@ -0,0 +1,136 @@
+Return-path: <anarcat@orangeseeds.org>
+Envelope-to: david@tethera.net
+Delivery-date: Mon, 19 Mar 2018 13:56:54 -0400
+Received: from marcos.anarc.at ([206.248.172.91])
+       by fethera.tethera.net with esmtp (Exim 4.89)
+       (envelope-from <anarcat@orangeseeds.org>)
+       id 1exz1i-0002aa-If
+       for david@tethera.net; Mon, 19 Mar 2018 13:56:54 -0400
+Received: from [127.0.0.1] (localhost [127.0.0.1])     (Authenticated sender: anarcat) with ESMTPSA id 718A610E04F
+From: =?utf-8?Q?Antoine_Beaupr=C3=A9?= <anarcat@orangeseeds.org>
+To: David Bremner <david@tethera.net>, notmuch@notmuchmail.org
+Subject: Re: bug: "no top level messages" crash on Zen email loops
+In-Reply-To: <87a7v42bv9.fsf@curie.anarc.at>
+References: <87d10042pu.fsf@curie.anarc.at> <87woy8vx7i.fsf@tesseract.cs.unb.ca> <87a7v42bv9.fsf@curie.anarc.at>
+Date: Mon, 19 Mar 2018 13:56:54 -0400
+Message-ID: <874llc2bkp.fsf@curie.anarc.at>
+MIME-Version: 1.0
+Content-Type: multipart/mixed; boundary="=-=-="
+X-Spam_score: 0.0
+X-Spam_score_int: 0
+X-Spam_bar: /
+
+--=-=-=
+Content-Type: text/plain
+
+And obviously I forget the frigging attachment.
+
+
+--=-=-=
+Content-Type: application/x-gtar-compressed
+Content-Disposition: attachment; filename=zendesk-email-loop2.tgz
+Content-Transfer-Encoding: base64
+
+H4sIAJX1r1oAA+xbaVPbyNbO19Gv6CF1K0mBrM2SLYOY8QoGbAzegKlbVFtq28KyJNSSF269//09
+Lclm35LJTebOiARbvZw+a5+npcPIDh08EMwoED58r0uEKyeK7FPKqfc+V9cHSZFVJZeTlWz2gyjJ
+OUn9gNTvxtGdK6IhDhD6gF0cmDh8dtxr/X/Ra3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u49LPDD0BD8cNuQouXveQISTFVFTruUxrfbw9ubUL7KNnybXGR2812z4M7rDKt
+qEM6s2Kdr47658vVIRk0BdPSxRzZLw4YgumeFp3piOEcn6loD6eqhv1Q7YWa79/J/zg/8y3NP73S
+1lNp9f5HdLfLolFnJcIMeMLahcQ0JPmunhfSOsB0K8fetnF3fuwnfmoZeQ+qimaP/S7frI/XVzwD
+SPH4sfzYvldVp9w/6aaVqdwp3ZaWbsF1q5tWnXL+tSHnhHSxYEmnlbXknJBjXDaaHzhv7SEqSxbq
+OXHrldnCnpCCOEiD25HZUNTTqtXPktl5V0lHW42WzpiKq+K3Vn0dg06wZq6g2ao43U6t7Ja+sJ1a
+2S2d007Os5I0DXJwi7WEBloZwcFAAti8OKFKyVFVUk6VnOQY2Tm04NpvZJW2+BU/RPl9l3o1XD/N
+OL0zcJqOEY3Mj0X4FwqT0cj8WIR8exeNTGtl5CgNysG5LycFkWs+Gd/wwGkuvEoIe8mYEUvU6jXG
+jFgiafU3tjgVmGkllyXLyRm+xJwU6UuzWKLNKOYF1tr4L9kve6i8XbAi6+rss66momVkXb056vyv
+PH06h/e/Lb0b35P3v3krvP/tf1D3/yErzqX//er9f+h/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAABg
+lD9gaWU0AHgAAA==
+--=-=-=
+Content-Type: text/plain
+
+
+PS: don't we have a "you forgot to actually attach the damn file" plugin
+when we detect the word "attachment" and there's no attach? :p
+
+--=-=-=--
diff --git a/test/emacs-show.expected-output/notmuch-show-multipart-alternative b/test/emacs-show.expected-output/notmuch-show-multipart-alternative
new file mode 100644 (file)
index 0000000..e44926b
--- /dev/null
@@ -0,0 +1,62 @@
+Alex Botero-Lowry <alex.boterolowry@gmail.com> (2009-11-17) (attachment inbox)
+Subject: [notmuch] preliminary FreeBSD support
+To: notmuch@notmuchmail.org
+Date: Tue, 17 Nov 2009 11:36:14 -0800
+
+[ multipart/mixed ]
+[ multipart/alternative ]
+[ text/plain ]
+I saw the announcement this morning, and was very excited, as I had been
+hoping sup would be turned into a library,
+since I like the concept more than the UI (I'd rather an emacs interface).
+
+I did a preliminary compile which worked out fine, but
+sysconf(_SC_SC_GETPW_R_SIZE_MAX) returns -1 on
+FreeBSD, so notmuch_config_open segfaulted.
+
+Attached is a patch that supplies a default buffer size of 64 in cases where
+-1 is returned.
+
+http://www.opengroup.org/austin/docs/austin_328.txt - seems to indicate this
+is acceptable behavior,
+and
+http://mail-index.netbsd.org/pkgsrc-bugs/2006/06/07/msg016808.htmlspecifically
+uses 64 as the
+buffer size.
+[ text/html (hidden) ]
+[ 0001-Deal-with-situation-where-sysconf-_SC_GETPW_R_SIZE_M.patch: application/octet-stream (as text/x-diff) ]
+From e3bc4bbd7b9d0d086816ab5f8f2d6ffea1dd3ea4 Mon Sep 17 00:00:00 2001
+From: Alexander Botero-Lowry <alex.boterolowry@gmail.com>
+Date: Tue, 17 Nov 2009 11:30:39 -0800
+Subject: [PATCH] Deal with situation where sysconf(_SC_GETPW_R_SIZE_MAX) returns -1
+
+---
+ notmuch-config.c |    2 ++
+ 1 files changed, 2 insertions(+), 0 deletions(-)
+
+diff --git a/notmuch-config.c b/notmuch-config.c
+index 248149c..e7220d8 100644
+--- a/notmuch-config.c
++++ b/notmuch-config.c
+@@ -77,6 +77,7 @@ static char *
+ get_name_from_passwd_file (void *ctx)
+ {
+     long pw_buf_size = sysconf(_SC_GETPW_R_SIZE_MAX);
++    if (pw_buf_size == -1) pw_buf_size = 64;
+     char *pw_buf = talloc_zero_size (ctx, pw_buf_size);
+     struct passwd passwd, *ignored;
+     char *name;
+@@ -101,6 +102,7 @@ static char *
+ get_username_from_passwd_file (void *ctx)
+ {
+     long pw_buf_size = sysconf(_SC_GETPW_R_SIZE_MAX);
++    if (pw_buf_size == -1) pw_buf_size = 64;
+     char *pw_buf = talloc_zero_size (ctx, pw_buf_size);
+     struct passwd passwd, *ignored;
+     char *name;
+-- 
+1.6.5.2
+
+[ text/plain ]
+[ 4-line signature. Click/Enter to show. ]
+ Carl Worth <cworth@cworth.org> (2009-11-17) (inbox unread)