You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

340_surbl.robot 7.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. *** Settings ***
  2. Suite Setup Surbl Setup
  3. Suite Teardown Surbl Teardown
  4. Library ${TESTDIR}/lib/rspamd.py
  5. Resource ${TESTDIR}/lib/rspamd.robot
  6. Variables ${TESTDIR}/lib/vars.py
  7. *** Variables ***
  8. ${CONFIG} ${TESTDIR}/configs/plugins.conf
  9. ${RSPAMD_SCOPE} Suite
  10. ${URL_TLD} ${TESTDIR}/../lua/unit/test_tld.dat
  11. *** Test Cases ***
  12. SURBL resolve ip
  13. ${result} = Scan Message With Rspamc ${TESTDIR}/messages/url7.eml
  14. Should Contain ${result.stdout} URIBL_SBL_CSS (0.00)[8.8.8.9:example.ru
  15. Should Contain ${result.stdout} URIBL_XBL (0.00)[8.8.8.8:example.ru
  16. Should Contain ${result.stdout} URIBL_PBL (0.00)[8.8.8.8:example.ru
  17. SURBL Example.com domain
  18. ${result} = Scan Message With Rspamc ${TESTDIR}/messages/url4.eml
  19. Should Contain ${result.stdout} RSPAMD_URIBL
  20. Should Contain ${result.stdout} DBL_SPAM
  21. Should Not Contain ${result.stdout} DBL_PHISH
  22. Should Not Contain ${result.stdout} URIBL_BLACK
  23. SURBL Example.net domain
  24. ${result} = Scan Message With Rspamc ${TESTDIR}/messages/url5.eml
  25. Should Contain ${result.stdout} DBL_PHISH
  26. Should Not Contain ${result.stdout} DBL_SPAM
  27. Should Not Contain ${result.stdout} RSPAMD_URIBL
  28. Should Not Contain ${result.stdout} URIBL_BLACK
  29. SURBL Example.org domain
  30. ${result} = Scan Message With Rspamc ${TESTDIR}/messages/url6.eml
  31. Should Contain ${result.stdout} URIBL_BLACK
  32. Should Not Contain ${result.stdout} DBL_SPAM
  33. Should Not Contain ${result.stdout} RSPAMD_URIBL
  34. Should Not Contain ${result.stdout} DBL_PHISH
  35. SURBL Example.ru domain
  36. ${result} = Scan Message With Rspamc ${TESTDIR}/messages/url7.eml
  37. Should Contain ${result.stdout} URIBL_GREY
  38. Should Contain ${result.stdout} URIBL_RED
  39. Should Not Contain ${result.stdout} DBL_SPAM
  40. Should Not Contain ${result.stdout} RSPAMD_URIBL
  41. Should Not Contain ${result.stdout} DBL_PHISH
  42. Should Not Contain ${result.stdout} URIBL_BLACK
  43. SURBL Example.ru ZEN domain
  44. ${result} = Scan Message With Rspamc ${TESTDIR}/messages/url7.eml
  45. Should Contain ${result.stdout} URIBL_SBL_CSS (
  46. Should Contain ${result.stdout} URIBL_XBL (
  47. Should Contain ${result.stdout} URIBL_PBL (
  48. Should Not Contain ${result.stdout} URIBL_SBL (
  49. Should Not Contain ${result.stdout} DBL_SPAM (
  50. Should Not Contain ${result.stdout} RSPAMD_URIBL (
  51. Should Not Contain ${result.stdout} DBL_PHISH (
  52. Should Not Contain ${result.stdout} URIBL_BLACK (
  53. SURBL Example.com domain image false
  54. ${result} = Scan Message With Rspamc ${TESTDIR}/messages/urlimage.eml
  55. Should Contain ${result.stdout} RSPAMD_URIBL_IMAGES
  56. Should Not Contain ${result.stdout} DBL_SPAM (
  57. Should Not Contain ${result.stdout} RSPAMD_URIBL (
  58. Should Not Contain ${result.stdout} DBL_PHISH (
  59. Should Not Contain ${result.stdout} URIBL_BLACK (
  60. SURBL @example.com mail html
  61. ${result} = Scan Message With Rspamc ${TESTDIR}/messages/mailadr.eml
  62. Should Contain ${result.stdout} RSPAMD_URIBL (
  63. Should Contain ${result.stdout} DBL_SPAM (
  64. Should Contain ${result.stdout} example.com:email
  65. Should Not Contain ${result.stdout} RSPAMD_URIBL_IMAGES (
  66. Should Not Contain ${result.stdout} DBL_PHISH (
  67. Should Not Contain ${result.stdout} URIBL_BLACK (
  68. SURBL @example.com mail text
  69. ${result} = Scan Message With Rspamc ${TESTDIR}/messages/mailadr2.eml
  70. Should Contain ${result.stdout} RSPAMD_URIBL (
  71. Should Contain ${result.stdout} DBL_SPAM (
  72. Should Contain ${result.stdout} example.com:email
  73. Should Not Contain ${result.stdout} RSPAMD_URIBL_IMAGES (
  74. Should Not Contain ${result.stdout} DBL_PHISH (
  75. Should Not Contain ${result.stdout} URIBL_BLACK (
  76. SURBL example.com not encoded url in subject
  77. ${result} = Scan Message With Rspamc ${TESTDIR}/messages/urlinsubject.eml
  78. Should Contain ${result.stdout} RSPAMD_URIBL (
  79. Should Contain ${result.stdout} DBL_SPAM (
  80. Should Not Contain ${result.stdout} DBL_PHISH (
  81. Should Not Contain ${result.stdout} URIBL_BLACK (
  82. SURBL example.com encoded url in subject
  83. ${result} = Scan Message With Rspamc ${TESTDIR}/messages/urlinsubjectencoded.eml
  84. Should Contain ${result.stdout} RSPAMD_URIBL (
  85. Should Contain ${result.stdout} DBL_SPAM (
  86. Should Not Contain ${result.stdout} DBL_PHISH (
  87. Should Not Contain ${result.stdout} URIBL_BLACK (
  88. WHITELIST
  89. ${result} = Scan Message With Rspamc ${TESTDIR}/messages/whitelist.eml
  90. Should Not Contain ${result.stdout} RSPAMD_URIBL (
  91. Should Not Contain ${result.stdout} DBL_SPAM (
  92. Should Not Contain ${result.stdout} RSPAMD_URIBL_IMAGES (
  93. EMAILBL full address & domain only
  94. ${result} = Scan Message With Rspamc ${TESTDIR}/messages/emailbltext.eml
  95. Should Contain ${result.stdout} RSPAMD_EMAILBL_FULL (
  96. Should Contain ${result.stdout} RSPAMD_EMAILBL_DOMAINONLY (
  97. EMAILBL full subdomain address
  98. ${result} = Scan Message With Rspamc ${TESTDIR}/messages/emailbltext2.eml
  99. Should Contain ${result.stdout} RSPAMD_EMAILBL_FULL (
  100. EMAILBL full subdomain address & domain only
  101. ${result} = Scan Message With Rspamc ${TESTDIR}/messages/emailbltext3.eml
  102. Should Contain ${result.stdout} RSPAMD_EMAILBL_DOMAINONLY (0.00)[baddomain.com:email]
  103. Should Contain ${result.stdout} RSPAMD_EMAILBL_FULL (0.00)[user.subdomain.baddomain.com:email]
  104. EMAILBL REPLY TO full address
  105. ${result} = Scan Message With Rspamc ${TESTDIR}/messages/replyto.eml
  106. Should Contain ${result.stdout} RSPAMD_EMAILBL_FULL (
  107. Should Not Contain ${result.stdout} RSPAMD_EMAILBL_DOMAINONLY (
  108. EMAILBL REPLY TO domain only
  109. ${result} = Scan Message With Rspamc ${TESTDIR}/messages/replyto2.eml
  110. Should Contain ${result.stdout} RSPAMD_EMAILBL_DOMAINONLY (
  111. Should Not Contain ${result.stdout} RSPAMD_EMAILBL_FULL (
  112. EMAILBL REPLY TO full subdomain address
  113. ${result} = Scan Message With Rspamc ${TESTDIR}/messages/replytosubdomain.eml
  114. Should Contain ${result.stdout} RSPAMD_EMAILBL_FULL (
  115. Should Not Contain ${result.stdout} RSPAMD_EMAILBL_DOMAINONLY (
  116. SURBL IDN domain
  117. ${result} = Scan Message With Rspamc ${TESTDIR}/messages/url8.eml
  118. Should Contain ${result.stdout} RSPAMD_URIBL
  119. Should Contain ${result.stdout} DBL_SPAM
  120. Should Not Contain ${result.stdout} DBL_PHISH
  121. Should Not Contain ${result.stdout} URIBL_BLACK
  122. SURBL IDN Punycode domain
  123. ${result} = Scan Message With Rspamc ${TESTDIR}/messages/url9.eml
  124. Should Contain ${result.stdout} RSPAMD_URIBL
  125. Should Contain ${result.stdout} DBL_SPAM
  126. Should Not Contain ${result.stdout} DBL_PHISH
  127. Should Not Contain ${result.stdout} URIBL_BLACK
  128. SURBL html entity&shy
  129. ${result} = Scan Message With Rspamc ${TESTDIR}/messages/url10.eml
  130. Should Contain ${result.stdout} RSPAMD_URIBL
  131. SURBL url compose map 1
  132. ${result} = Scan Message With Rspamc ${TESTDIR}/messages/url11.eml
  133. Should Contain ${result.stdout} BAD_SUBDOMAIN (0.00)[clean.dirty.sanchez.com:url]
  134. SURBL url compose map 2
  135. ${result} = Scan Message With Rspamc ${TESTDIR}/messages/url12.eml
  136. Should Contain ${result.stdout} BAD_SUBDOMAIN (0.00)[4.very.dirty.sanchez.com:url]
  137. SURBL url compose map 3
  138. ${result} = Scan Message With Rspamc ${TESTDIR}/messages/url13.eml
  139. Should Contain ${result.stdout} BAD_SUBDOMAIN (0.00)[41.black.sanchez.com:url]
  140. *** Keywords ***
  141. Surbl Setup
  142. ${PLUGIN_CONFIG} = Get File ${TESTDIR}/configs/surbl.conf
  143. Set Suite Variable ${PLUGIN_CONFIG}
  144. Generic Setup PLUGIN_CONFIG
  145. Surbl Teardown
  146. Normal Teardown
  147. Terminate All Processes kill=True