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 28065 invoked from network); 20 Feb 2021 13:07:26 -0000 Received: from 1ess.inri.net (216.126.196.35) by inbox.vuxu.org with ESMTPUTF8; 20 Feb 2021 13:07:26 -0000 Received: from oat.nine.sirjofri.de ([5.45.105.127]) by 1ess; Sat Feb 20 08:02:16 -0500 2021 Received: from sirjofri.de ([178.0.65.31]) by oat; Sat Feb 20 14:02:08 +0100 2021 Date: Sat, 20 Feb 2021 13:02:05 +0000 (UTC) From: sirjofri To: 9front@9front.org Message-ID: <113789e3-82f3-4c5e-b68f-d1c786dfd11c@sirjofri.de> In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Correlation-ID: <113789e3-82f3-4c5e-b68f-d1c786dfd11c@sirjofri.de> List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: social extension Subject: Re: [9front] [Bug] Mail fails to send attachments Reply-To: 9front@9front.org Precedence: bulk Hello, 20.02.2021 01:49:09 ori@eigenstate.org: > Quoth sirjofri : >> I noticed that marshal also handles the whole boundary stuff and >> attachments. The output file I get in pipefrom does not contain the >> data >> from the attachment. >> >> To verify I made this pipefrom: >> >> #!/bin/rc >> echo $* > /tmp/msgargs >> cat > /tmp/msgcontent >> >> Then look at these files. >> >> The whole thing is formatted as a multipart message, but it only >> contains >> the message text, no attachments. >> >> I also looked at the history of the marshal code, I don't think the >> sendmail function is bad here. >> >> sirjofri >> > > I'd look at whether we're closing the wrong fd > if we're passing '-S'. I found out, it's something completely different. The function foldername builds the path to the outgoing directory. For this, it uses the upasname environment variable (or the login name if it's not set). However, I had my upasname set to my sender address (joel@sirjofri.de), so it builds the string: /mail/box/joel@sirjofri.de/outgoing, which of course cannot be opened (it doesn't exist!). Therefore, openfolder does return a wrong Biobuf with a file descriptor -1, our tee function fails to write there and nothing works. Removing my upasname variable confirmed this bug. Now I just need to find a proper solution to this. Looking at the returned file descriptor could be one, writing not to user but login directory another. If you want to follow my description in code, marshal.c:/^sendmail, switch() case 0:, if (rcvr != nil), switch() case 0, the foldername function call. sirjofri