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 80E4B429E25 for ; Sat, 12 Nov 2011 13:07:45 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] 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 qNeNYV+zIF8m for ; Sat, 12 Nov 2011 13:07:44 -0800 (PST) Received: from taco2.nixu.fi (taco2.nixu.fi [194.197.118.31]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 9F4FF431FB6 for ; Sat, 12 Nov 2011 13:07:44 -0800 (PST) Received: from taco2.nixu.fi (taco2.nixu.fi [194.197.118.31]) by taco2.nixu.fi (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id pACL7cY0004171; Sat, 12 Nov 2011 23:07:40 +0200 From: Tomi Ollila To: Austin Clements Subject: Re: [PATCH] test: attempt to send QUIT to smtp-dummy in case mail send failed In-Reply-To: <20111112154128.GB2658@mit.edu> References: <20111112024941.GY2658@mit.edu> <20111112154128.GB2658@mit.edu> User-Agent: Notmuch/0.9+23~g556c5fa (http://notmuchmail.org) Emacs/23.3.1 (i686-pc-linux-gnu) X-Face: HhBM'cA~ 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: Sat, 12 Nov 2011 21:07:45 -0000 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! Tomi