home *** CD-ROM | disk | FTP | other *** search
/ ftp.f-secure.com / 2014.06.ftp.f-secure.com.tar / ftp.f-secure.com / support / hotfix / fsis / IS-SpamControl.fsfix / iufssc / rules / 20_meta_tests.cf < prev    next >
Text File  |  2006-11-29  |  3KB  |  75 lines

  1. # SpamAssassin rules file: meta tests
  2. #
  3. # Please don't modify this file as your changes will be overwritten with
  4. # the next update. Use @@LOCAL_RULES_DIR@@/local.cf instead.
  5. # See 'perldoc Mail::SpamAssassin::Conf' for details.
  6. #
  7. # Add meta tests which cover *both* headers and body here.
  8. #
  9. # Note: body tests are run with long lines, so be sure to limit the
  10. # size of searches; use /.{0,30}/ instead of /.*/ to avoid huge
  11. # search times.
  12. #
  13. # <@LICENSE>
  14. # Copyright 2004 Apache Software Foundation
  15. # Licensed under the Apache License, Version 2.0 (the "License");
  16. # you may not use this file except in compliance with the License.
  17. # You may obtain a copy of the License at
  18. #     http://www.apache.org/licenses/LICENSE-2.0
  19. # Unless required by applicable law or agreed to in writing, software
  20. # distributed under the License is distributed on an "AS IS" BASIS,
  21. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  22. # See the License for the specific language governing permissions and
  23. # limitations under the License.
  24. # </@LICENSE>
  25. #
  26. ###########################################################################
  27.  
  28. #require_version @@VERSION@@
  29.  
  30. # some tests that will trigger FPs on ISO-2022-JP mails.
  31.  
  32. body __ISO_2022_JP_DELIM    /\e\$B/
  33.  
  34. header __MANY_EXCLS             Subject =~ /![^!]+!/
  35. header __PLING_PLING            Subject =~ /!!!/
  36.  
  37. body __UPPERCASE_25_50          eval:check_for_uppercase('25', '50')
  38. body __UPPERCASE_50_75          eval:check_for_uppercase('50', '75')
  39. body __UPPERCASE_75_100         eval:check_for_uppercase('75', '100')
  40.  
  41. meta MANY_EXCLAMATIONS          (!__ISO_2022_JP_DELIM && __MANY_EXCLS)
  42. describe MANY_EXCLAMATIONS      Subject has many exclamations
  43. meta UPPERCASE_25_50            (!__ISO_2022_JP_DELIM && __UPPERCASE_25_50)
  44. describe UPPERCASE_25_50        message body is 25-50% uppercase
  45. meta UPPERCASE_50_75            (!__ISO_2022_JP_DELIM && __UPPERCASE_50_75)
  46. describe UPPERCASE_50_75        message body is 50-75% uppercase
  47. meta UPPERCASE_75_100           (!__ISO_2022_JP_DELIM && __UPPERCASE_75_100)
  48. describe UPPERCASE_75_100       message body is 75-100% uppercase
  49. meta PLING_PLING                (!__ISO_2022_JP_DELIM && __PLING_PLING)
  50. describe PLING_PLING            Subject has lots of exclamation marks
  51.  
  52. header __SANE_MSGID        MESSAGEID =~ /^<[^<>\\ \t\n\r\x0b\x80-\xff]+\@[^<>\\ \t\n\r\x0b\x80-\xff]+>\s*$/m
  53. header __HAS_MSGID        MESSAGEID =~ /\S/
  54. header __MSGID_COMMENT        MESSAGEID =~ /\(.*\)/m
  55. meta INVALID_MSGID        __HAS_MSGID && !(__SANE_MSGID || __MSGID_COMMENT)
  56. describe INVALID_MSGID        Message-Id is not valid, according to RFC 2822
  57.  
  58. header __MOZILLA_MUA        X-Mailer =~ /\bMozilla\b/
  59. header __MOZILLA_MSGID        MESSAGEID =~ /^<[A-F\d]{8}\.[A-F1-9][A-F\d]{0,7}\@\S+>$/m
  60. meta FORGED_MUA_MOZILLA        (__MOZILLA_MUA && !__UNUSABLE_MSGID && !__MOZILLA_MSGID)
  61. describe FORGED_MUA_MOZILLA    Forged mail pretending to be from Mozilla
  62.  
  63. header __PC_RND_HEADER        ALL =~ /%RA?ND(?:OM)?(?:_|\b|[A-Z]{3})/i
  64. rawbody __PC_RND_RAWBODY    /%RA?ND(?:OM)?(?:_|\b|[A-Z]{3})/i
  65. meta PERCENT_RANDOM        (__PC_RND_HEADER || __PC_RND_RAWBODY)
  66. describe PERCENT_RANDOM        Message has a random macro in it
  67.  
  68. # __MIME_ATTACHMENT defined in 20_html_tests.cf
  69. body __NONEMPTY_BODY    /\S/
  70. meta EMPTY_MESSAGE    !__MIME_ATTACHMENT && !__NONEMPTY_BODY
  71. describe EMPTY_MESSAGE    Message appears to be empty with no Subject: text
  72.