smiley22 / S22.Imap

A free, easy-to-use and well-documented .NET library component for communicating with IMAP servers
http://smiley22.github.com/S22.Imap/Documentation/
MIT License
211 stars 115 forks source link

UTF7 code doesn't encode 0x7F character as BASE64. #149

Open TSlivede opened 5 years ago

TSlivede commented 5 years ago

Pointed out by Aleksey on stackoverflow:

Line 347 in Util.cs should be if (codepoint > 0x1F && codepoint < 0x7F) { instead of if (codepoint > 0x1F && codepoint < 0x80) {

Line 354 in Util.cs should be if (codepoint > 0x1F && codepoint < 0x7F) instead of if (codepoint > 0x1F && codepoint < 0x80)

because according to RFC-3501

[...] All other characters (octet values 0x00-0x1f and 0x7f-0xff) are represented in modified BASE64 [...]

0x7F should not be passed through unencoded, because it is a control character (DEL) and not a printable ASCII-character.