Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id CDB9C429E27 for ; Sat, 12 Nov 2011 23:01:47 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.799 X-Spam-Level: X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id a74mgQqxpgqm for ; Sat, 12 Nov 2011 23:01:47 -0800 (PST) Received: from mail-bw0-f53.google.com (mail-bw0-f53.google.com [209.85.214.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id D1B39431FB6 for ; Sat, 12 Nov 2011 23:01:46 -0800 (PST) Received: by bkaq10 with SMTP id q10so5701533bka.26 for ; Sat, 12 Nov 2011 23:01:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:in-reply-to:references:user-agent:date :message-id:mime-version:content-type; bh=ML8sLXkUZZ5UrDjWgkOTeCS2KpkJ2CSnbqHw8KhqcbA=; b=jQVKRbhwdVjH4btK9e+WEo94MGfEJGDPiIKb4W7UW5MQDIdNtsWJ9zCzbEr6koftOF 7SsuE6gUDY5GwFVxGpfNK1g7VnLCpTOtb36j/NWUKOZpH3doP7SHBNz9HjZA5PLOQd10 KvHyuqoItaKsxSrZUMtvmy0gFu7sBhE2ErdVU= Received: by 10.204.155.152 with SMTP id s24mr14330188bkw.5.1321167699670; Sat, 12 Nov 2011 23:01:39 -0800 (PST) Received: from localhost ([91.144.186.21]) by mx.google.com with ESMTPS id j9sm23233378bkd.2.2011.11.12.23.01.37 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 12 Nov 2011 23:01:38 -0800 (PST) From: Dmitry Kurochkin To: Tomi Ollila , Austin Clements Subject: Re: [PATCH] test: attempt to send QUIT to smtp-dummy in case mail send failed In-Reply-To: References: <20111112024941.GY2658@mit.edu> <20111112154128.GB2658@mit.edu> User-Agent: Notmuch/0.9+55~g81c615b (http://notmuchmail.org) Emacs/23.3.1 (x86_64-pc-linux-gnu) Date: Sun, 13 Nov 2011 11:01:24 +0400 Message-ID: <8739ds33qz.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: notmuch@notmuchmail.org X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Nov 2011 07:01:48 -0000 On Sat, 12 Nov 2011 23:07:38 +0200, Tomi Ollila wrote: > On Sat, 12 Nov 2011 10:41:28 -0500, Austin Clements wrote: > > > > Actually, since sending mail is synchronous, there shouldn't be any > > issues with buffering or timing. If Emacs successfully sends the > > message, it will wait for the OK response (`smtpmail-via-smtp'), which > > should indicate that the message is in stable storage on the SMTP > > server (this is rather fundamental to SMTP's reliability as a > > protocol, after all). Thus, the smtp-dummy *should* be done by the > > time Emacs exits. If Emacs fails to send the message, then it doesn't > > really matter and you just want the smtp-dummy to go away. > > > > I say "should" because smtp-dummy needs a one line patch to add an > > fflush at the end of receive_data_to_file. Any real SMTP server would > > do this (not to mention a full fsync) before acknowledging the > > message. > > SO, in our cases there are 2 options: > > > 1) add line > { echo QUIT > /dev/tcp/127.0.0.1/25025; } 2>/dev/null > before > wait ${smtp_dummy_pid} > > in test-lib.sh > > > 2) add line > kill ${smtp_dummy_pid} > before > wait ${smtp_dummy_pid} > > in test-lib.sh *and* add that fflush (output) before free (line) in > smtp-dummy.c function receive_data_to_file. > > folks! opinions! > I think we should add fflush(3) call to smtp-dummy in any case. As for sending QUIT over TCP vs kill, I prefer the former. On one hand, kill is more reliable. But smtp-dummy must handle QUIT and it is a bug if it does not. An unrelated issue: currently we discard test_emacs output in emacs_deliver_message and other cases. Ideally we should not do that because it may contain useful information. We should capture the output and print it in case of error, at least. Regards, Dmitry > Tomi > _______________________________________________ > notmuch mailing list > notmuch@notmuchmail.org > http://notmuchmail.org/mailman/listinfo/notmuch