bug-classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug inetlib/29340] New: SMTP Messages with lines with a leading dot (or


From: rslemos at gmail dot com
Subject: [Bug inetlib/29340] New: SMTP Messages with lines with a leading dot (or period)
Date: 4 Oct 2006 00:59:01 -0000

Trying to send an SMTP message with a CSS attached, and the output at MUA was
messy. The cause was the CSS lines, which (almost all) start with a dot.

According to RFC 2821, section 4.5.2, on Transparency, whenever a dot is found
at the beginning of a line, the MUA should escape it (with another dot); the
server MUST remove THE FIRST leading dot IFF the line is not a dot by itself.

Patch follows (albeit a simple one, not the best one)
------------- cut-here -------------
--- source/gnu/inet/util/MessageOutputStream.java       2004-11-25
20:15:05.000000000 -0200
+++ source/gnu/inet/util/MessageOutputStream.java       2006-10-03
21:48:22.000000000 -0300
@@ -43,7 +43,7 @@
 import java.io.OutputStream;

 /**
- * An output stream that escapes any dots on a line by themself with
+ * An output stream that escapes any dots at the very beginning of a line with
  * another dot, for the purposes of sending messages to SMTP and NNTP
  * servers.
  *
@@ -81,7 +81,7 @@
   public void write(int c)
     throws IOException
   {
-    if (last[0] == LF && last[1] == END && c == LF)
+    if (last[0] == LF && last[1] == END)
       {
         out.write (END);
       }
@@ -105,7 +105,7 @@
     for (int i = 0; i < len; i++)
       {
         int c = (int) bytes[off + i];
-        if (last[0] == LF && last[1] == END && c == LF)
+        if (last[0] == LF && last[1] == END)
           {
             byte[] b2 = new byte[bytes.length + 1];
             System.arraycopy(bytes, off, b2, off, i);
------------- cut-here -------------


-- 
           Summary: SMTP Messages with lines with a leading dot (or period)
           Product: classpath
           Version: unspecified
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: inetlib
        AssignedTo: dog at gnu dot org
        ReportedBy: rslemos at gmail dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29340





reply via email to

[Prev in Thread] Current Thread [Next in Thread]