2

I've already seen answer on similar topic, but rfc5322 says:

Unfolding is accomplished by simply removing any CRLF that is immediately followed by WSP.

this can break source spaceless text by adding into it spaces.

so how to fold values without spaces?

Community
  • 1
  • 1
Alexey
  • 75
  • 6

2 Answers2

3

The modern solution is to use RFC2047 encoding which allows completely arbitrary folding:

=?us-ascii?B?A?=
 =?us-ascii?B?B?=

encodes the single string AB, preserving the lack of spaces.

Synchro
  • 35,538
  • 15
  • 81
  • 104
tripleee
  • 175,061
  • 34
  • 275
  • 318
1

The header format does not allow breaking lines without spaces.

Note that there's nothing wrong with sending long lines — the length limit in header lines is 998 characters (Section 2.3), and if you need to send a header that contains more than 998 characters with no intervening spaces, you're probably doing something wrong.

jch
  • 5,382
  • 22
  • 41
  • 1
    this is all because I'm tryhard perfectionist and want to enforce My program to fold this values to 78 characters length. but thanks anyway for answer. – Alexey Oct 24 '14 at 15:44