Re: [PATCH] test: attempt to send QUIT to smtp-dummy in case mail send failed
authorDmitry Kurochkin <dmitry.kurochkin@gmail.com>
Sun, 13 Nov 2011 07:01:24 +0000 (11:01 +0400)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:40:07 +0000 (09:40 -0800)
96/29aec22bc93c1706ce74ad47b67707b848c75d [new file with mode: 0644]

diff --git a/96/29aec22bc93c1706ce74ad47b67707b848c75d b/96/29aec22bc93c1706ce74ad47b67707b848c75d
new file mode 100644 (file)
index 0000000..9a68778
--- /dev/null
@@ -0,0 +1,124 @@
+Return-Path: <dmitry.kurochkin@gmail.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 CDB9C429E27\r
+       for <notmuch@notmuchmail.org>; Sat, 12 Nov 2011 23:01:47 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.799\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5\r
+       tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+       FREEMAIL_FROM=0.001, 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 a74mgQqxpgqm for <notmuch@notmuchmail.org>;\r
+       Sat, 12 Nov 2011 23:01:47 -0800 (PST)\r
+Received: from mail-bw0-f53.google.com (mail-bw0-f53.google.com\r
+       [209.85.214.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id D1B39431FB6\r
+       for <notmuch@notmuchmail.org>; Sat, 12 Nov 2011 23:01:46 -0800 (PST)\r
+Received: by bkaq10 with SMTP id q10so5701533bka.26\r
+       for <notmuch@notmuchmail.org>; Sat, 12 Nov 2011 23:01:44 -0800 (PST)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;\r
+       h=from:to:cc:subject:in-reply-to:references:user-agent:date\r
+       :message-id:mime-version:content-type;\r
+       bh=ML8sLXkUZZ5UrDjWgkOTeCS2KpkJ2CSnbqHw8KhqcbA=;\r
+       b=jQVKRbhwdVjH4btK9e+WEo94MGfEJGDPiIKb4W7UW5MQDIdNtsWJ9zCzbEr6koftOF\r
+       7SsuE6gUDY5GwFVxGpfNK1g7VnLCpTOtb36j/NWUKOZpH3doP7SHBNz9HjZA5PLOQd10\r
+       KvHyuqoItaKsxSrZUMtvmy0gFu7sBhE2ErdVU=\r
+Received: by 10.204.155.152 with SMTP id s24mr14330188bkw.5.1321167699670;\r
+       Sat, 12 Nov 2011 23:01:39 -0800 (PST)\r
+Received: from localhost ([91.144.186.21])\r
+       by mx.google.com with ESMTPS id j9sm23233378bkd.2.2011.11.12.23.01.37\r
+       (version=TLSv1/SSLv3 cipher=OTHER);\r
+       Sat, 12 Nov 2011 23:01:38 -0800 (PST)\r
+From: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>\r
+To: Tomi Ollila <tomi.ollila@iki.fi>, 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: <yf639dthwx1.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>\r
+User-Agent: Notmuch/0.9+55~g81c615b (http://notmuchmail.org) Emacs/23.3.1\r
+       (x86_64-pc-linux-gnu)\r
+Date: Sun, 13 Nov 2011 11:01:24 +0400\r
+Message-ID: <8739ds33qz.fsf@gmail.com>\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: Sun, 13 Nov 2011 07:01:48 -0000\r
+\r
+On Sat, 12 Nov 2011 23:07:38 +0200, Tomi Ollila <tomi.ollila@iki.fi> wrote:\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
+\r
+I think we should add fflush(3) call to smtp-dummy in any case.\r
+\r
+As for sending QUIT over TCP vs kill, I prefer the former.  On one hand,\r
+kill is more reliable.  But smtp-dummy must handle QUIT and it is a bug\r
+if it does not.\r
+\r
+An unrelated issue: currently we discard test_emacs output in\r
+emacs_deliver_message and other cases.  Ideally we should not do that\r
+because it may contain useful information.  We should capture the output\r
+and print it in case of error, at least.\r
+\r
+Regards,\r
+  Dmitry\r
+\r
+> Tomi\r
+> _______________________________________________\r
+> notmuch mailing list\r
+> notmuch@notmuchmail.org\r
+> http://notmuchmail.org/mailman/listinfo/notmuch\r