9front - general discussion about 9front
 help / color / mirror / Atom feed
From: sirjofri <sirjofri+ml-9front@sirjofri.de>
To: 9front@9front.org
Subject: Re: [9front] [Patch] Mail fails to send attachments
Date: Sat, 20 Feb 2021 14:16:53 +0100	[thread overview]
Message-ID: <9900841C0B876FC9E53FAC05828DADFA@sirjofri.de> (raw)
In-Reply-To: <E07C376E4275255C9E2473CC13E5C94B@eigenstate.org>

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--

  reply	other threads:[~2021-02-20 13:22 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-19 19:56 [9front] [Bug] " theinicke
2021-02-19 20:13 ` sirjofri
2021-02-19 20:54   ` Romano
2021-02-19 21:13   ` ori
2021-02-19 23:47     ` sirjofri
2021-02-20  0:28       ` sirjofri
2021-02-20  0:49         ` ori
2021-02-20 13:02           ` sirjofri
2021-02-19 23:27   ` ori
2021-02-20 13:16     ` sirjofri [this message]
2021-02-20 13:37       ` [9front] [Patch] " hiro
2021-02-20 14:03         ` [9front] bad headers in mail (was: Mail attachment bug) sirjofri
2021-02-20 14:10           ` hiro
2021-02-20 14:35 [9front] [Patch] Mail fails to send attachments sirjofri
2021-02-20 21:02 ` ori

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9900841C0B876FC9E53FAC05828DADFA@sirjofri.de \
    --to=sirjofri+ml-9front@sirjofri.de \
    --cc=9front@9front.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).