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*.
This commit is contained in:
parent
9ec386fef4
commit
bb70a84b1f
2 changed files with 16 additions and 2 deletions
|
|
@ -55,6 +55,7 @@ enum
|
||||||
Qdesc,
|
Qdesc,
|
||||||
Qencoding, /* only here temporarily! */
|
Qencoding, /* only here temporarily! */
|
||||||
Qcharset,
|
Qcharset,
|
||||||
|
Qfilename,
|
||||||
Qraw,
|
Qraw,
|
||||||
Qrawheader,
|
Qrawheader,
|
||||||
Qrawbody,
|
Qrawbody,
|
||||||
|
|
@ -69,7 +70,6 @@ enum
|
||||||
Qheader,
|
Qheader,
|
||||||
Qdigest,
|
Qdigest,
|
||||||
Qdisposition,
|
Qdisposition,
|
||||||
Qfilename,
|
|
||||||
Qflags,
|
Qflags,
|
||||||
Qinfo,
|
Qinfo,
|
||||||
Qrawunix,
|
Qrawunix,
|
||||||
|
|
@ -488,6 +488,7 @@ filedata(int type, Box *box, Msg *msg, Part *part, char **pp, int *len, int *fre
|
||||||
case Qdesc:
|
case Qdesc:
|
||||||
case Qencoding:
|
case Qencoding:
|
||||||
case Qcharset:
|
case Qcharset:
|
||||||
|
case Qfilename:
|
||||||
case Qraw:
|
case Qraw:
|
||||||
case Qrawheader:
|
case Qrawheader:
|
||||||
case Qrawbody:
|
case Qrawbody:
|
||||||
|
|
@ -772,6 +773,7 @@ boxgen(int i, Dir *d, void *aux)
|
||||||
i--;
|
i--;
|
||||||
if(i == 0)
|
if(i == 0)
|
||||||
return filldir(d, Qsearch, box, nil, nil);
|
return filldir(d, Qsearch, box, nil, nil);
|
||||||
|
i--;
|
||||||
if(i < box->nsub)
|
if(i < box->nsub)
|
||||||
return filldir(d, Qbox, box->sub[i], nil, nil);
|
return filldir(d, Qbox, box->sub[i], nil, nil);
|
||||||
i -= box->nsub;
|
i -= box->nsub;
|
||||||
|
|
@ -798,6 +800,8 @@ static int mimemsgdir[] = {
|
||||||
static int mimedir[] = {
|
static int mimedir[] = {
|
||||||
Qtype,
|
Qtype,
|
||||||
Qbody,
|
Qbody,
|
||||||
|
Qfilename,
|
||||||
|
Qcharset,
|
||||||
Qmimeheader,
|
Qmimeheader,
|
||||||
Qraw
|
Qraw
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -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
|
static void
|
||||||
xlist(Imap *z, Sx *sx)
|
xlist(Imap *z, Sx *sx)
|
||||||
|
|
@ -1220,7 +1228,7 @@ xlist(Imap *z, Sx *sx)
|
||||||
* Rename any existing mbox by appending a $.
|
* Rename any existing mbox by appending a $.
|
||||||
*/
|
*/
|
||||||
inbox = 0;
|
inbox = 0;
|
||||||
if(strncmp(s, "mbox", 4) == 0){
|
if(strncmp(s, "mbox", 4) == 0 && alldollars(s+4)){
|
||||||
t = emalloc(strlen(s)+2);
|
t = emalloc(strlen(s)+2);
|
||||||
strcpy(t, s);
|
strcpy(t, s);
|
||||||
strcat(t, "$");
|
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 */
|
/* now name is something like 1 or 3.2.MIME - walk down parts from root */
|
||||||
part = msg->part[0];
|
part = msg->part[0];
|
||||||
|
|
||||||
|
|
||||||
while('1' <= name[0] && name[0] <= '9'){
|
while('1' <= name[0] && name[0] <= '9'){
|
||||||
i = strtol(name, &p, 10);
|
i = strtol(name, &p, 10);
|
||||||
if(*p == '.')
|
if(*p == '.')
|
||||||
|
|
@ -1603,6 +1612,7 @@ xmsgbodydata(Msg *msg, Sx *k, Sx *v)
|
||||||
name = p;
|
name = p;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if(cistrcmp(name, "") == 0){
|
if(cistrcmp(name, "") == 0){
|
||||||
free(part->raw);
|
free(part->raw);
|
||||||
part->raw = nstring(v);
|
part->raw = nstring(v);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue