#include "rfc2047.h"
#include "rfc2231.h"
#include "mutt_crypt.h"
+#include "url.h"
#include <string.h>
#include <ctype.h>
if (!ascii_strcasecmp (line + 1, "ines"))
{
if (hdr)
+ {
hdr->lines = atoi (p);
- /*
- * HACK - mutt has, for a very short time, produced negative
- * Lines header values. Ignore them.
- */
- if (hdr->lines < 0)
- hdr->lines = 0;
+ /*
+ * HACK - mutt has, for a very short time, produced negative
+ * Lines header values. Ignore them.
+ */
+ if (hdr->lines < 0)
+ hdr->lines = 0;
+ }
matched = 1;
}
+ else if (!ascii_strcasecmp (line + 1, "ist-Post"))
+ {
+ /* RFC 2369. FIXME: We should ignore whitespace, but don't. */
+ if (strncmp (p, "NO", 2))
+ {
+ char *beg, *end;
+ for (beg = strchr (p, '<'); beg; beg = strchr (end, ','))
+ {
+ ++beg;
+ if (!(end = strchr (beg, '>')))
+ break;
+
+ /* Take the first mailto URL */
+ if (url_check_scheme (beg) == U_MAILTO)
+ {
+ FREE (&e->list_post);
+ e->list_post = mutt_substrdup (beg, end);
+ break;
+ }
+ }
+ }
+ matched = 1;
+ }
break;
case 'm':
long loc;
int matched;
size_t linelen = LONG_STRING;
+ char buf[LONG_STRING+1];
if (hdr)
{
break; /* end of header */
}
+ *buf = '\0';
+
+ if (mutt_match_spam_list(line, SpamList, buf, sizeof(buf)))
+ {
+ if (!mutt_match_rx_list(line, NoSpamList))
+ {
+
+ /* if spam tag already exists, figure out how to amend it */
+ if (e->spam && *buf)
+ {
+ /* If SpamSep defined, append with separator */
+ if (SpamSep)
+ {
+ mutt_buffer_addstr(e->spam, SpamSep);
+ mutt_buffer_addstr(e->spam, buf);
+ }
+
+ /* else overwrite */
+ else
+ {
+ e->spam->dptr = e->spam->data;
+ *e->spam->dptr = '\0';
+ mutt_buffer_addstr(e->spam, buf);
+ }
+ }
+
+ /* spam tag is new, and match expr is non-empty; copy */
+ else if (!e->spam && *buf)
+ {
+ e->spam = mutt_buffer_from(NULL, buf);
+ }
+
+ /* match expr is empty; plug in null string if no existing tag */
+ else if (!e->spam)
+ {
+ e->spam = mutt_buffer_from(NULL, "");
+ }
+
+ if (e->spam && e->spam->data)
+ dprint(5, (debugfile, "p822: spam = %s\n", e->spam->data));
+ }
+ }
+
*p = 0;
p++;
SKIPWS (p);