From: epg@google.com <> Date: Wed, 1 Apr 2009 23:40:27 +0000 (-0700) Subject: Implement custom scan of SPAM messages instead of using scan(1). X-Git-Url: https://diplodocus.org/git/minc/commitdiff_plain/6d0449f39ed28ad05afe9806afc664d6bc204fc6?ds=sidebyside;hp=6d0449f39ed28ad05afe9806afc664d6bc204fc6 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. ---