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 21:07:38 +0000 (23:07 +0200)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:40:06 +0000 (09:40 -0800)
a3/94b28dae7a7a8503ac9decb458d8b46bcdb5f2 [new file with mode: 0644]

diff --git a/a3/94b28dae7a7a8503ac9decb458d8b46bcdb5f2 b/a3/94b28dae7a7a8503ac9decb458d8b46bcdb5f2
new file mode 100644 (file)
index 0000000..9618451
--- /dev/null
@@ -0,0 +1,93 @@
+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 80E4B429E25\r
+       for <notmuch@notmuchmail.org>; Sat, 12 Nov 2011 13:07:45 -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 qNeNYV+zIF8m for <notmuch@notmuchmail.org>;\r
+       Sat, 12 Nov 2011 13:07:44 -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 9F4FF431FB6\r
+       for <notmuch@notmuchmail.org>; Sat, 12 Nov 2011 13:07:44 -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
+       pACL7cY0004171; Sat, 12 Nov 2011 23:07:40 +0200\r
+From: Tomi Ollila <tomi.ollila@iki.fi>\r
+To: Austin Clements <amdragon@MIT.EDU>\r
+Subject: Re: [PATCH] test: attempt to send QUIT to smtp-dummy in case mail\r
+       send failed\r
+In-Reply-To: <20111112154128.GB2658@mit.edu>\r
+References: <yf6ipmr7dki.fsf@taco2.nixu.fi> <20111112024941.GY2658@mit.edu>\r
+       <yf662iplkv3.fsf@taco2.nixu.fi> <20111112154128.GB2658@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 23:07:38 +0200\r
+Message-ID: <yf639dthwx1.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 21:07:45 -0000\r
+\r
+On Sat, 12 Nov 2011 10:41:28 -0500, Austin Clements <amdragon@MIT.EDU> wrote:\r
+> \r
+> Actually, since sending mail is synchronous, there shouldn't be any\r
+> issues with buffering or timing.  If Emacs successfully sends the\r
+> message, it will wait for the OK response (`smtpmail-via-smtp'), which\r
+> should indicate that the message is in stable storage on the SMTP\r
+> server (this is rather fundamental to SMTP's reliability as a\r
+> protocol, after all).  Thus, the smtp-dummy *should* be done by the\r
+> time Emacs exits.  If Emacs fails to send the message, then it doesn't\r
+> really matter and you just want the smtp-dummy to go away.\r
+> \r
+> I say "should" because smtp-dummy needs a one line patch to add an\r
+> fflush at the end of receive_data_to_file.  Any real SMTP server would\r
+> do this (not to mention a full fsync) before acknowledging the\r
+> message.\r
+\r
+SO, in our cases there are 2 options:\r
+\r
+\r
+1) add line \r
+       { echo QUIT > /dev/tcp/127.0.0.1/25025; } 2>/dev/null\r
+  before \r
+       wait ${smtp_dummy_pid}\r
+\r
+in test-lib.sh\r
+\r
+\r
+2) add line\r
+       kill ${smtp_dummy_pid}\r
+  before \r
+       wait ${smtp_dummy_pid}\r
+\r
+in test-lib.sh *and* add that fflush (output) before free (line) in \r
+smtp-dummy.c function receive_data_to_file.\r
+\r
+folks! opinions!\r
+\r
+Tomi\r