I've stumbled over a bug in decodemail: the decoded message has a little garbage inserted in the middle. Attached are two message files from two maildirs, the input and output of decodemail. In the output, after "498 " is inserted bogus "000 001 002 003 004 005 0"
The body of the input message is a single very long line, the numbers "000" through "999", with a space after each one, encoded as quoted-printable to insert soft line breaks. It kind of looks like it read some amount into a buffer, and then wrote a little more than that, including leftovers in the buffer from a previous read. Or it wraps around, or something. From my limited testing, it looks like this only happens when decoding a message reduces its size. (I tested one other sample message, the same 1000 numbers, but broken into 100 lines of 10 numbers each. That didn't need to be encoded with quoted-printable, and showed no error.) I've attached the message files as application/octet-stream, so they're base64 encodings of files that each contain a message. The input message, when the base64 is decoded, will be a message encoded as quoted-printable. (I hope.)
1642458468.V64Ib53e0cM310777.rain.home
Description: encoded qp
1642458532.M975986P55111Q5.rain.home
Description: decoded