changeset: 8409:61f3cece9395 branch: mbp-2011 user: Romano date: Sat Apr 17 14:32:37 2021 -0700 files: sys/src/cmd/upas/Mail/comp.c description: Setting the headers breaks e-mail attachments. Marshal(1) already sets the proper content-type and content-transfer-encoding based on if there is a codepoint above 0x7f--if we want to change the default from Latin-1, that's where the fix should be. Without this fix, the wrong content-type and content-transfer-encoding is set for multipart messages, and therefore 'Include:' or 'Attach:' instructions will send malformed e-mail. diff -r f2ec0867a0ae -r 61f3cece9395 sys/src/cmd/upas/Mail/comp.c --- a/sys/src/cmd/upas/Mail/comp.c Tue Apr 13 23:29:34 2021 -0700 +++ b/sys/src/cmd/upas/Mail/comp.c Sat Apr 17 14:32:37 2021 -0700 @@ -67,9 +67,6 @@ chanfree(c->sync); close(c->fd[0]); - /* needed because mail is by default Latin-1 */ - fprint(c->fd[1], "Content-Type: text/plain; charset=\"UTF-8\"\n"); - fprint(c->fd[1], "Content-Transfer-Encoding: 8bit\n"); buf = emalloc(Bufsz); while((n = read(fd, buf, Bufsz)) > 0) if(write(c->fd[1], buf, n) != n)