From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 29791 invoked from network); 20 Feb 2021 13:22:25 -0000 Received: from 1ess.inri.net (216.126.196.35) by inbox.vuxu.org with ESMTPUTF8; 20 Feb 2021 13:22:25 -0000 Received: from oat.nine.sirjofri.de ([5.45.105.127]) by 1ess; Sat Feb 20 08:17:08 -0500 2021 Message-ID: <9900841C0B876FC9E53FAC05828DADFA@sirjofri.de> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit To: 9front@9front.org Date: Sat, 20 Feb 2021 14:16:53 +0100 From: sirjofri In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="upas-kbnxydoadswlscajpsgakobprj" List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: encrypted interface-aware base high-performance frontend Subject: Re: [9front] [Patch] Mail fails to send attachments Reply-To: 9front@9front.org Precedence: bulk This is a multi-part message in MIME format. --upas-kbnxydoadswlscajpsgakobprj Content-Disposition: inline Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Save outgoing files in user mailbox, fixes closed pipe bug I noticed it is no closed pipe, but the constructed foldername for the save location was built using the upasname variable, which can be set to an alias. This patch fixes that and uses the logged in username instead. Therefore it opens the file correctly and the write works. For example, before: upasname: joel@sirjofri.de foldername: /mail/box/joel@sirjofri.de/outgoing after: upasname: joel@sirjofri.de foldername: /mail/box/sirjofri/outgoing If an attachment is here, then the patch works (on my machine, at least). We should still check the returned file descriptor, just in case the user has no mailbox directory. sirjofri . --upas-kbnxydoadswlscajpsgakobprj Content-Disposition: inline Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit diff -r 297026d9dc30 sys/src/cmd/upas/marshal/marshal.c --- a/sys/src/cmd/upas/marshal/marshal.c Thu Feb 18 21:40:30 2021 +0100 +++ b/sys/src/cmd/upas/marshal/marshal.c Sat Feb 20 14:09:26 2021 +0100 @@ -1086,7 +1086,7 @@ case 0: close(pfd[0]); /* BOTCH; "From " time gets changed */ - b = openfolder(foldername(nil, user, rcvr), time(0)); + b = openfolder(foldername(nil, login, rcvr), time(0)); fd = b? Bfildes(b): -1; printunixfrom(fd); tee(0, pfd[1], fd); --upas-kbnxydoadswlscajpsgakobprj--