You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by bt...@apache.org on 2016/09/02 06:23:35 UTC

[10/11] james-project git commit: MAILET-121 Clarify that SenderIsRegex should not match sub parts

MAILET-121 Clarify that SenderIsRegex should not match sub parts


Project: http://git-wip-us.apache.org/repos/asf/james-project/repo
Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/6866fadd
Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/6866fadd
Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/6866fadd

Branch: refs/heads/master
Commit: 6866fadd39650624cb11af62c0d1d6cc5f661b0a
Parents: 9736dfc
Author: Benoit Tellier <bt...@linagora.com>
Authored: Wed Aug 31 15:18:23 2016 +0700
Committer: Benoit Tellier <bt...@linagora.com>
Committed: Fri Sep 2 13:22:36 2016 +0700

----------------------------------------------------------------------
 .../james/transport/matchers/SenderIsRegexTest.java     | 12 ++++++++++++
 1 file changed, 12 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/6866fadd/mailet/standard/src/test/java/org/apache/james/transport/matchers/SenderIsRegexTest.java
----------------------------------------------------------------------
diff --git a/mailet/standard/src/test/java/org/apache/james/transport/matchers/SenderIsRegexTest.java b/mailet/standard/src/test/java/org/apache/james/transport/matchers/SenderIsRegexTest.java
index 6345f33..aeddff2 100644
--- a/mailet/standard/src/test/java/org/apache/james/transport/matchers/SenderIsRegexTest.java
+++ b/mailet/standard/src/test/java/org/apache/james/transport/matchers/SenderIsRegexTest.java
@@ -61,6 +61,18 @@ public class SenderIsRegexTest {
     }
 
     @Test
+    public void shouldNotMatchSubParts() throws Exception {
+        matcher.init(new FakeMatcherConfig("SenderIsRegex=test", FakeMailContext.defaultContext()));
+
+        FakeMail fakeMail = FakeMail.builder()
+            .sender(new MailAddress(SENDER_NAME))
+            .recipient(recipient)
+            .build();
+
+        assertThat(matcher.match(fakeMail)).isNull();
+    }
+
+    @Test
     public void shouldNotMatchWhenNullSender() throws Exception {
         matcher.init(new FakeMatcherConfig("SenderIsRegex=.*@.*", FakeMailContext.defaultContext()));
 


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org