Instead of injecting spaces to ensure that lines stay under 76 characters only wrap at whitespace characters. This avoids changing the headers.
A best-effort to keep lines under 76 characters is still done, however it is only done at whitespace. Notably there is no hard wrap enforced. This means that it is possible for headers to break the 1000 character line-length limit in the specification. It is just hoped that the receiver will allow long lines in this case.
Closes#688
Co-authored-by: Kevin Cox <kevincox@kevincox.ca>
* Replace hyperx Header and Headers with our own implementation
* Remove utf8_b
* Add RFC 1522 encoder
* Fix most tests
* Throw away old tests
* Header encoding tests
* Fix slicing in the middle of a char
* Content-Disposition after rebase
* Fix the rest of the tests
* Fix useless clone clippy warnings
* Remove Headers::get_raw_mut
* HeaderName::new_from_ascii fallible API
* Tidy up HeaderName::new_from_ascii_str
* HeaderName::new_from_ascii(_str) tests
Fixes https://tools.ietf.org/tools/msglint/ warning about the
Content-Type header being too long.
I looked at many emails I received over time and I couldn't find
any with a boundary as long as ours, so this isn't only justified
by making some tool happy.
The textnonce dependency pulls in quite a few transitive dependencies.
However, we only use the dependency in a single location, to generate
MIME boundaries. For this, we can use `rand` directly (which is already
a transitive dependency anyways, since it's required by uuid).
This reduces the dependency count for a standard build from 117 to 105.
* Update dependencies (#386)
* Update dependencies and set MSRV to 1.40
* update hyperx
* Use display instead of description for errors
* Make hostname an optional feature
* Envelope from headers
* Update hyperx to 1.0
* rename builder to message
* Cleanup and make Transport send Messages
* Update rustls from 0.16 to 0.17
* Move transports into a common folder
* Merge imports from same crate
* Add message creation example to the site
* Hide "extern crate" in doc examples
* Add References and In-Reply-To methods
* Add message-id header
* Add blog posts and improve doc examples