X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=lib-mime%2Frfc822parse.c;h=b03a17ae6310f30eef28b9655dcdac4a80b491ee;hp=e399bb7e4e61084dab62dd8cdad9bd910cc2bf70;hb=6c292f6b369f019cc9a72a0ee65d60e172ee3370;hpb=230399f9632c37b66c1c117a17e8327eae6b3235 diff --git a/lib-mime/rfc822parse.c b/lib-mime/rfc822parse.c index e399bb7..b03a17a 100644 --- a/lib-mime/rfc822parse.c +++ b/lib-mime/rfc822parse.c @@ -26,12 +26,6 @@ * please see the file GPL in the top level source directory. */ -#if HAVE_CONFIG_H -# include "config.h" -#endif - -#include - #include #include "recvattach.h" @@ -1050,29 +1044,25 @@ mutt_read_rfc822_header(FILE *f, HEADER *hdr, short user_hdrs, short weed) break; /* end of header */ } - if (mutt_match_spam_list(line, SpamList, buf, sizeof(buf))) { - if (!rx_list_match(NoSpamList, line)) { - /* if spam tag already exists, figure out how to amend it */ - if (e->spam && *buf) { - if (SpamSep) { - /* If SpamSep defined, append with separator */ - mutt_buffer_addstr(e->spam, SpamSep); - mutt_buffer_addstr(e->spam, buf); - } else { - /* else overwrite */ - mutt_buffer_reset(e->spam); - mutt_buffer_addstr(e->spam, buf); - } - } - else if (!e->spam && *buf) { - /* spam tag is new, and match expr is non-empty; copy */ - e->spam = mutt_buffer_from(NULL, buf); - } - else if (!e->spam) { - /* match expr is empty; plug in null string if no existing tag */ - e->spam = mutt_buffer_from(NULL, ""); + if (rx_list_match2(SpamList, line, buf, sizeof(buf)) + && !rx_list_match(NoSpamList, line)) + { + /* if spam tag already exists, figure out how to amend it */ + if (e->spam && *buf) { + if (SpamSep) { + /* If SpamSep defined, append with separator */ + mutt_buffer_addstr(e->spam, SpamSep); + mutt_buffer_addstr(e->spam, buf); + } else { + /* else overwrite */ + mutt_buffer_reset(e->spam); + mutt_buffer_addstr(e->spam, buf); } } + + if (!e->spam) { + e->spam = mutt_buffer_from(NULL, buf); + } } *p++ = '\0';