diff options
author | rsc <devnull@localhost> | 2007-06-23 06:12:50 +0000 |
---|---|---|
committer | rsc <devnull@localhost> | 2007-06-23 06:12:50 +0000 |
commit | bb70a84b1ffa914a1043f521940d8293423aab1b (patch) | |
tree | 03e4b68af38b6bb61d8519b71aff798f3f838ac0 /src/cmd/upas | |
parent | 9ec386fef4927034303b7e477f1570c09fba527f (diff) | |
download | plan9port-bb70a84b1ffa914a1043f521940d8293423aab1b.tar.gz plan9port-bb70a84b1ffa914a1043f521940d8293423aab1b.tar.bz2 plan9port-bb70a84b1ffa914a1043f521940d8293423aab1b.zip |
bug fixes:
list message 1.
give correct contents for raw, rawheader, rawbody.
provide filename and charset in mime attachments.
only rename mailboxes named mbox* not mbox*.
Diffstat (limited to 'src/cmd/upas')
-rw-r--r-- | src/cmd/upas/nfs/fs.c | 6 | ||||
-rw-r--r-- | src/cmd/upas/nfs/imap.c | 12 |
2 files changed, 16 insertions, 2 deletions
diff --git a/src/cmd/upas/nfs/fs.c b/src/cmd/upas/nfs/fs.c index 228b53f6..42ff2656 100644 --- a/src/cmd/upas/nfs/fs.c +++ b/src/cmd/upas/nfs/fs.c @@ -55,6 +55,7 @@ enum Qdesc, Qencoding, /* only here temporarily! */ Qcharset, + Qfilename, Qraw, Qrawheader, Qrawbody, @@ -69,7 +70,6 @@ enum Qheader, Qdigest, Qdisposition, - Qfilename, Qflags, Qinfo, Qrawunix, @@ -488,6 +488,7 @@ filedata(int type, Box *box, Msg *msg, Part *part, char **pp, int *len, int *fre case Qdesc: case Qencoding: case Qcharset: + case Qfilename: case Qraw: case Qrawheader: case Qrawbody: @@ -772,6 +773,7 @@ boxgen(int i, Dir *d, void *aux) i--; if(i == 0) return filldir(d, Qsearch, box, nil, nil); + i--; if(i < box->nsub) return filldir(d, Qbox, box->sub[i], nil, nil); i -= box->nsub; @@ -798,6 +800,8 @@ static int mimemsgdir[] = { static int mimedir[] = { Qtype, Qbody, + Qfilename, + Qcharset, Qmimeheader, Qraw }; diff --git a/src/cmd/upas/nfs/imap.c b/src/cmd/upas/nfs/imap.c index 1caa97b2..e9d56b93 100644 --- a/src/cmd/upas/nfs/imap.c +++ b/src/cmd/upas/nfs/imap.c @@ -1201,6 +1201,14 @@ unexpected(Imap *z, Sx *sx) } } +static int +alldollars(char *s) +{ + for(; *s; s++) + if(*s != '$') + return 0; + return 1; +} static void xlist(Imap *z, Sx *sx) @@ -1220,7 +1228,7 @@ xlist(Imap *z, Sx *sx) * Rename any existing mbox by appending a $. */ inbox = 0; - if(strncmp(s, "mbox", 4) == 0){ + if(strncmp(s, "mbox", 4) == 0 && alldollars(s+4)){ t = emalloc(strlen(s)+2); strcpy(t, s); strcat(t, "$"); @@ -1588,6 +1596,7 @@ xmsgbodydata(Msg *msg, Sx *k, Sx *v) /* now name is something like 1 or 3.2.MIME - walk down parts from root */ part = msg->part[0]; + while('1' <= name[0] && name[0] <= '9'){ i = strtol(name, &p, 10); if(*p == '.') @@ -1603,6 +1612,7 @@ xmsgbodydata(Msg *msg, Sx *k, Sx *v) name = p; } + if(cistrcmp(name, "") == 0){ free(part->raw); part->raw = nstring(v); |