]> diplodocus.org Git - minc/commit
Implement custom scan of SPAM messages instead of using scan(1).
authorepg@google.com <>
Wed, 1 Apr 2009 23:40:27 +0000 (16:40 -0700)
committerepg@google.com <>
Wed, 1 Apr 2009 23:40:27 +0000 (16:40 -0700)
commit6d0449f39ed28ad05afe9806afc664d6bc204fc6
treed22f2d0d6aa72604092a83bfd2e4f1b031ec7d72
parentfbeff8e387d16985ccfbacd67f013703a32301f0
Implement custom scan of SPAM messages instead of using scan(1).

If the header of a message contains garbage characters (not 2047-quoted
garbage characters, actual multi-byte garbage!) (Chinese or Russian spam)
scan(1) will happily print them to the tty, which hurts.

(%SPAM): Replace @SPAM global list with a hash.
(store_message): Drop unused $status variable.  Don't update @SPAM .
(scan_line): Factor out the actual scan line formatting from filter_mail to
  this new function.
(filter_mail): Append message number and header hash to %SPAM .
(maildir_spam): Append message number and spam maildir file name to %SPAM .
(scan_spam): Add function to scan spam messages with scan_line .  Deal with 3
  cases: spam filtered via filter_mail and spam filtered via maildir_spam in
  either run or -n mode.  For the latter two, open the message file from the
  mh SPAM folder or from the spam maildir, respectively, to load the header.
minc