9front - general discussion about 9front
 help / color / mirror / Atom feed
* Re: [9front] [Patch] Mail fails to send attachments
@ 2021-02-20 14:35 sirjofri
  2021-02-20 21:02 ` ori
  0 siblings, 1 reply; 4+ messages in thread
From: sirjofri @ 2021-02-20 14:35 UTC (permalink / raw)
  To: 9front

Somehow this mail wasn't sent. Here it is:

20.02.2021 14:29:59 joel@sirjofri.de:

Quoth sirjofri <sirjofri+ml-9front@sirjofri.de>:

> We should still check the returned file descriptor, just in case the
> user has no mailbox directory.

This patch includes that check.

I adjusted the tee function so that the second destination is ignored
if it's invalid.

sirjofri

.
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:27:35 2021 +0100
@@ -985,10 +985,12 @@
  int n;
  char buf[8*1024];

- while ((n = read(in, buf, sizeof buf)) > 0)
-   if (write(out1, buf, n) != n ||
-       write(out2, buf, n) != n)
+ while ((n = read(in, buf, sizeof buf)) > 0){
+   if (write(out1, buf, n) != n)
      break;
+   if (out2 >= 0 && write(out2, buf, n) != n)
+     break;
+ }
}

/* print the unix from line */
@@ -1086,11 +1088,14 @@
      case 0:
        close(pfd[0]);
        /* BOTCH; "From " time gets changed */
-       b = openfolder(foldername(nil, user, rcvr), time(0));
-       fd = b? Bfildes(b): -1;
-       printunixfrom(fd);
-       tee(0, pfd[1], fd);
-       write(fd, "\n", 1);
+       b = openfolder(foldername(nil, login, rcvr), time(0));
+       if (b){
+         fd = Bfildes(b);
+         printunixfrom(fd);
+         tee(0, pfd[1], fd);
+         write(fd, "\n", 1);
+       } else
+         tee(0, pfd[1], -1);
        closefolder(b);
        exits(0);
      default:

^ permalink raw reply	[flat|nested] 4+ messages in thread
* Re: [9front] [Bug] Mail fails to send attachments
@ 2021-02-19 23:27 ori
  2021-02-20 13:16 ` [9front] [Patch] " sirjofri
  0 siblings, 1 reply; 4+ messages in thread
From: ori @ 2021-02-19 23:27 UTC (permalink / raw)
  To: 9front

Quoth sirjofri <sirjofri+ml-9front@sirjofri.de>:
> 
> 19.02.2021 20:56:00 theinicke@bss-wf.de:
> > Today I have noticed that since the rewrite Mail fails to send 
> > attachments.
> > That is if one includes an "Attach: /some/file" line and posts it,
> > (if file exists) marshal suicides like so: 66286: marshal 66286: sys: 
> > write on closed pipe pc=0x25e04
> > leaving us with a sent mail without the attachments.
> >
> > I have not been able to track down the cause yet.
> > Have reproduced it on a clean install updated to latest HEAD
> > to make sure it is not caused by any of my modifications.
> > Here are the symptoms:
> >
> > If in /sys/src/cmd/upas/marshal/marshal.c:421 attachment function is 
> > called, then
> > in /sys/src/cmd/upas/marshal/marshal.c:430 the error occurs.
> 
> Same here. The same happens when using Include: instead of Attach. Ori is 
> unable to reproduce this, afaik. Using marshal -8 directly works fine 
> btw.
> 
> sirjofri
> 

So, after some debugging with sirjofri, it looks
like this may have something to do with the '-S'
flag that we're passing to upas/marshal.

If you can confirm by running with 'Mail -O' to
disable saving outgoing messages, that would be
appreciated. It also gives a hint for where to
debug.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-02-20 21:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-20 14:35 [9front] [Patch] Mail fails to send attachments sirjofri
2021-02-20 21:02 ` ori
  -- strict thread matches above, loose matches on Subject: below --
2021-02-19 23:27 [9front] [Bug] " ori
2021-02-20 13:16 ` [9front] [Patch] " sirjofri
2021-02-20 13:37   ` hiro

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