do not try to parse the m->unixfrom field, it only contains
the unix mail address.
instead, have parseunix() save a pointer into the unixheader
after the unix mail address for the unixdate, and later use
it to derive the mails timestamp.
}
free(m->unixfrom);
m->unixfrom = nil;
+ m->unixdate = nil;
free(m->unixheader);
m->unixheader = nil;
free(m->boundary);
/* mail info */
char *unixheader;
char *unixfrom;
+ char *unixdate;
char *references[Nref]; /* nil terminated unless full */
/* mime info */
if(m->fileid > 1000000ull<<8)
return;
- if(m->unixfrom && strtotm(m->unixfrom, &tm) >= 0)
+ if(m->unixdate && strtotm(m->unixdate, &tm) >= 0)
v = tm2sec(&tm);
else if(m->date822 && strtotm(m->date822, &tm) >= 0)
v = tm2sec(&tm);
char *s, *p;
m->unixheader = smprint("%.*s", utfnlen(m->start, m->header - m->start), m->start);
- s = m->start + 5;
+ s = m->unixheader + 5;
if((p = strchr(s, ' ')) == nil)
return;
*p = 0;
free(m->unixfrom);
m->unixfrom = strdup(s);
*p = ' ';
+ m->unixdate = ++p;
}
void
p = "???";
m->unixheader = smprint("From %s %Δ\n", p, m->fileid);
}
+ m->unixdate = nil;
+
m->cstate |= Cheader;
sanembmsg(mb, m);
}