- else if (!strncasecmp(buf, "wefw=", 5)) {
- int rrtok;
- int rrlen;
- safestrncpy(wefw, &buf[5], sizeof wefw);
-
- /* Trim down excessively long lists of thread references. We eliminate the
- * second one in the list so that the thread root remains intact.
- */
- rrtok = num_tokens(wefw, '|');
- rrlen = strlen(wefw);
- if ( ((rrtok >= 3) && (rrlen > 900)) || (rrtok > 10) ) {
- remove_token(wefw, 1, '|');
- }
- }
-
- else if (!strncasecmp(buf, "msgn=", 5)) {
- safestrncpy(msgn, &buf[5], sizeof msgn);
- }
-
- else if (!strncasecmp(buf, "from=", 5)) {
- safestrncpy(from, &buf[5], sizeof from);
- for (i=0; i<strlen(from); ++i) {
- if (from[i] == ',') from[i] = ' ';
- }
- }
-
- else if (!strncasecmp(buf, "rcpt=", 5)) {
- safestrncpy(rcpt, &buf[5], sizeof rcpt);
- }
-
- else if (!strncasecmp(buf, "cccc=", 5)) {
- safestrncpy(cccc, &buf[5], sizeof cccc);
- }
+ case emessageId:
+ msgn = NewStrBufPlain(ChrPtr(Line) + 5, StrLength(Line) - 5);
+ break;
+
+ case eAuthor: {
+ StrBuf *FlatFrom;
+ from = NewStrBufPlain(ChrPtr(Line) + 5, StrLength(Line) - 5);
+ FlatFrom = NewStrBufPlain(NULL, StrLength(from));
+ StrBuf_RFC822_to_Utf8(FlatFrom, from, NULL, NULL);
+ FreeStrBuf(&from);
+ from = FlatFrom;
+ for (i=0; i<StrLength(from); ++i) {
+ if (ChrPtr(from)[i] == ',')
+ StrBufPeek(from, NULL, i, ' ');
+ }
+ break;
+ }
+
+ case eRecipient:
+ rcpt = NewStrBufPlain(ChrPtr(Line) + 5, StrLength(Line) - 5);
+ break;
+
+
+ case eCarbonCopY:
+ cccc = NewStrBufPlain(ChrPtr(Line) + 5, StrLength(Line) - 5);
+ break;