Show
Ignore:
Timestamp:
08/10/08 11:02:18 AM (5 months ago)
Author:
octorian
Message:

Added workaround for servers that sometimes send untagged responses after sending a message part (fix for #95)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/LogicMail-1.0/LogicMail/src/org/logicprobe/LogicMail/mail/imap/ImapProtocol.java

    r269 r270  
    625625        } 
    626626         
     627        // Workaround for mail servers that sometimes append untagged 
     628        // replies to the end of this response 
     629        int lastLineIndex = rawList.length - 1; 
     630        while(lastLineIndex > 0 && rawList[lastLineIndex].startsWith("* ")) { 
     631            lastLineIndex--; 
     632        } 
     633         
    627634        StringBuffer msgBuf = new StringBuffer(); 
    628         for(int i=1;i<rawList.length-1;i++) { 
     635        for(int i=1;i<lastLineIndex;i++) { 
    629636            msgBuf.append(rawList[i] + "\n"); 
    630637        } 
    631         String lastLine = rawList[rawList.length-1]; 
     638        String lastLine = rawList[lastLineIndex]; 
    632639        msgBuf.append(lastLine.substring(0, lastLine.lastIndexOf(')'))); 
    633640        return msgBuf.toString();