Author: sebb Date: Fri Oct 5 19:25:34 2018 New Revision: 1842971 URL: http://svn.apache.org/viewvc?rev=1842971&view=rev Log: Don't replace default From source with blank
Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/examples/mail/IMAPExportMbox.java Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/examples/mail/IMAPExportMbox.java URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/examples/mail/IMAPExportMbox.java?rev=1842971&r1=1842970&r2=1842971&view=diff ============================================================================== --- commons/proper/net/trunk/src/main/java/org/apache/commons/net/examples/mail/IMAPExportMbox.java (original) +++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/examples/mail/IMAPExportMbox.java Fri Oct 5 19:25:34 2018 @@ -375,12 +375,16 @@ public final class IMAPExportMbox for(int i=1; i< replyStrings.length - 1; i++) { final String line = replyStrings[i]; if (line.startsWith("Return-Path: ")) { - String[] parts = line.split(" ", 2); - replyTo = parts[1]; - if (replyTo.startsWith("<")) { - replyTo = replyTo.substring(1,replyTo.length()-1); // drop <> wrapper - } else { - System.err.println("Unexpected Return-path:" + line+ " in " + firstLine); + String[] parts = line.split(" ", 2); + if (!parts[1].equals("<>")) {// Don't replace default with blank + replyTo = parts[1]; + if (replyTo.startsWith("<")) { + if (replyTo.endsWith(">")) { + replyTo = replyTo.substring(1,replyTo.length()-1); // drop <> wrapper + } else { + System.err.println("Unexpected Return-path: '" + line+ "' in " + firstLine); + } + } } break; }