From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Felix Dietrich Newsgroups: gmane.emacs.help Subject: Re: How I am handling msmtp queues Date: Fri, 11 Mar 2022 15:55:48 +0100 Message-ID: <87ilskedxn.fsf@sperrhaken.name> References: <87lexhbwx9.fsf@sperrhaken.name> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13967"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Fri Mar 11 15:56:29 2022 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nSggu-0003S6-Mp for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 11 Mar 2022 15:56:28 +0100 Original-Received: from localhost ([::1]:37478 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nSggt-0007Vb-Fc for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 11 Mar 2022 09:56:27 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:51062) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nSggV-0007Ti-LI for help-gnu-emacs@gnu.org; Fri, 11 Mar 2022 09:56:03 -0500 Original-Received: from mout.kundenserver.de ([212.227.126.131]:37363) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nSggT-0007kP-Mk for help-gnu-emacs@gnu.org; Fri, 11 Mar 2022 09:56:03 -0500 Original-Received: from localhost ([77.11.80.169]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MyvFC-1oNPtk353S-00vvaI for ; Fri, 11 Mar 2022 15:55:58 +0100 In-Reply-To: (Jean Louis's message of "Thu, 10 Mar 2022 21:51:28 +0300") X-Provags-ID: V03:K1:DlCLWeuPuOCQ3q+mRMPvHRv6WQv15VPruNngCKvWtG6YrtYK342 d6VJPXrIZWI+ULhSBC0cWTSbtxsAJK44Myywv5vJj6g/u/HRpsh0N6YB/DQj0Rd6QUFfSxT B0eZPEImY6kam9OtCWerSkOKndCo8yvpD2J7IgQBadEVqpR35vEsjAblScFNwGYtswwlCJU m17ynqGfo7k+SY8PDgBdg== X-UI-Out-Filterresults: notjunk:1;V03:K0:mPtyQTZHqJs=:i6k6fhfOc/mg2ZUDG0KtRL ufuaaFW4D+2g1JIygt41A+qAH35FD/7ffc/hhNTTq6FECsr4T8DJ+FMHxcpCW8rR//Joqvnjz dygepZ32WjE5GD3IBN8uvTNBUf3YSQ0ThskNL8K+Sensm6ynAGUNrCWh7JRnAAsNivQGLkS04 3OGCt9T1i9hRUYmojVhevbDkkIU7uXC8Olalt5BsEMRG5fcV48OdTIJEFWbmixVrs0H8l5iMG qT0OwSgBQlYsNyVXxDPQjkpTVffceAVjWWttQXfY0byVsUksfESwK98CGa+ccV1kcBVtwCazY uuCI76wowczlg1e9V3doBOhZXlbzVg95Dv7rXZT9ENKDb5IE1nIOlcONrAak2/dL7ev4z9k/3 j5aRRpahiit3G4MT3FvNpenFrrb/pF8NyInc23J01Ixe14nlRs3O0Mw8z61u9M4giz3g5QwCt UPWelroteWkkYT+z7Vuwe9xPMh9APW6El4344nhnv0lL/qpW/7wjG0w52f2bc2ea4AJv0m9bS oIT7S9i/5m0fiXpAl6vCgana6CJyGyyy7oCAAgCQWQnZmopYMZ7HPugbpoqDhLAusfGBV+2qS YA2tfIjcRYIrYg+N4vfFMDFT53si12Ujk7GANR6Xs5FATFtRJLSf3ePGkLLrA6qXntud72l+n Yth+cKc6DVmalj8GtcVW9bRow6aLCXVqQ5hOflW+s+K22I2DbbY07Uj3NXyMETdLj62Uf6ojM Kn5uYh5z8Th8G/Nw Received-SPF: none client-ip=212.227.126.131; envelope-from=felix.dietrich@sperrhaken.name; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:136452 Archived-At: Jean Louis writes: > * Felix Dietrich [2022-03-10 19:33]: >> Jean Louis writes: >>> msmtp-runqueue.sh >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >>> >>> #!/usr/bin/env bash >>> >>> QUEUEDIR=3D"$HOME/.msmtpqueue" >>> LOCKFILE=3D"$QUEUEDIR/.lock" >>> MAXWAIT=3D120 >>> >>> OPTIONS=3D$@ >>> >>> # wait for a lock that another instance has set >>> WAIT=3D0 >>> while [ -e "$LOCKFILE" -a "$WAIT" -lt "$MAXWAIT" ]; do >>> >>> # [=E2=80=A6] >>> >>> # lock the $QUEUEDIR >>> touch "$LOCKFILE" || exit 1 >>> >>> # [=E2=80=A6] I think your lock file handling is not race free. There are lock file helpers that you may find useful. On Debian, for example: $ apt-file find bin/lockfile lockfile-progs: /usr/bin/lockfile-check=20=20=20 lockfile-progs: /usr/bin/lockfile-create lockfile-progs: /usr/bin/lockfile-remove lockfile-progs: /usr/bin/lockfile-touch procmail: /usr/bin/lockfile >>> while [ -e "$LOCKFILE" -a "$WAIT" -lt "$MAXWAIT" ]; do The general advice for the test command=CA=BCs operators "-a" and "-o" is to not use them (they have been marked obsolescent) but instead the shell=CA= =BCs operators "&&" and "||", respectively [1]: while [ -e "$LOCKFILE" ] && [ "$WAIT" -lt "$MAXWAIT" ]; do > OpenSMTPD is good of course. Though it does not handle queue as well > as Courier MTA and has some problems, it is still in development. I > have many emails, many people, so it gives me experience with it. What issues did you encounter with OpenSMTPD? Footnotes: [1] See the note at the description for "-a" and "-o" as well as the section =E2=80=9CAPPLICATION USAGE=E2=80=9D in the following document: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/test.html --=20 Felix Dietrich