- serv_getln(buf, sizeof buf);
- if (buf[0] == '1') while (serv_getln(buf, sizeof buf), strcmp(buf, "000")) {
-
- if ( (!strncasecmp(buf, "subj=", 5)) && (strlen(buf) > 5) ) {
- StrBuf *subj = NewStrBuf();
- if (!strcasecmp(bstr("replying_mode"), "forward")) {
- if (strncasecmp(&buf[5], "Fw:", 3)) {
- StrBufAppendBufPlain(subj, HKEY("Fw: "), 0);
- }
- }
- else {
- if (strncasecmp(&buf[5], "Re:", 3)) {
- StrBufAppendBufPlain(subj, HKEY("Re: "), 0);
- }
- }
- StrBufAppendBufPlain(subj, &buf[5], -1, 0);
- PutBstr(HKEY("subject"), subj);
- }
-
- 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, '|');
- }
- }