Commit Graph

30 Commits

Author SHA1 Message Date
Leah Neukirchen
66d0eff12f style 2017-08-31 17:30:17 +02:00
Leah Neukirchen
4a685de739 mmime: ensure 7bit or 8bit Content-Transfer-Encoding for message/rfc822 parts
RFC 2046, Section 5.2.1:
> No encoding other than "7bit", "8bit", or "binary" is permitted for
> the body of a "message/rfc822" entity.

(We'll generate 8bit when we have to and put the blame on the MTA.)
2017-07-09 21:25:55 +02:00
Leah Neukirchen
958ad4e9f6 mmime: disregard line length restriction for message/rfc822 attachments
Many webmail client's don't like qp-encoded message/rfc822 attachments.
2017-07-09 18:46:00 +02:00
Leah Neukirchen
613a1182ff mmime: gen_qp: ensure not to split utf8 multibyte sequences into encoded words
RFC2047, 5.(3):
> Each 'encoded-word' MUST represent an integral number of characters.
> A multi-octet character may not be split across adjacent 'encoded-
> word's.
2017-06-29 16:43:47 +02:00
Leah Neukirchen
fc4e4af774 mmime: don't generate empty filenames 2017-06-19 13:26:40 +02:00
Leah Neukirchen
cc7ab25814 mmime: allow setting content-disposition and overriding filename 2017-06-19 13:24:49 +02:00
Leah Neukirchen
938b2c2d31 mmime: gen_attachment: try to generate filenames as atoms, use qp for double quotes 2017-06-12 15:31:27 +02:00
Leah Neukirchen
46a44e2f22 mmime: add mblaze/raw for plain text inclusion 2017-05-26 23:24:26 +02:00
Leah Neukirchen
d8976d416c mmime: add -t to override toplevel content-type 2017-05-26 22:00:55 +02:00
Leah Neukirchen
67c0a3b17c mmime: print_header: only force qp-encoding for overlong lines
Lines SHOULD not be longer than 78 chars, and we try to fold like that,
but we only enforce qp-encoding for 7-bit safe lines if they would be
longer than 998, which they MUST not be.
2017-04-30 18:37:06 +02:00
Leah Neukirchen
f53e8dc672 mmime: check: allow up to 998 chars in header lines 2017-04-30 18:37:06 +02:00
Leah Neukirchen
d75c446aff mmime: use RFC2231 for Content-Disposition when needed 2017-04-06 21:02:16 +02:00
Leah Neukirchen
d73a3a748a mmime: gen_file: append newline to error message 2017-03-30 15:40:05 +02:00
Leah Neukirchen
2d612ce166 mmime: print_header: refactor
Simplifies the code considerably.  QP-header-wrapping now happens inside
gen_qp.  We wrap the line in advance when this will save QP-encoding, or
splitting a QP-word into two.

Fixes #20.
2017-03-28 01:03:40 +02:00
Leah Neukirchen
2b4e3aa66d clean up whitespace 2017-01-26 20:27:26 +01:00
Christian Neukirchen
2ef903a065 mmime: don't truncate a #type line when it has invalid syntax 2016-11-08 16:34:34 +01:00
Christian Neukirchen
3095d48655 mmime: ensure a new token in qp header generation 2016-11-08 16:20:44 +01:00
Christian Neukirchen
f56755cffd mman: gen_file: slurp the file instead of mmap 2016-10-05 14:45:42 +02:00
Christian Neukirchen
0b2e4880f5 mmime: gen_build: don't crash on #-line without space 2016-10-05 14:31:41 +02:00
Christian Neukirchen
472a74b75b use getdelim instead of getline
Avoids weird macros to build on FreeBSD.
2016-09-05 14:20:55 +02:00
Christian Neukirchen
f9226dde7b mmime: generate LF before MIME boundaries 2016-08-06 19:15:12 +02:00
Christian Neukirchen
d138866fd6 mmime: line length must be <=78 2016-08-02 16:51:17 +02:00
Christian Neukirchen
c4822a983b mmime: add -c to check if MIME-encoding is needed 2016-08-02 14:09:28 +02:00
Christian Neukirchen
2073102d4d mmime: add -r for plain text 2016-08-02 14:01:18 +02:00
Christian Neukirchen
a52af29aa9 mmime: simplify 2016-08-02 13:50:47 +02:00
Christian Neukirchen
cf594afb83 mmime: fix prevq logic 2016-08-01 17:18:16 +02:00
Christian Neukirchen
0ce958a22c mmime: only qp after newline when actually needed 2016-08-01 14:26:37 +02:00
Christian Neukirchen
c6d4c79771 mmime: delete dead store
Found by clang-analyzer.
2016-07-26 00:35:59 +02:00
Christian Neukirchen
b8c2685a60 mmime: encode headers when neccessary
This is still a bit clumsy, but I'm not sure how to make it better.
2016-07-25 15:19:19 +02:00
Christian Neukirchen
9545981777 add mmime 2016-07-20 22:43:58 +02:00