commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1084634 - /commons/proper/net/trunk/src/main/java/org/apache/commons/net/PrintCommandListener.java
Date Wed, 23 Mar 2011 16:50:23 GMT
Author: sebb
Date: Wed Mar 23 16:50:22 2011
New Revision: 1084634

URL: http://svn.apache.org/viewvc?rev=1084634&view=rev
Log:
Handle IMAP secrets

Modified:
    commons/proper/net/trunk/src/main/java/org/apache/commons/net/PrintCommandListener.java

Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/PrintCommandListener.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/PrintCommandListener.java?rev=1084634&r1=1084633&r2=1084634&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/PrintCommandListener.java
(original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/PrintCommandListener.java
Wed Mar 23 16:50:22 2011
@@ -124,7 +124,15 @@ public class PrintCommandListener implem
                 __writer.print(cmd);
                 __writer.println(" *******"); // Don't bother with EOL marker for this!
             } else {
-                __writer.print(getPrintableString(event.getMessage()));
+                final String IMAP_LOGIN = "LOGIN";
+                if (IMAP_LOGIN.equalsIgnoreCase(cmd)) { // IMAP
+                    String msg = event.getMessage();
+                    msg=msg.substring(0, msg.indexOf(IMAP_LOGIN)+IMAP_LOGIN.length());
+                    __writer.print(msg);
+                    __writer.println(" *******"); // Don't bother with EOL marker for this!
+                } else {
+                    __writer.print(getPrintableString(event.getMessage()));
+                }
             }
         } else {
             __writer.print(getPrintableString(event.getMessage()));



Mime
View raw message