commit bd1d6a2: [Test] Surbl IDN + punycode

korgoth1 vladislav.stakhov at gmail.com
Tue Nov 5 17:28:06 UTC 2019


Author: korgoth1
Date: 2019-11-05 19:29:05 +0300
URL: https://github.com/rspamd/rspamd/commit/bd1d6a278a614ea55d9439909acfefecce474b06

[Test] Surbl IDN + punycode

---
 test/functional/cases/340_surbl.robot                | 16 +++++++++++++++-
 test/functional/configs/plugins.conf                 | 20 ++++++++++++++++++++
 test/functional/messages/{whitelist.eml => url8.eml} |  2 +-
 test/functional/messages/url9.eml                    |  3 +++
 test/lua/unit/test_tld.dat                           |  1 +
 5 files changed, 40 insertions(+), 2 deletions(-)

diff --git a/test/functional/cases/340_surbl.robot b/test/functional/cases/340_surbl.robot
index 2531032b1..5137223bf 100644
--- a/test/functional/cases/340_surbl.robot
+++ b/test/functional/cases/340_surbl.robot
@@ -125,7 +125,21 @@ EMAILBL REPLY TO domain only
 EMAILBL REPLY TO full subdomain adress
   ${result} =  Scan Message With Rspamc  ${TESTDIR}/messages/replytosubdomain.eml
   Should Contain  ${result.stdout}  RSPAMD_EMAILBL_FULL (
-  Should Not Contain  ${result.stdout}  RSPAMD_EMAILBL_DOMAINONLY ( 
+  Should Not Contain  ${result.stdout}  RSPAMD_EMAILBL_DOMAINONLY (
+
+SURBL IDN domain
+  ${result} =  Scan Message With Rspamc  ${TESTDIR}/messages/url8.eml
+  Should Contain  ${result.stdout}  RSPAMD_URIBL
+  Should Contain  ${result.stdout}  DBL_SPAM
+  Should Not Contain  ${result.stdout}  DBL_PHISH
+  Should Not Contain  ${result.stdout}  URIBL_BLACK
+
+SURBL IDN Punycode domain
+  ${result} =  Scan Message With Rspamc  ${TESTDIR}/messages/url9.eml
+  Should Contain  ${result.stdout}  RSPAMD_URIBL
+  Should Contain  ${result.stdout}  DBL_SPAM
+  Should Not Contain  ${result.stdout}  DBL_PHISH
+  Should Not Contain  ${result.stdout}  URIBL_BLACK
 
 
 *** Keywords ***
diff --git a/test/functional/configs/plugins.conf b/test/functional/configs/plugins.conf
index f57314caa..1587ce584 100644
--- a/test/functional/configs/plugins.conf
+++ b/test/functional/configs/plugins.conf
@@ -539,6 +539,26 @@ options = {
           type = a;
           replies = ["127.0.0.2"];
         },
+        {
+          name = "jhcszdsmo3wuj5mp8t38kdisdmr3ib3q.test.uribl";
+          type = a;
+          replies = ["127.0.0.2"];
+        },
+        {
+          name = "g9ifs3q39oh5jwru94cj7ffaqd6rfyq6.test.uribl";
+          type = a;
+          replies = ["127.0.0.2"];
+        },
+        {
+          name = "xn--80arbjktj.xn--p1ai.test2.uribl";
+          type = a;
+          replies = ["127.0.1.2"];
+        },
+        {
+          name = "мойсайт.рф.test2.uribl";
+          type = a;
+          replies = ["127.0.1.2"];
+        },
         {
           name = "user.emailbl.com.test5.uribl";
           type = a;
diff --git a/test/functional/messages/whitelist.eml b/test/functional/messages/url8.eml
similarity index 50%
copy from test/functional/messages/whitelist.eml
copy to test/functional/messages/url8.eml
index aa19512a1..7d1358d88 100644
--- a/test/functional/messages/whitelist.eml
+++ b/test/functional/messages/url8.eml
@@ -1,3 +1,3 @@
 Content-Type: text/plain
 
-http://rspamd-test.com
+http://мойсайт.рф
\ No newline at end of file
diff --git a/test/functional/messages/url9.eml b/test/functional/messages/url9.eml
new file mode 100644
index 000000000..b6091f29d
--- /dev/null
+++ b/test/functional/messages/url9.eml
@@ -0,0 +1,3 @@
+Content-Type: text/plain
+
+http://xn--80arbjktj.xn--p1ai
\ No newline at end of file
diff --git a/test/lua/unit/test_tld.dat b/test/lua/unit/test_tld.dat
index 95fbae5a8..c1cd41723 100644
--- a/test/lua/unit/test_tld.dat
+++ b/test/lua/unit/test_tld.dat
@@ -3,3 +3,4 @@ org
 net
 рф
 za.org
+xn--p1ai


More information about the Commits mailing list