aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Richard <[email protected]>2010-02-10 09:12:25 +0000
committerVincent Richard <[email protected]>2010-02-10 09:12:25 +0000
commit5c2d078b4fe3b29d1c95d8131a44f5eefda3e953 (patch)
tree167c6f976172ef956df4e1cbbf776a0eae5cd675
parentFixed compilation issue on Windows. (diff)
downloadvmime-5c2d078b4fe3b29d1c95d8131a44f5eefda3e953.tar.gz
vmime-5c2d078b4fe3b29d1c95d8131a44f5eefda3e953.zip
Allow spaces to appear in mailbox display name without encoding or quoting. Encode or quote if CR or LF is present.
-rw-r--r--src/mailbox.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mailbox.cpp b/src/mailbox.cpp
index f6df5165..036f003c 100644
--- a/src/mailbox.cpp
+++ b/src/mailbox.cpp
@@ -369,7 +369,7 @@ void mailbox::generate(utility::outputStream& os, const string::size_type maxLin
// We have to encode the name:
// - if it contains characters in a charset different from "US-ASCII",
// - and/or if it contains one or more of these special chars:
- // SPACE TAB " ; , < > ( ) @ / ? . = :
+ // CR LF TAB " ; , < > ( ) @ / ? . = :
// Check whether there are words that are not "US-ASCII"
// and/or contain the special chars.
@@ -386,7 +386,8 @@ void mailbox::generate(utility::outputStream& os, const string::size_type maxLin
{
switch (*c)
{
- case ' ':
+ case '\r':
+ case '\n':
case '\t':
case ';':
case ',':