Greenmail SMTP server doesn't handle periods correctly
Per http://tools.ietf.org/html/rfc5321#section-4.5.2 :

> ```
>  When a line of mail text is received by the SMTP server, it checks
>  the line.  If the line is composed of a single period, it is
>  treated as the end of mail indicator.  If the first character is a
>  period and there are other characters on the line, the first
>  character is deleted.
> ```

`com.icegreen.greenmail.mail.MovingMessage#readDotTerminatedContent` handles the the case of a line containing a single period, but does not handle the case where a line starts with a period and there are other characters.

The end result is mail sent to Greenmail's SMTP server can contain extra periods when retrieved via IMAP or POP3.

diff --git a/greenmail-core/src/main/java/com/icegreen/greenmail/mail/MovingMessage.java b/greenmail-core/src/main/java/com/icegreen/greenmail/mail/MovingMessage.java
index 03e6a64e..fbbfd15d 100644
--- a/greenmail-core/src/main/java/com/icegreen/greenmail/mail/MovingMessage.java
+++ b/greenmail-core/src/main/java/com/icegreen/greenmail/mail/MovingMessage.java
@@ -110,6 +110,8 @@ public class MovingMessage {
                 dataWriter.close();
 
                 break;
+            } else if (line.startsWith(".")) {
+                dataWriter.println(line.substring(1));
             } else {
                 dataWriter.println(line);
             }
diff --git a/greenmail-core/src/test/java/com/icegreen/greenmail/test/SmtpServerTest.java b/greenmail-core/src/test/java/com/icegreen/greenmail/test/SmtpServerTest.java
index c56b6f79..8a4b89f5 100644
--- a/greenmail-core/src/test/java/com/icegreen/greenmail/test/SmtpServerTest.java
+++ b/greenmail-core/src/test/java/com/icegreen/greenmail/test/SmtpServerTest.java
@@ -128,4 +128,14 @@ public class SmtpServerTest {
             assertEquals(i, gif[i]);
         }
     }
+
+    @Test
+    public void testSmtpServerLeadingPeriods() throws MessagingException {
+        String body = ". body with leading period";
+        GreenMailUtil.sendTextEmailTest("to@localhost.com", "from@localhost.com", "subject", body);
+        MimeMessage[] emails = greenMail.getReceivedMessages();
+        assertEquals(1, emails.length);
+        assertEquals("subject", emails[0].getSubject());
+        assertEquals(body, GreenMailUtil.getBody(emails[0]));
+    }
 }

['greenmail-core/src/test/java/com/icegreen/greenmail/test/SmtpServerTest.java', 'greenmail-core/src/main/java/com/icegreen/greenmail/mail/MovingMessage.java']