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_dnsbl_tests.cf < prev    next >
Text File  |  2006-11-29  |  14KB  |  336 lines

  1. # SpamAssassin rules file: DNS blacklist 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. # <@LICENSE>
  8. # Copyright 2004 Apache Software Foundation
  9. #
  10. # Licensed under the Apache License, Version 2.0 (the "License");
  11. # you may not use this file except in compliance with the License.
  12. # You may obtain a copy of the License at
  13. #
  14. #     http://www.apache.org/licenses/LICENSE-2.0
  15. #
  16. # Unless required by applicable law or agreed to in writing, software
  17. # distributed under the License is distributed on an "AS IS" BASIS,
  18. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  19. # See the License for the specific language governing permissions and
  20. # limitations under the License.
  21. # </@LICENSE>
  22. #
  23. ###########################################################################
  24.  
  25. #require_version @@VERSION@@
  26.  
  27. # See the Mail::SpamAssassin::Conf manual page for details of how to use
  28. # check_rbl().
  29.  
  30. # ---------------------------------------------------------------------------
  31. # Multizone / Multi meaning BLs first.
  32. #
  33. # Note that currently TXT queries cannot be used for these, since the
  34. # DNSBLs do not return the A type (127.0.0.x) as part of the TXT reply.
  35. # Well, at least NJABL doesn't, it seems, as of Apr 7 2003.
  36.  
  37. # ---------------------------------------------------------------------------
  38. # NJABL
  39. # URL: http://www.dnsbl.njabl.org/
  40.  
  41. header __RCVD_IN_NJABL        eval:check_rbl('njabl', 'combined.njabl.org.')
  42. describe __RCVD_IN_NJABL    Received via a relay in combined.njabl.org
  43. tflags __RCVD_IN_NJABL        net
  44.  
  45. header RCVD_IN_NJABL_RELAY    eval:check_rbl_sub('njabl', '127.0.0.2')
  46. describe RCVD_IN_NJABL_RELAY    NJABL: sender is confirmed open relay
  47. tflags RCVD_IN_NJABL_RELAY    net
  48. #reuse RCVD_IN_NJABL_RELAY
  49.  
  50. header RCVD_IN_NJABL_DUL    eval:check_rbl('njabl-lastexternal', 'combined.njabl.org.', '127.0.0.3')
  51. describe RCVD_IN_NJABL_DUL    NJABL: dialup sender did non-local SMTP
  52. tflags RCVD_IN_NJABL_DUL    net
  53. #reuse RCVD_IN_NJABL_DUL
  54.  
  55. header RCVD_IN_NJABL_SPAM    eval:check_rbl_sub('njabl', '127.0.0.4')
  56. describe RCVD_IN_NJABL_SPAM    NJABL: sender is confirmed spam source
  57. tflags RCVD_IN_NJABL_SPAM    net
  58. #reuse RCVD_IN_NJABL_SPAM
  59.  
  60. header RCVD_IN_NJABL_MULTI    eval:check_rbl_sub('njabl', '127.0.0.5')
  61. describe RCVD_IN_NJABL_MULTI    NJABL: sent through multi-stage open relay
  62. tflags RCVD_IN_NJABL_MULTI    net
  63. #reuse RCVD_IN_NJABL_MULTI
  64.  
  65. header RCVD_IN_NJABL_CGI    eval:check_rbl_sub('njabl', '127.0.0.8')
  66. describe RCVD_IN_NJABL_CGI    NJABL: sender is an open formmail
  67. tflags RCVD_IN_NJABL_CGI    net
  68. #reuse RCVD_IN_NJABL_CGI
  69.  
  70. header RCVD_IN_NJABL_PROXY    eval:check_rbl_sub('njabl', '127.0.0.9')
  71. describe RCVD_IN_NJABL_PROXY    NJABL: sender is an open proxy
  72. tflags RCVD_IN_NJABL_PROXY    net
  73. #reuse RCVD_IN_NJABL_PROXY
  74.  
  75. # ---------------------------------------------------------------------------
  76. # SORBS
  77. # transfers: both axfr and ixfr available
  78. # URL: http://www.dnsbl.sorbs.net/
  79. # pay-to-use: no
  80. # delist: $50 fee for RCVD_IN_SORBS_SPAM, others have free retest on request
  81.  
  82. header __RCVD_IN_SORBS        eval:check_rbl('sorbs', 'dnsbl.sorbs.net.')
  83. describe __RCVD_IN_SORBS    SORBS: sender is listed in SORBS
  84. tflags __RCVD_IN_SORBS        net
  85.  
  86. header RCVD_IN_SORBS_HTTP    eval:check_rbl_sub('sorbs', '127.0.0.2')
  87. describe RCVD_IN_SORBS_HTTP    SORBS: sender is open HTTP proxy server
  88. tflags RCVD_IN_SORBS_HTTP    net
  89. #reuse RCVD_IN_SORBS_HTTP
  90.  
  91. header RCVD_IN_SORBS_SOCKS    eval:check_rbl_sub('sorbs', '127.0.0.3')
  92. describe RCVD_IN_SORBS_SOCKS    SORBS: sender is open SOCKS proxy server
  93. tflags RCVD_IN_SORBS_SOCKS    net
  94. #reuse RCVD_IN_SORBS_SOCKS
  95.  
  96. header RCVD_IN_SORBS_MISC    eval:check_rbl_sub('sorbs', '127.0.0.4')
  97. describe RCVD_IN_SORBS_MISC    SORBS: sender is open proxy server
  98. tflags RCVD_IN_SORBS_MISC    net
  99. #reuse RCVD_IN_SORBS_MISC
  100.  
  101. header RCVD_IN_SORBS_SMTP    eval:check_rbl_sub('sorbs', '127.0.0.5')
  102. describe RCVD_IN_SORBS_SMTP    SORBS: sender is open SMTP relay
  103. tflags RCVD_IN_SORBS_SMTP    net
  104. #reuse RCVD_IN_SORBS_SMTP
  105.  
  106. # delist: $50 fee
  107. #header RCVD_IN_SORBS_SPAM    eval:check_rbl_sub('sorbs', '127.0.0.6')
  108. #describe RCVD_IN_SORBS_SPAM    SORBS: sender is a spam source
  109. #tflags RCVD_IN_SORBS_SPAM    net
  110. #reuse RCVD_IN_SORBS_SPAM
  111.  
  112. header RCVD_IN_SORBS_WEB    eval:check_rbl_sub('sorbs', '127.0.0.7')
  113. describe RCVD_IN_SORBS_WEB    SORBS: sender is a abuseable web server
  114. tflags RCVD_IN_SORBS_WEB    net
  115. #reuse RCVD_IN_SORBS_WEB
  116.  
  117. header RCVD_IN_SORBS_BLOCK    eval:check_rbl_sub('sorbs', '127.0.0.8')
  118. describe RCVD_IN_SORBS_BLOCK    SORBS: sender demands to never be tested
  119. tflags RCVD_IN_SORBS_BLOCK    net
  120. #reuse RCVD_IN_SORBS_BLOCK
  121.  
  122. header RCVD_IN_SORBS_ZOMBIE    eval:check_rbl_sub('sorbs', '127.0.0.9')
  123. describe RCVD_IN_SORBS_ZOMBIE    SORBS: sender is on a hijacked network
  124. tflags RCVD_IN_SORBS_ZOMBIE    net
  125. #reuse RCVD_IN_SORBS_ZOMBIE
  126.  
  127. header RCVD_IN_SORBS_DUL    eval:check_rbl('sorbs-lastexternal', 'dnsbl.sorbs.net.', '127.0.0.10')
  128. describe RCVD_IN_SORBS_DUL    SORBS: sent directly from dynamic IP address
  129. tflags RCVD_IN_SORBS_DUL    net
  130. #reuse RCVD_IN_SORBS_DUL
  131.  
  132. # ---------------------------------------------------------------------------
  133. # Spamhaus SBL+XBL
  134. #
  135. # Spamhaus XBL contains both the Abuseat CBL (cbl.abuseat.org) and Blitzed
  136. # OPM (opm.blitzed.org) lists so it's not necessary to query those as well.
  137.  
  138. header __RCVD_IN_SBL_XBL    eval:check_rbl('sblxbl', 'sbl-xbl.spamhaus.org.')
  139. describe __RCVD_IN_SBL_XBL    Received via a relay in Spamhaus SBL+XBL
  140. tflags __RCVD_IN_SBL_XBL    net
  141.  
  142. # SBL is the Spamhaus Block List: http://www.spamhaus.org/sbl/
  143. header RCVD_IN_SBL        eval:check_rbl_sub('sblxbl', '127.0.0.2')
  144. describe RCVD_IN_SBL        Received via a relay in Spamhaus SBL
  145. tflags RCVD_IN_SBL        net
  146. #reuse RCVD_IN_SBL
  147.  
  148. # XBL is the Exploits Block List: http://www.spamhaus.org/xbl/
  149. header RCVD_IN_XBL        eval:check_rbl('sblxbl-lastexternal', 'sbl-xbl.spamhaus.org.', '127.0.0.[456]')
  150. describe RCVD_IN_XBL        Received via a relay in Spamhaus XBL
  151. tflags RCVD_IN_XBL        net
  152. #reuse RCVD_IN_XBL
  153.  
  154. # ---------------------------------------------------------------------------
  155. # RFC-Ignorant blacklists (both name and IP based)
  156.  
  157. header __RFC_IGNORANT_ENVFROM    eval:check_rbl_envfrom('rfci_envfrom', 'fulldom.rfc-ignorant.org.')
  158. tflags __RFC_IGNORANT_ENVFROM    net
  159.  
  160. header DNS_FROM_RFC_DSN        eval:check_rbl_sub('rfci_envfrom', '127.0.0.2')
  161. describe DNS_FROM_RFC_DSN    Envelope sender in dsn.rfc-ignorant.org
  162. tflags DNS_FROM_RFC_DSN        net
  163. #reuse DNS_FROM_RFC_DSN
  164.  
  165. header DNS_FROM_RFC_POST    eval:check_rbl_sub('rfci_envfrom', '127.0.0.3')
  166. describe DNS_FROM_RFC_POST    Envelope sender in postmaster.rfc-ignorant.org
  167. tflags DNS_FROM_RFC_POST    net
  168. #reuse DNS_FROM_RFC_POST
  169.  
  170. header DNS_FROM_RFC_ABUSE    eval:check_rbl_sub('rfci_envfrom', '127.0.0.4')
  171. describe DNS_FROM_RFC_ABUSE    Envelope sender in abuse.rfc-ignorant.org
  172. tflags DNS_FROM_RFC_ABUSE    net
  173. #reuse DNS_FROM_RFC_ABUSE
  174.  
  175. header DNS_FROM_RFC_WHOIS    eval:check_rbl_sub('rfci_envfrom', '127.0.0.5')
  176. describe DNS_FROM_RFC_WHOIS    Envelope sender in whois.rfc-ignorant.org
  177. tflags DNS_FROM_RFC_WHOIS    net
  178. #reuse DNS_FROM_RFC_WHOIS
  179.  
  180. header DNS_FROM_RFC_BOGUSMX    eval:check_rbl_sub('rfci_envfrom', '127.0.0.8')
  181. describe DNS_FROM_RFC_BOGUSMX    Envelope sender in bogusmx.rfc-ignorant.org
  182. tflags DNS_FROM_RFC_BOGUSMX    net
  183. #reuse DNS_FROM_RFC_BOGUSMX
  184.  
  185. # ---------------------------------------------------------------------------
  186. # CompleteWhois blacklists
  187.  
  188. header __RCVD_IN_WHOIS        eval:check_rbl('whois', 'combined-HIB.dnsiplists.completewhois.com.')
  189. tflags __RCVD_IN_WHOIS        net
  190.  
  191. header RCVD_IN_WHOIS_BOGONS    eval:check_rbl_sub('whois', '127.0.0.2')
  192. describe RCVD_IN_WHOIS_BOGONS    CompleteWhois: sender on bogons IP block
  193. tflags RCVD_IN_WHOIS_BOGONS    net
  194.  
  195. header RCVD_IN_WHOIS_HIJACKED    eval:check_rbl_sub('whois', '127.0.0.3')
  196. describe RCVD_IN_WHOIS_HIJACKED    CompleteWhois: sender on hijacked IP block
  197. tflags RCVD_IN_WHOIS_HIJACKED    net
  198.  
  199. header RCVD_IN_WHOIS_INVALID    eval:check_rbl('whois-lastexternal', 'combined-HIB.dnsiplists.completewhois.com.', '127.0.0.4')
  200. describe RCVD_IN_WHOIS_INVALID    CompleteWhois: sender on invalid IP block
  201. tflags RCVD_IN_WHOIS_INVALID    net
  202. #reuse RCVD_IN_WHOIS_INVALID    RCVD_IN_RFC_IPWHOIS
  203.  
  204. # ---------------------------------------------------------------------------
  205. # Now, single zone BLs follow:
  206.  
  207. # DSBL catches open relays, badly-installed CGI scripts and open SOCKS and
  208. # HTTP proxies.  list.dsbl.org lists servers tested by "trusted" users,
  209. # multihop.dsbl.org lists servers which open SMTP servers relay through,
  210. # unconfirmed.dsbl.org lists servers tested by "untrusted" users.
  211. # See http://dsbl.org/ for full details.
  212. # transfers: yes - rsync and http, see http://dsbl.org/usage
  213. # pay-to-use: no
  214. # delist: automated/distributed
  215. header RCVD_IN_DSBL        eval:check_rbl_txt('dsbl-lastexternal', 'list.dsbl.org.', '(?i:dsbl)')
  216. describe RCVD_IN_DSBL        Received via a relay in list.dsbl.org
  217. tflags RCVD_IN_DSBL        net
  218. #reuse RCVD_IN_DSBL
  219.  
  220. ########################################################################
  221.  
  222. # another domain-based blacklist
  223. header DNS_FROM_AHBL_RHSBL    eval:check_rbl_envfrom('ahbl', 'rhsbl.ahbl.org.')
  224. describe DNS_FROM_AHBL_RHSBL    From: sender listed in dnsbl.ahbl.org
  225. tflags DNS_FROM_AHBL_RHSBL    net
  226. #reuse DNS_FROM_AHBL_RHSBL
  227.  
  228. # another domain-based blacklist
  229. header DNS_FROM_SECURITYSAGE    eval:check_rbl_envfrom('securitysage', 'blackhole.securitysage.com.')
  230. describe DNS_FROM_SECURITYSAGE    Envelope sender in blackholes.securitysage.com
  231. tflags DNS_FROM_SECURITYSAGE    net
  232. #reuse DNS_FROM_SECURITYSAGE
  233.  
  234. # ---------------------------------------------------------------------------
  235. # NOTE: donation tests, see README file for details
  236.  
  237. header RCVD_IN_BL_SPAMCOP_NET    eval:check_rbl_txt('spamcop', 'bl.spamcop.net.', '(?i:spamcop)')
  238. describe RCVD_IN_BL_SPAMCOP_NET    Received via a relay in bl.spamcop.net
  239. tflags RCVD_IN_BL_SPAMCOP_NET    net
  240. #reuse RCVD_IN_BL_SPAMCOP_NET
  241.  
  242. # ---------------------------------------------------------------------------
  243. # NOTE: commercial tests, see README file for details
  244.  
  245. header RCVD_IN_MAPS_RBL        eval:check_rbl('rbl', 'blackholes.mail-abuse.org.')
  246. describe RCVD_IN_MAPS_RBL    Relay in RBL, http://www.mail-abuse.org/rbl/
  247. tflags RCVD_IN_MAPS_RBL        net
  248.  
  249. header RCVD_IN_MAPS_DUL        eval:check_rbl('dialup-lastexternal', 'dialups.mail-abuse.org.')
  250. describe RCVD_IN_MAPS_DUL    Relay in DUL, http://www.mail-abuse.org/dul/
  251. tflags RCVD_IN_MAPS_DUL        net
  252.  
  253. header RCVD_IN_MAPS_RSS        eval:check_rbl('rss', 'relays.mail-abuse.org.')
  254. describe RCVD_IN_MAPS_RSS    Relay in RSS, http://www.mail-abuse.org/rss/
  255. tflags RCVD_IN_MAPS_RSS        net
  256.  
  257. header RCVD_IN_MAPS_NML        eval:check_rbl('nml', 'nonconfirm.mail-abuse.org.')
  258. describe RCVD_IN_MAPS_NML    Relay in NML, http://www.mail-abuse.org/nml/
  259. tflags RCVD_IN_MAPS_NML        net
  260.  
  261. # if you're subscribed to RBL+, then comment out the above rules (just the
  262. # "header" lines, not the "describe" or "tflags" lines) and uncomment the
  263. # below lines
  264. #header RCVD_IN_MAPS_RBL    eval:check_rbl('rblplus', 'rbl-plus.mail-abuse.org.', '1')
  265. #header RCVD_IN_MAPS_DUL    eval:check_rbl('rblplus-lastexternal', 'rbl-plus.mail-abuse.org.', '2')
  266. #header RCVD_IN_MAPS_RSS    eval:check_rbl_sub('rblplus', '4')
  267. #header RCVD_IN_MAPS_OPS    eval:check_rbl_sub('rblplus', '8')
  268. #describe RCVD_IN_MAPS_OPS    Relay in OPS, http://www.mail-abuse.org/ops/
  269. #tflags RCVD_IN_MAPS_OPS    net
  270.  
  271.  
  272. # ---------------------------------------------------------------------------
  273.  
  274. # Section for DNS WL related lookups below:
  275.  
  276. header RCVD_IN_BSP_TRUSTED    eval:check_rbl_txt('bsp-firsttrusted', 'sa-trusted.bondedsender.org.', '(?i:bonded)')
  277. describe RCVD_IN_BSP_TRUSTED    Sender is in Bonded Sender Program (trusted relay)
  278. tflags RCVD_IN_BSP_TRUSTED    net nice
  279. #reuse RCVD_IN_BSP_TRUSTED
  280.  
  281. header RCVD_IN_BSP_OTHER    eval:check_rbl_txt('bsp-untrusted', 'sa-other.bondedsender.org.', '(?i:bonded)')
  282. describe RCVD_IN_BSP_OTHER    Sender is in Bonded Sender Program (other relay)
  283. tflags RCVD_IN_BSP_OTHER    net nice
  284. #reuse RCVD_IN_BSP_OTHER
  285.  
  286. # ---------------------------------------------------------------------------
  287.  
  288. # IADB support ...
  289. header __RCVD_IN_IADB        eval:check_rbl('iadb-firsttrusted', 'iadb.isipp.com.')
  290. tflags __RCVD_IN_IADB        net nice
  291.  
  292. header RCVD_IN_IADB_VOUCHED    eval:check_rbl_sub('iadb-firsttrusted', '^127.0.1.255$')
  293. describe RCVD_IN_IADB_VOUCHED    ISIPP IADB lists as vouched-for sender
  294. tflags RCVD_IN_IADB_VOUCHED    net nice
  295.  
  296. # ---------------------------------------------------------------------------
  297.  
  298. # Habeas Accredited Senders
  299. #     Last octet of the returned A record indicates the Habeas-assigned
  300. #    "Permission Level" of the Sender.
  301. #        10 to 39    Personal, transactional, and Confirmed Opt In
  302. #        40 to 59    Secure referrals and Single Opt In
  303. #        60 to 99    Checked but not accredited by Habeas.
  304. #
  305. # sa-accredit.habeas.com is for SpamAssassin use.
  306. #
  307. header HABEAS_ACCREDITED_COI    eval:check_rbl('habeas-firsttrusted', 'sa-accredit.habeas.com.', '127\.\d+\.\d+\.[123]\d')
  308. describe HABEAS_ACCREDITED_COI    Habeas Accredited Confirmed Opt-In or Better
  309. tflags HABEAS_ACCREDITED_COI    net nice
  310.  
  311. header HABEAS_ACCREDITED_SOI    eval:check_rbl_sub('habeas-firsttrusted', '127\.\d+\.\d+\.[45]\d')
  312. describe HABEAS_ACCREDITED_SOI    Habeas Accredited Opt-In or Better
  313. tflags HABEAS_ACCREDITED_SOI    net nice
  314.  
  315. header HABEAS_CHECKED        eval:check_rbl_sub('habeas-firsttrusted', '127\.\d+\.\d+\.[6789]\d')
  316. describe HABEAS_CHECKED        Habeas Checked
  317. tflags HABEAS_CHECKED        net nice
  318.  
  319. # Habeas Accredited Senders, with check for "Accreditor Assertion"
  320. #    Same Habeas whitelist checks as above, but performed only if the Sender
  321. #    has specified Habeas as their accreditor in either the EnvelopeFrom or
  322. #    "Accreditor" header field.  This reduces the DNS overhead, but will
  323. #    miss senders who are unable to add custom header fields.
  324. #
  325. # header HABEAS_ACCREDITED_COI    eval:check_rbl_accreditor('accredit-firsttrusted', 'sa-accredit.habeas.com.', '127\.\d+\.\d+\.[123]\d', 'habeas')
  326. # describe HABEAS_ACCREDITED_COI    Habeas Accredited Confirmed Opt-In or Better
  327. # tflags HABEAS_ACCREDITED_COI    net nice
  328. # header HABEAS_ACCREDITED_SOI    eval:check_rbl_accreditor('accredit-firsttrusted', 'sa-accredit.habeas.com.', '127\.\d+\.\d+\.[45]\d', 'habeas')
  329. # describe HABEAS_ACCREDITED_SOI    Habeas Accredited Opt-In or Better
  330. # tflags HABEAS_ACCREDITED_SOI    net nice
  331. # header HABEAS_CHECKED        eval:check_rbl_accreditor('accredit-firsttrusted', 'sa-accredit.habeas.com.', '127\.\d+\.\d+\.[6789]\d', 'habeas')
  332. # describe HABEAS_CHECKED        Habeas Checked
  333. # tflags HABEAS_CHECKED        net nice
  334.