james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From btell...@apache.org
Subject [3/5] james-project git commit: JAMES-1954 Show that I can send any mail containing starttls in their content
Date Mon, 13 Mar 2017 11:33:24 GMT
JAMES-1954 Show that I can send any mail containing starttls in their content


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

Branch: refs/heads/master
Commit: 76f0f5b86ebe9c7eb5281e87cf9d30788278581d
Parents: 0ecf6d6
Author: benwa <btellier@linagora.com>
Authored: Mon Mar 6 10:54:49 2017 +0700
Committer: benwa <btellier@linagora.com>
Committed: Mon Mar 13 18:32:07 2017 +0700

----------------------------------------------------------------------
 .../james/mpt/smtp/SmtpStarttlsCommandTest.java   | 10 ++++++++++
 .../smtp/scripts/data_starts_with_starttls.test   | 18 ++++++++++++++++++
 .../james/smtp/scripts/data_with_starttls.test    | 18 ++++++++++++++++++
 3 files changed, 46 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/76f0f5b8/mpt/impl/smtp/core/src/main/java/org/apache/james/mpt/smtp/SmtpStarttlsCommandTest.java
----------------------------------------------------------------------
diff --git a/mpt/impl/smtp/core/src/main/java/org/apache/james/mpt/smtp/SmtpStarttlsCommandTest.java
b/mpt/impl/smtp/core/src/main/java/org/apache/james/mpt/smtp/SmtpStarttlsCommandTest.java
index 2dd7246..94141d7 100644
--- a/mpt/impl/smtp/core/src/main/java/org/apache/james/mpt/smtp/SmtpStarttlsCommandTest.java
+++ b/mpt/impl/smtp/core/src/main/java/org/apache/james/mpt/smtp/SmtpStarttlsCommandTest.java
@@ -62,4 +62,14 @@ public class SmtpStarttlsCommandTest extends AbstractSimpleScriptedTestProtocol
     public void starttlsShouldBeRejectedWhenFollowedByCommand() throws Exception {
         scriptTest("starttls_with_injection", Locale.US);
     }
+
+    @Test
+    public void shouldNotRejectContentWithStartTls() throws Exception {
+        scriptTest("data_with_starttls", Locale.US);
+    }
+
+    @Test
+    public void shouldNotRejectContentStartsWithStartTls() throws Exception {
+        scriptTest("data_starts_with_starttls", Locale.US);
+    }
 }

http://git-wip-us.apache.org/repos/asf/james-project/blob/76f0f5b8/mpt/impl/smtp/core/src/main/resources/org/apache/james/smtp/scripts/data_starts_with_starttls.test
----------------------------------------------------------------------
diff --git a/mpt/impl/smtp/core/src/main/resources/org/apache/james/smtp/scripts/data_starts_with_starttls.test
b/mpt/impl/smtp/core/src/main/resources/org/apache/james/smtp/scripts/data_starts_with_starttls.test
new file mode 100644
index 0000000..22b1fff
--- /dev/null
+++ b/mpt/impl/smtp/core/src/main/resources/org/apache/james/smtp/scripts/data_starts_with_starttls.test
@@ -0,0 +1,18 @@
+S: 220 mydomain.tld smtp
+C: ehlo yopmail.com
+C: mail from:<matthieu@yopmail.com>
+C: rcpt to:<bob@mydomain.tld>
+C: data
+S: 250.*
+S: 250-PIPELINING
+S: 250-ENHANCEDSTATUSCODES
+S: 250-8BITMIME
+S: 250 STARTTLS
+S: 250 2.1.0 Sender <matthieu@yopmail.com> OK
+S: 250 2.1.5 Recipient <bob@mydomain.tld> OK
+S: 354 Ok Send data ending with <CRLF>.<CRLF>
+C: subject: test
+C:
+C: starttls content
+C: .
+S: 250 2.6.0 Message received

http://git-wip-us.apache.org/repos/asf/james-project/blob/76f0f5b8/mpt/impl/smtp/core/src/main/resources/org/apache/james/smtp/scripts/data_with_starttls.test
----------------------------------------------------------------------
diff --git a/mpt/impl/smtp/core/src/main/resources/org/apache/james/smtp/scripts/data_with_starttls.test
b/mpt/impl/smtp/core/src/main/resources/org/apache/james/smtp/scripts/data_with_starttls.test
new file mode 100644
index 0000000..edd3a40
--- /dev/null
+++ b/mpt/impl/smtp/core/src/main/resources/org/apache/james/smtp/scripts/data_with_starttls.test
@@ -0,0 +1,18 @@
+S: 220 mydomain.tld smtp
+C: ehlo yopmail.com
+C: mail from:<matthieu@yopmail.com>
+C: rcpt to:<bob@mydomain.tld>
+C: data
+S: 250.*
+S: 250-PIPELINING
+S: 250-ENHANCEDSTATUSCODES
+S: 250-8BITMIME
+S: 250 STARTTLS
+S: 250 2.1.0 Sender <matthieu@yopmail.com> OK
+S: 250 2.1.5 Recipient <bob@mydomain.tld> OK
+S: 354 Ok Send data ending with <CRLF>.<CRLF>
+C: subject: test
+C:
+C: content starttls content
+C: .
+S: 250 2.6.0 Message received


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


Mime
View raw message