diff options
-rw-r--r-- | tools/mail-scan.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/tools/mail-scan.c b/tools/mail-scan.c index 9e79ff9..1ea245f 100644 --- a/tools/mail-scan.c +++ b/tools/mail-scan.c @@ -15,9 +15,8 @@ ///////////// // Another hint: using the "-addr" feature: -// grep score=[234] /home/user/Maildir/spam/* -l | \... -// xargs mail-scan +from -addr | sort | uniq -c | sort -nr | head | blacklist-update -bare - +// mail-scan +x-spam.*:score=[234] /home/jean/Maildir/spam/* -l | \.... +// xargs mail-scan +from -addr | sort | uniq -c | sort -nr | head -20 #include <iostream> #include <stdlib.h> /* for exit() */ @@ -294,15 +293,14 @@ int main(int _argc, const char** _argv){ headword = header.substr(0, where); rest = ltrim(header.substr(1+where)); } -// temporary? FIXME? lowercase - headword = toLower(headword); - rest = toLower(rest); + for (list<watcher>::const_iterator ptr = watchword.begin(); ptr != watchword.end(); ptr++) { - if (headword == toLower(ptr->key)) { +// regex_match not regex_search ... keyrx must match *whole* headword + if (boost::regex_match(headword, ptr->keyrx)){ // here if match as to keyword; check for match as to value if (ptr->val.length()==0 - || rest.find(toLower(ptr->val)) != string::npos) { + || boost::regex_search(rest, ptr->valrx)){ foundsome_infile++; if (!vflag) { if (!addr_mode){ |