git: 9front

Download patch

ref: 17a9a0291b51a6f1bf84e8ee5fdb2f46db8519bb
parent: 8a0907477f4813f69d584506224f956764c949b4
author: cinap_lenrek <cinap_lenrek@gmx.de>
date: Tue Jan 1 11:27:01 EST 2013

upas/marshal: change Inline: to Include: header, interpret even withou -8 flag

after some thought, the file attachment headers Attach: and Include:
(before Inline:) are more like the Subject: line and should be interpreted
every time.

--- a/sys/man/1/marshal
+++ b/sys/man/1/marshal
@@ -155,12 +155,9 @@
 .B -8
 reads recipients (
 .B To:
-and
 .B Cc:
-) and attachments (
-.B Attach:
 and
-.B Inline:
+.B Bcc:
 ) from RFC 822 header of the message
 .PD
 .PP
@@ -184,6 +181,17 @@
 .EX
 upasname=natasha@kremvax.com upas/mail boris@squirrel.com
 .EE
+.PP
+.I Marshal
+interprets file attachment headers
+.B Attach:
+and
+.B Include:
+as if the
+.B -A
+or
+.B -a
+options would have been given.
 .SH FILES
 .TP
 .B /mail/box/*/dead.letter
--- a/sys/src/cmd/upas/marshal/marshal.c
+++ b/sys/src/cmd/upas/marshal/marshal.c
@@ -47,7 +47,7 @@
 	Hx,
 	Hprecedence,
 	Hattach,
-	Hinline,
+	Hinclude,
 	Nhdr,
 };
 
@@ -72,8 +72,8 @@
 [Hcontent]	"content-",
 [Hx]		"x-",
 [Hprecedence]	"precedence",
-[Hattach]		"attach",
-[Hinline]		"inline",
+[Hattach]	"attach:",
+[Hinclude]	"include:",
 };
 
 struct Ctype {
@@ -309,7 +309,7 @@
 		 */
 		holding = holdon();
 		headersrv = readheaders(&in, &flags, &hdrstring,
-			eightflag? &to: nil, eightflag? &cc: nil, eightflag? &bcc: nil, eightflag? l: nil, 1);
+			eightflag? &to: nil, eightflag? &cc: nil, eightflag? &bcc: nil, l, 1);
 		if(rfc822syntaxerror){
 			Bdrain(&in);
 			fatal("rfc822 syntax error, message not sent");
@@ -501,10 +501,10 @@
 				s_append(s, "\n");
 				break;
 			case Hattach:
-			case Hinline:
+			case Hinclude:
 				if(att == nil)
-					goto Addhdr;
-				*att = mkattach(hdrval(s_to_c(sline)), nil, hdrtype == Hinline);
+					break;
+				*att = mkattach(hdrval(s_to_c(sline)), nil, hdrtype == Hinclude);
 				if(*att != nil)
 					att = &(*att)->next;
 				break;
--