diff --git a/greenmail-core/src/main/java/com/icegreen/greenmail/store/SimpleMessageAttributes.java b/greenmail-core/src/main/java/com/icegreen/greenmail/store/SimpleMessageAttributes.java
index <HASH>..<HASH> 100644
--- a/greenmail-core/src/main/java/com/icegreen/greenmail/store/SimpleMessageAttributes.java
+++ b/greenmail-core/src/main/java/com/icegreen/greenmail/store/SimpleMessageAttributes.java
@@ -738,7 +738,7 @@ public class SimpleMessageAttributes
     }

 

     public String escapeHeader(final String text) {

-        return text.replace("\r", "\\\r").replace("\n", "\\\n").replace("\\", "\\\\").replace("\"", "\\\"");

+        return MimeUtility.unfold(text).replace("\\", "\\\\").replace("\"", "\\\"");

     }

 

 }
Use MimeUtility for unfolding.