Re: [PATCH 0/4] Allow specifying alternate names for addresses in other_email
authorJani Nikula <jani@nikula.org>
Sun, 14 Aug 2016 13:45:47 +0000 (16:45 +0300)
committerW. Trevor King <wking@tremily.us>
Sat, 20 Aug 2016 23:22:26 +0000 (16:22 -0700)
cf/7622d255e728ba15d1d9030580733f412679c7 [new file with mode: 0644]

diff --git a/cf/7622d255e728ba15d1d9030580733f412679c7 b/cf/7622d255e728ba15d1d9030580733f412679c7
new file mode 100644 (file)
index 0000000..99b10cd
--- /dev/null
@@ -0,0 +1,139 @@
+Return-Path: <jani@nikula.org>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by arlo.cworth.org (Postfix) with ESMTP id C7EDA6DE597A\r
+ for <notmuch@notmuchmail.org>; Sun, 14 Aug 2016 07:35:42 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at cworth.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.579\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.579 tagged_above=-999 required=5 tests=[AWL=0.141,\r
+  DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_LOW=-0.7,\r
+ RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01] autolearn=disabled\r
+Received: from arlo.cworth.org ([127.0.0.1])\r
+ by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id lj-HbP3oZFSz for <notmuch@notmuchmail.org>;\r
+ Sun, 14 Aug 2016 07:35:35 -0700 (PDT)\r
+Received: from mail-wm0-f45.google.com (mail-wm0-f45.google.com\r
+ [74.125.82.45]) by arlo.cworth.org (Postfix) with ESMTPS id 2D5B96DE7237 for\r
+ <notmuch@notmuchmail.org>; Sun, 14 Aug 2016 06:47:24 -0700 (PDT)\r
+Received: by mail-wm0-f45.google.com with SMTP id o80so59122292wme.1\r
+ for <notmuch@notmuchmail.org>; Sun, 14 Aug 2016 06:47:23 -0700 (PDT)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+ d=nikula-org.20150623.gappssmtp.com; s=20150623;\r
+ h=from:to:cc:subject:in-reply-to:references:date:message-id\r
+ :mime-version; bh=/ctPQAywCT0RKYePjJirp7xE2ziZiA+bcisfsCHf7F4=;\r
+ b=Vvtqd8li7VjFRQvyZ3Mejv0+u3eqz4FppgBRFxsVujQX6GNvxoX/YI0fGtenMJQw9G\r
+ 43mlMCKm6DZGfCbmN6osbX1pYKO32ACJLmi6iLIaQeLrnjgZj23XYQYCZMgda8zOAfqn\r
+ utOyaDPjVceceNRjZcvOJeJ8fdQeB97ssQmOqWGvUSOFmSLXILypLnjKCa0TszusAX8p\r
+ YVeeJZnnP+rvI2pddIWCBq+S/sHrd2VQiNCgy8muF70f+KNqW+q1xcEVQrbfLAUUt0TR\r
+ CLswOq/1DqD8gmsyaCfqXz0B3Dxf08ocX2MSr2OMS+btYNvRbrYXXFBQA4e566pHPmT8\r
+ RjEA==\r
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+ d=1e100.net; s=20130820;\r
+ h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date\r
+ :message-id:mime-version;\r
+ bh=/ctPQAywCT0RKYePjJirp7xE2ziZiA+bcisfsCHf7F4=;\r
+ b=AozkeiUMMdzr7qrLDV8pgFjf0y7P2c6zbx6zN13iIzOLuaU+X/JHmIpDUkPhgUeWy5\r
+ b+5EUIlQUTDEzSg84end0CNV4Qderc0g+YmDnoF6RVmXE352CkCIiIoA9Gx95D5GEoLq\r
+ Vb7XbXD5WmakQIyG9uh14+o9at7ihFAVy/IKEPw4xabjpxTaI5ijUt7lKGGfqdcp5Vyy\r
+ l9Ty4hHJlmf+pQH9BczSqvsLbQIdbfIMjn7bdNaP1y3glyKffOrTfa2vInV5P0eg7i7c\r
+ rNfwnCAgDh8ni5vvz7HtA/MBLqRt0Xeqp0XleM/h85E+T2HjpDtUeNk8aG5Cbli0Qrnk\r
+ msyw==\r
+X-Gm-Message-State:\r
+ AEkoouuMdyzeh2GkDvhjIOnGByXuRh0SAZtzRjDbtci3Mrtn+xDjsUfson4x3Clp5DLB/g==\r
+X-Received: by 10.194.149.133 with SMTP id ua5mr24547490wjb.79.1471182433670; \r
+ Sun, 14 Aug 2016 06:47:13 -0700 (PDT)\r
+Received: from localhost (mobile-access-bcee63-250.dhcp.inet.fi.\r
+ [188.238.99.250])\r
+ by smtp.gmail.com with ESMTPSA id uo4sm16706922wjc.36.2016.08.14.06.47.12\r
+ (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\r
+ Sun, 14 Aug 2016 06:47:12 -0700 (PDT)\r
+From: Jani Nikula <jani@nikula.org>\r
+To: Shea Levy <shea@shealevy.com>, notmuch@notmuchmail.org\r
+Subject: Re: [PATCH 0/4] Allow specifying alternate names for addresses in\r
+ other_email\r
+In-Reply-To: <874m6no4mm.fsf@nikula.org>\r
+References: <1470776118-5070-1-git-send-email-shea@shealevy.com>\r
+ <87k2fk98yh.fsf@nikula.org>\r
+ <87oa4vtta4.fsf@shlevy-laptop.i-did-not-set--mail-host-address--so-tickle-me>\r
+ <874m6no4mm.fsf@nikula.org>\r
+Date: Sun, 14 Aug 2016 16:45:47 +0300\r
+Message-ID: <871t1ro450.fsf@nikula.org>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.20\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <https://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch/>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <https://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Sun, 14 Aug 2016 14:35:43 -0000\r
+\r
+On Sun, 14 Aug 2016, Jani Nikula <jani@nikula.org> wrote:\r
+> I think we should use gmime for this, and expect the configuration to be\r
+> a comma separated list of addresses, specifically in the format that\r
+> internet_address_list_parse_string() parses [2].\r
+\r
+Here's a little sample to get started and play around. Build using\r
+something along the lines of:\r
+\r
+gcc $(pkg-config --cflags gmime-2.6 --libs gmime-2.6) internetaddress.c\r
+\r
+You can try e.g.\r
+\r
+$ ./a.out "J. Random Hacker <jrh@example.org>, dude@example.org, \"Hacker, J. Random\" <hacker@example.com>"\r
+name[0]: J. Random Hacker\r
+addr[0]: jrh@example.org\r
+name[1]: (null)\r
+addr[1]: dude@example.org\r
+name[2]: Hacker, J. Random\r
+addr[2]: hacker@example.com\r
+\r
+----------->%----------\r
+\r
+#include <stdio.h>\r
+#include <stdlib.h>\r
+#include <stdbool.h>\r
+\r
+#include <gmime/gmime.h>\r
+\r
+int main(int argc, char *argv[])\r
+{\r
+       InternetAddressList *list;\r
+       InternetAddress *mailbox;\r
+       int i;\r
+\r
+       if (argc != 2) {\r
+               fprintf(stderr, "usage: %s address-list\n", argv[0]);\r
+               return EXIT_FAILURE;\r
+       }\r
+\r
+       list = internet_address_list_parse_string(argv[1]);\r
+\r
+       for (i = 0; i < internet_address_list_length(list); i++) {\r
+               InternetAddress *addr;\r
+               InternetAddressMailbox *mbox;\r
+\r
+               addr = internet_address_list_get_address(list, i);\r
+\r
+               if (INTERNET_ADDRESS_IS_GROUP(addr)) {\r
+                       printf("[%d] is a group, ignoring\n", i);\r
+                       continue;\r
+               }\r
+\r
+               mbox = INTERNET_ADDRESS_MAILBOX(addr);\r
+\r
+               printf("name[%d]: %s\n", i, internet_address_get_name(addr));\r
+               printf("addr[%d]: %s\n", i, internet_address_mailbox_get_addr(mbox));\r
+       }\r
+\r
+       return EXIT_SUCCESS;    \r
+}\r