<feed xmlns='http://www.w3.org/2005/Atom'>
<title>vmime/tests/parser, branch master</title>
<subtitle>A powerful C++ class library for working with RFC-822 and MIME messages and Internet messaging services like IMAP, POP or SMTP.</subtitle>
<id>http://git.bktus.com/gpgfrontend/vmime/atom?h=master</id>
<link rel='self' href='http://git.bktus.com/gpgfrontend/vmime/atom?h=master'/>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/vmime/'/>
<updated>2024-06-11T18:47:53Z</updated>
<entry>
<title>Fix a test failure in testNewFromString (#311)</title>
<updated>2024-06-11T18:47:53Z</updated>
<author>
<name>Jan Engelhardt</name>
<email>jengelh@inai.de</email>
</author>
<published>2024-06-11T18:47:53Z</published>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/vmime/commit/?id=aa60d004968aa8536251a6c0fedd3f1172add548'/>
<id>urn:sha1:aa60d004968aa8536251a6c0fedd3f1172add548</id>
<content type='text'>
Fixes an oversight in d296c2d1.</content>
</entry>
<entry>
<title>vmime: prevent loss of a space during text::createFromString (#306)</title>
<updated>2024-05-21T13:55:06Z</updated>
<author>
<name>Jan Engelhardt</name>
<email>jengelh@inai.de</email>
</author>
<published>2024-05-21T13:55:06Z</published>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/vmime/commit/?id=d296c2d1d590f8b4f619d9c555ff24ddecec1614'/>
<id>urn:sha1:d296c2d1d590f8b4f619d9c555ff24ddecec1614</id>
<content type='text'>
```
mailbox(text("Test München West", charsets::UTF_8), "a@b.de").generate();
```

produces

```
=?us-ascii?Q?Test_?= =?utf-8?Q?M=C3=BCnchen?= =?us-ascii?Q?West?= &lt;test@example.com&gt;
```

The first space between ``Test`` and ``München`` is encoded as an
underscore along with the first word: ``Test_``. The second space
between ``München`` and ``West`` is encoded with neither of the two
words and thus lost. Decoding the text results in ``Test
MünchenWest`` instead of ``Test München West``.

This is caused by how ``vmime::text::createFromString()`` handles
transitions between 7-bit and 8-bit words: If an 8-bit word follows a
7-bit word, a space is appended to the previous word. The opposite
case of a 7-bit word following an 8-bit word *misses* this behaviour.

When one fixes this problem, a follow-up issue appears:

``text::createFromString("a b\xFFc d")`` tokenizes the input into
``m_words={word("a "), word("b\xFFc ", utf8), word("d")}``. This
"right-side alignment" nature of the whitespace is a problem for
word::generate():

As per RFC 2047, spaces between adjacent encoded words are just
separators but not meant to be displayed. A space between an encoded
word and a regular ASCII text is not just a separator but also meant
to be displayed.

When word::generate() outputs the b-word, it would have to strip one
space, but only when there is a transition from encoded-word to
unencoded word. word::generate() does not know whether d will be
encoded or unencoded.

The idea now is that we could change the tokenization of
``text::createFromString`` such that whitespace is at the *start* of
words rather than at the end. With that, word::generate() need not
know anything about the next word, but rather only the *previous*
one.

Thus, in this patch,

1. The tokenization of ``text::createFromString`` is changed to
   left-align spaces and the function is fixed to account for
   the missing space on transition.
2. ``word::generate`` learns how to steal a space character.
3. Testcases are adjusted to account for the shifted
   position of the space.

Fixes: #283, #284

Co-authored-by: Vincent Richard &lt;vincent@vincent-richard.net&gt;</content>
</entry>
<entry>
<title>tests: switch a byte sequence in textTest (#305)</title>
<updated>2024-05-21T13:48:26Z</updated>
<author>
<name>Jan Engelhardt</name>
<email>jengelh@inai.de</email>
</author>
<published>2024-05-21T13:48:26Z</published>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/vmime/commit/?id=c105165c6e538a48a3713d41af7a2718a105eafb'/>
<id>urn:sha1:c105165c6e538a48a3713d41af7a2718a105eafb</id>
<content type='text'>
Switch out the byte sequence by one that is simiarly random, but one
which happens to decode as valid UTF-8, such that the expected and
actual strings are shown with reasonable characters on a terminal.</content>
</entry>
<entry>
<title>Fixes/comments for guessBestEncoding (#304)</title>
<updated>2024-05-21T13:47:05Z</updated>
<author>
<name>Jan Engelhardt</name>
<email>jengelh@inai.de</email>
</author>
<published>2024-05-21T13:47:05Z</published>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/vmime/commit/?id=b447adbe373d3940d2023d8e7a6ec21c7bfb8a48'/>
<id>urn:sha1:b447adbe373d3940d2023d8e7a6ec21c7bfb8a48</id>
<content type='text'>
* tests: add case for getRecommendedEncoding

* vmime: avoid integer multiply wraparound in wordEncoder::guessBestEncoding

If the input string is 42949673 characters long or larger, there will
be integer overflow on 32-bit platforms when multiplying by 100.
Switch that one computation to floating point.

* vmime: update comment in wordEncoder::guessBestEncoding</content>
</entry>
<entry>
<title>vmime: avoid changing SEVEN_BIT when encoding::decideImpl sees U+007F (#303)</title>
<updated>2024-05-21T13:45:29Z</updated>
<author>
<name>Jan Engelhardt</name>
<email>jengelh@inai.de</email>
</author>
<published>2024-05-21T13:45:29Z</published>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/vmime/commit/?id=97d15b8cd77998f37c279a023aa9f07def956e60'/>
<id>urn:sha1:97d15b8cd77998f37c279a023aa9f07def956e60</id>
<content type='text'>
* vmime: avoid changing SEVEN_BIT when encoding::decideImpl sees U+007F

Do not switch to QP/B64 when encountering U+007F.
U+007F is part of ASCII just as much as U+0001 is.

---------

Co-authored-by: Vincent Richard &lt;vincent@vincent-richard.net&gt;</content>
</entry>
<entry>
<title>Fixed possible recursion crash when parsing mailbox groups.</title>
<updated>2022-01-25T09:28:20Z</updated>
<author>
<name>vincent-richard</name>
<email>vincent@vincent-richard.net</email>
</author>
<published>2022-01-25T09:28:20Z</published>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/vmime/commit/?id=561746081f633245b326e31e6ef0f2ef20b48ef6'/>
<id>urn:sha1:561746081f633245b326e31e6ef0f2ef20b48ef6</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Prevent accessing empty buffer</title>
<updated>2021-05-15T20:32:24Z</updated>
<author>
<name>ibanic</name>
<email>ibanic@users.noreply.github.com</email>
</author>
<published>2021-05-15T20:32:24Z</published>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/vmime/commit/?id=5d78d879bb82d2466fe38ccaa3446fd74bf74b3b'/>
<id>urn:sha1:5d78d879bb82d2466fe38ccaa3446fd74bf74b3b</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Avoid force-encoding display names that fit within qcontent</title>
<updated>2020-12-11T22:10:39Z</updated>
<author>
<name>Jan Engelhardt</name>
<email>jengelh@inai.de</email>
</author>
<published>2020-12-09T15:58:57Z</published>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/vmime/commit/?id=f4c611b736ac290ec4f99faaa48b59fdd7c63809'/>
<id>urn:sha1:f4c611b736ac290ec4f99faaa48b59fdd7c63809</id>
<content type='text'>
When the display name contains an At sign, or anything of the sort,
libvmime would forcibly encode this to =?...?=, even if the line
is fine ASCII which only needs quoting.

rspamd takes excessive quoting as a sign of spam and penalizes
such mails by raising the score (rule/match: TO_EXCESS_QP et al.)
</content>
</entry>
<entry>
<title>#238 Fixed whitespace between encoded words</title>
<updated>2020-06-16T17:47:33Z</updated>
<author>
<name>vincent-richard</name>
<email>vincent@vincent-richard.net</email>
</author>
<published>2020-06-16T17:47:33Z</published>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/vmime/commit/?id=5c00f7867a9ad281025d07755a86121aaaf22242'/>
<id>urn:sha1:5c00f7867a9ad281025d07755a86121aaaf22242</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Added test.</title>
<updated>2020-06-02T16:13:34Z</updated>
<author>
<name>vincent-richard</name>
<email>vincent@vincent-richard.net</email>
</author>
<published>2020-06-02T16:13:34Z</published>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/vmime/commit/?id=9a10a839ec09d4cdd16cbb6ec067866c00db6bee'/>
<id>urn:sha1:9a10a839ec09d4cdd16cbb6ec067866c00db6bee</id>
<content type='text'>
</content>
</entry>
</feed>
