[PATCH v2] test: attempt to send QUIT to smtp-dummy in case mail send failed
authorTomi Ollila <tomi.ollila@iki.fi>
Wed, 16 Nov 2011 21:25:19 +0000 (23:25 +0200)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:40:15 +0000 (09:40 -0800)
6f/3136057e0f7de56ea1b29bd9d48ab00d75ea42 [new file with mode: 0644]

diff --git a/6f/3136057e0f7de56ea1b29bd9d48ab00d75ea42 b/6f/3136057e0f7de56ea1b29bd9d48ab00d75ea42
new file mode 100644 (file)
index 0000000..4fb264d
--- /dev/null
@@ -0,0 +1,84 @@
+Return-Path: <tomi.ollila@nixu.com>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id C9E2A429E21\r
+       for <notmuch@notmuchmail.org>; Wed, 16 Nov 2011 13:25:21 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
+       autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id qciBuYLynhox for <notmuch@notmuchmail.org>;\r
+       Wed, 16 Nov 2011 13:25:21 -0800 (PST)\r
+Received: from taco2.nixu.fi (taco2.nixu.fi [194.197.118.31])\r
+       (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 0BA8F431FD0\r
+       for <notmuch@notmuchmail.org>; Wed, 16 Nov 2011 13:25:20 -0800 (PST)\r
+Received: from taco2.nixu.fi (taco2.nixu.fi [194.197.118.31])\r
+       by taco2.nixu.fi (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id\r
+       pAGLPJv1010829\r
+       for <notmuch@notmuchmail.org>; Wed, 16 Nov 2011 23:25:19 +0200\r
+From: Tomi Ollila <tomi.ollila@iki.fi>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH v2] test: attempt to send QUIT to smtp-dummy in case mail send\r
+       failed\r
+In-Reply-To: <yf6mxc0za1u.fsf@taco2.nixu.fi>\r
+References: <yf6ipmr7dki.fsf@taco2.nixu.fi> <20111112024941.GY2658@mit.edu>\r
+       <yf662iplkv3.fsf@taco2.nixu.fi> <20111112154128.GB2658@mit.edu>\r
+       <yf639dthwx1.fsf@taco2.nixu.fi> <8739ds33qz.fsf@gmail.com>\r
+       <yf6mxc0za1u.fsf@taco2.nixu.fi>\r
+User-Agent: Notmuch/0.9+73~ged20210 (http://notmuchmail.org) Emacs/23.3.1\r
+       (i686-pc-linux-gnu)\r
+X-Face: HhBM'cA~<r"^Xv\KRN0P{vn'Y"Kd;zg_y3S[4)KSN~s?O\"QPoL\r
+       $[Xv_BD:i/F$WiEWax}R(MPS`^UaptOGD`*/=@\1lKoVa9tnrg0TW?"r7aRtgk[F\r
+       !)g;OY^,BjTbr)Np:%c_o'jj,Z\r
+Date: Wed, 16 Nov 2011 23:25:19 +0200\r
+Message-ID: <yf639dnsqtc.fsf@taco2.nixu.fi>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://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: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Wed, 16 Nov 2011 21:25:21 -0000\r
+\r
+If mail sending from emacs fails before it has chance to connect\r
+to the smtp-dummy mail server, the opportunistic QUIT message\r
+sending makes smtp-dummy to exit.\r
+---\r
+\r
+Version 2 of the same feature. Now uses BASH's /dev/tcp/host/port \r
+feature instead of external 'nc' command.\r
+\r
+ test/test-lib.sh |    2 ++\r
+ 1 files changed, 2 insertions(+), 0 deletions(-)\r
+\r
+diff --git a/test/test-lib.sh b/test/test-lib.sh\r
+index 1ea7fa9..749d087 100755\r
+--- a/test/test-lib.sh\r
++++ b/test/test-lib.sh\r
+@@ -395,6 +395,8 @@ emacs_deliver_message ()\r
+          (insert \"${body}\")\r
+          $@\r
+          (message-send-and-exit))"\r
++    # opportunistically quit smtp-dummy in case above fails.\r
++    { echo QUIT > /dev/tcp/localhost/25025; } 2>/dev/null\r
+     wait ${smtp_dummy_pid}\r
+     notmuch new >/dev/null\r
+ }\r
+--\r
+1.7.7.3\r
+\r