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 <btell...@linagora.com>
Authored: Mon Mar 6 10:54:49 2017 +0700
Committer: benwa <btell...@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:<matth...@yopmail.com>
+C: rcpt to:<b...@mydomain.tld>
+C: data
+S: 250.*
+S: 250-PIPELINING
+S: 250-ENHANCEDSTATUSCODES
+S: 250-8BITMIME
+S: 250 STARTTLS
+S: 250 2.1.0 Sender <matth...@yopmail.com> OK
+S: 250 2.1.5 Recipient <b...@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:<matth...@yopmail.com>
+C: rcpt to:<b...@mydomain.tld>
+C: data
+S: 250.*
+S: 250-PIPELINING
+S: 250-ENHANCEDSTATUSCODES
+S: 250-8BITMIME
+S: 250 STARTTLS
+S: 250 2.1.0 Sender <matth...@yopmail.com> OK
+S: 250 2.1.5 Recipient <b...@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-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org

Reply via email to