Re: [PATCH] test: attempt to send QUIT to smtp-dummy in case mail send failed
authorTomi Ollila <tomi.ollila@iki.fi>
Sat, 12 Nov 2011 10:02:08 +0000 (12:02 +0200)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:40:06 +0000 (09:40 -0800)
0c/04c24bd0a4fa67b484ca86708690b37fb5a168 [new file with mode: 0644]

diff --git a/0c/04c24bd0a4fa67b484ca86708690b37fb5a168 b/0c/04c24bd0a4fa67b484ca86708690b37fb5a168
new file mode 100644 (file)
index 0000000..9b83a70
--- /dev/null
@@ -0,0 +1,94 @@
+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 5F83B429E25\r
+       for <notmuch@notmuchmail.org>; Sat, 12 Nov 2011 02:02:19 -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 5caut7ue2Nil for <notmuch@notmuchmail.org>;\r
+       Sat, 12 Nov 2011 02:02:18 -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 A2E70431FB6\r
+       for <notmuch@notmuchmail.org>; Sat, 12 Nov 2011 02:02:18 -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
+       pACA28nN005072; Sat, 12 Nov 2011 12:02:08 +0200\r
+From: Tomi Ollila <tomi.ollila@iki.fi>\r
+To: Austin Clements <amdragon@MIT.EDU>, Tomi Ollila <tomi.ollila@iki.fi>\r
+Subject: Re: [PATCH] test: attempt to send QUIT to smtp-dummy in case mail\r
+       send failed\r
+In-Reply-To: <20111112024941.GY2658@mit.edu>\r
+References: <yf6ipmr7dki.fsf@taco2.nixu.fi> <20111112024941.GY2658@mit.edu>\r
+User-Agent: Notmuch/0.9+23~g556c5fa (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: Sat, 12 Nov 2011 12:02:08 +0200\r
+Message-ID: <yf662iplkv3.fsf@taco2.nixu.fi>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+Cc: notmuch@notmuchmail.org\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: Sat, 12 Nov 2011 10:02:19 -0000\r
+\r
+On Fri, 11 Nov 2011 21:49:41 -0500, Austin Clements <amdragon@MIT.EDU> wrote:\r
+> Good idea, but this introduces a dependency on netcat.  Would it work\r
+> to simply kill the SMTP dummy?\r
+\r
+I cannot guarantee 6 nines of probability (but can guarantee as many eights\r
+as one migh wish ;)\r
+\r
+Socket buffering and timing might cause smtp dummy to be killed before\r
+it has read all content...\r
+\r
+But... i recall bash has a way to do tcp stuff .../dev/tcp/host/port\r
+is mentioned in manual page.\r
+I'll investigate this later (or, anyone of you, provide a patch :)\r
+\r
+Tomi\r
+\r
+> Quoth Tomi Ollila on Nov 11 at  1:38 am:\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
+> >  test/test-lib.sh |    8 +++++---\r
+> >  1 files changed, 5 insertions(+), 3 deletions(-)\r
+> > \r
+> > diff --git a/test/test-lib.sh b/test/test-lib.sh\r
+> > index af723ad..57cb088 100755\r
+> > @@ -397,6 +397,8 @@ emacs_deliver_message ()\r
+> >       (insert \"${body}\")\r
+> >       $@\r
+> >       (message-send-and-exit))" >/dev/null 2>&1\r
+> > +    # opportunistically quit smtp-dummy in case above fails.\r
+> > +    echo QUIT | nc 127.0.0.1 25025 >/dev/null 2>&1\r
+> >      wait ${smtp_dummy_pid}\r
+> >      notmuch new >/dev/null\r
+> >  }\r
+> _______________________________________________\r
+> notmuch mailing list\r
+> notmuch@notmuchmail.org\r
+> http://notmuchmail.org/mailman/listinfo/notmuch\r
+> \r