Re: [PATCH] test: attempt to send QUIT to smtp-dummy in case mail send failed
authorAustin Clements <amdragon@MIT.EDU>
Sat, 12 Nov 2011 15:41:28 +0000 (10:41 +1900)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:40:06 +0000 (09:40 -0800)
11/f31ef218f6cfb9c8e2ecee3eba16ab1829d223 [new file with mode: 0644]

diff --git a/11/f31ef218f6cfb9c8e2ecee3eba16ab1829d223 b/11/f31ef218f6cfb9c8e2ecee3eba16ab1829d223
new file mode 100644 (file)
index 0000000..fe3c7a5
--- /dev/null
@@ -0,0 +1,106 @@
+Return-Path: <amdragon@mit.edu>\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 A706E429E27\r
+       for <notmuch@notmuchmail.org>; Sat, 12 Nov 2011 07:39:09 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+       tests=[RCVD_IN_DNSWL_LOW=-0.7] 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 E09cNK2oXewj for <notmuch@notmuchmail.org>;\r
+       Sat, 12 Nov 2011 07:39:09 -0800 (PST)\r
+Received: from dmz-mailsec-scanner-8.mit.edu (DMZ-MAILSEC-SCANNER-8.MIT.EDU\r
+       [18.7.68.37])\r
+       by olra.theworths.org (Postfix) with ESMTP id 1E0EA429E25\r
+       for <notmuch@notmuchmail.org>; Sat, 12 Nov 2011 07:39:09 -0800 (PST)\r
+X-AuditID: 12074425-b7f116d0000008fe-a8-4ebe931c3115\r
+Received: from mailhub-auth-4.mit.edu ( [18.7.62.39])\r
+       by dmz-mailsec-scanner-8.mit.edu (Symantec Messaging Gateway) with SMTP\r
+       id 82.2D.02302.C139EBE4; Sat, 12 Nov 2011 10:39:08 -0500 (EST)\r
+Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])\r
+       by mailhub-auth-4.mit.edu (8.13.8/8.9.2) with ESMTP id pACFd7wt031744; \r
+       Sat, 12 Nov 2011 10:39:08 -0500\r
+Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91])\r
+       (authenticated bits=0)\r
+       (User authenticated as amdragon@ATHENA.MIT.EDU)\r
+       by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id pACFd5Tq002141\r
+       (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
+       Sat, 12 Nov 2011 10:39:06 -0500 (EST)\r
+Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.77)\r
+       (envelope-from <amdragon@mit.edu>)\r
+       id 1RPFhw-0006rU-WA; Sat, 12 Nov 2011 10:41:29 -0500\r
+Date: Sat, 12 Nov 2011 10:41:28 -0500\r
+From: Austin Clements <amdragon@MIT.EDU>\r
+To: 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
+Message-ID: <20111112154128.GB2658@mit.edu>\r
+References: <yf6ipmr7dki.fsf@taco2.nixu.fi> <20111112024941.GY2658@mit.edu>\r
+       <yf662iplkv3.fsf@taco2.nixu.fi>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+Content-Disposition: inline\r
+In-Reply-To: <yf662iplkv3.fsf@taco2.nixu.fi>\r
+User-Agent: Mutt/1.5.21 (2010-09-15)\r
+X-Brightmail-Tracker:\r
+ H4sIAAAAAAAAA+NgFupnleLIzCtJLcpLzFFi42IRYrdT15WZvM/PYOYRHovrN2cyW7xZOY/V\r
+       gcnj8NeFLB7PVt1iDmCK4rJJSc3JLEst0rdL4MqYtXsLW8Fzrorv7cuYGxgvcnQxcnJICJhI\r
+       vPnTxQRhi0lcuLeerYuRi0NIYB+jxK+f7UwQzgZGic9zeqCck0wSLw5/YIFwljBKTFt/gR2k\r
+       n0VAVeL7u/mMIDabgIbEtv3LwWwRARWJB23rWUFsZgFpiW+/m8H2CQtESOw7v4UNxOYV0JY4\r
+       cvsj0FAOoKH5Ele210CEBSVOznzCAtGqJXHj30smkBKQMcv/gX3AKaAj8WrPbbApokCbppzc\r
+       xjaBUWgWku5ZSLpnIXQvYGRexSibklulm5uYmVOcmqxbnJyYl5dapGuhl5tZopeaUrqJERzW\r
+       Lqo7GCccUjrEKMDBqMTDuyBpr58Qa2JZcWXuIUZJDiYlUd71E/f5CfEl5adUZiQWZ8QXleak\r
+       Fh9ilOBgVhLhXW0HlONNSaysSi3Kh0lJc7AoifO+3uHgJySQnliSmp2aWpBaBJOV4eBQkuBd\r
+       PwmoUbAoNT21Ii0zpwQhzcTBCTKcB2j4bJAa3uKCxNzizHSI/ClGXY51V5pPMwqx5OXnpUqJ\r
+       8zaCFAmAFGWU5sHNgaWjV4ziQG8J86qCVPEAUxncpFdAS5iAlrAo7AVZUpKIkJJqYPR3nx9y\r
+       LSIgksttXgDntm9++TzTFEVE7Z8nCG2Iqr2XET1zjYp2tvKzI+vd7nFs+ZDbkl9z8d3Bee4P\r
+       Ytmqvq//rCk9v/GYnfy9PSdEixdMPFjALif6UvPUmedrjGO+7qhXqtN5qn5lT/CVHfpSey9e\r
+       8GcSblNh1Dj9Wdvty2WHbrUTtdbCckosxRmJhlrMRcWJAJoDqmoiAwAA\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 15:39:09 -0000\r
+\r
+Quoth Tomi Ollila on Nov 12 at 12:02 pm:\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
+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