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.2 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED autolearn=no autolearn_force=no version=3.4.4 Received: (qmail 32468 invoked from network); 18 Apr 2021 00:16:17 -0000 Received: from 1ess.inri.net (216.126.196.35) by inbox.vuxu.org with ESMTPUTF8; 18 Apr 2021 00:16:17 -0000 Received: from pb-smtp21.pobox.com ([173.228.157.53]) by 1ess; Sat Apr 17 19:47:06 -0400 2021 Received: from pb-smtp21.pobox.com (unknown [127.0.0.1]) by pb-smtp21.pobox.com (Postfix) with ESMTP id 2F2591202B2 for <9front@9front.org>; Sat, 17 Apr 2021 19:46:42 -0400 (EDT) (envelope-from unobe@cpan.org) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=message-id:to :subject:date:from:mime-version:content-type; s=sasl; bh=TLnqLfZ Hxpmcv8HOnk4TuGm7a1o=; b=W2Zp9ag8IPLxSgHwy5D6do1r2WTpTWr+cWi37ok OZHDHkNELdTSxjw91kto9FRvaX98i8qYP8heeUgQFKU+N1nrSqQ7GSi3Xar+Rxco 1jxGczXsWENGYRGr55oq9PIxg+TVfm0gTy/DjM3qqNBFuAie7XXwY41VFB3GkNa4 UWj0= Received: from pb-smtp21.sea.icgroup.com (unknown [127.0.0.1]) by pb-smtp21.pobox.com (Postfix) with ESMTP id 28B471202B1 for <9front@9front.org>; Sat, 17 Apr 2021 19:46:42 -0400 (EDT) (envelope-from unobe@cpan.org) Received: from peregrin (unknown [47.34.135.186]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pb-smtp21.pobox.com (Postfix) with ESMTPSA id 698671202AF for <9front@9front.org>; Sat, 17 Apr 2021 19:46:39 -0400 (EDT) (envelope-from unobe@cpan.org) Message-ID: <6004672BD7153B9F37A8D2B9A845590B@smtp.pobox.com> To: 9front@9front.org Date: Sat, 17 Apr 2021 16:46:37 -0700 From: unobe@cpan.org MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="upas-vrslyhexkkfmdpwcvhjcumxjhc" X-Pobox-Relay-ID: 2786F7C8-9FD7-11EB-9402-D609E328BF65-09620299!pb-smtp21.pobox.com List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: method-based realtime-java cache solution Subject: [9front] patch Mail(1) to fix attachments Reply-To: 9front@9front.org Precedence: bulk This is a multi-part message in MIME format. --upas-vrslyhexkkfmdpwcvhjcumxjhc Content-Disposition: inline Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit See attached. --upas-vrslyhexkkfmdpwcvhjcumxjhc Content-Disposition: attachment; filename=mail-attach.patch Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit 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) --upas-vrslyhexkkfmdpwcvhjcumxjhc--