summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@gmx.de>2013-01-01 16:27:01 +0100
committercinap_lenrek <cinap_lenrek@gmx.de>2013-01-01 16:27:01 +0100
commit0e4fc14f7e3de742e45b489d497f052199f390dd (patch)
tree6dcc9f181dbea8ca79adff2ec67720bc4f3bcb84 /sys
parentbe01be80cc87026d5e4ff43eee938e8200c171c2 (diff)
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.
Diffstat (limited to 'sys')
-rw-r--r--sys/man/1/marshal16
-rw-r--r--sys/src/cmd/upas/marshal/marshal.c14
2 files changed, 19 insertions, 11 deletions
diff --git a/sys/man/1/marshal b/sys/man/1/marshal
index 415880cbe..ef654a1fb 100644
--- a/sys/man/1/marshal
+++ b/sys/man/1/marshal
@@ -155,12 +155,9 @@ pgp encrypt the message
.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 @@ For example:
.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
diff --git a/sys/src/cmd/upas/marshal/marshal.c b/sys/src/cmd/upas/marshal/marshal.c
index 57c355c8b..39b458432 100644
--- a/sys/src/cmd/upas/marshal/marshal.c
+++ b/sys/src/cmd/upas/marshal/marshal.c
@@ -47,7 +47,7 @@ enum {
Hx,
Hprecedence,
Hattach,
- Hinline,
+ Hinclude,
Nhdr,
};
@@ -72,8 +72,8 @@ char *hdrs[Nhdr] = {
[Hcontent] "content-",
[Hx] "x-",
[Hprecedence] "precedence",
-[Hattach] "attach",
-[Hinline] "inline",
+[Hattach] "attach:",
+[Hinclude] "include:",
};
struct Ctype {
@@ -309,7 +309,7 @@ main(int argc, char **argv)
*/
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 @@ readheaders(Biobuf *in, int *fp, String **sp, Addr **top, Addr **ccp, Addr **bcc
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;