Commit Graph

47 Commits

Author SHA1 Message Date
Leah Neukirchen
2b4e3aa66d clean up whitespace 2017-01-26 20:27:26 +01:00
Christian Neukirchen
06cc4bd693 mblaze822: blaze822_addr: add simple group parsing
Just ignores the group name, and considers ; an address separator too.
2016-09-07 15:50:59 +02:00
Christian Neukirchen
e725365d45 blaze822: blaze822_addr: add bounds check when extracting display name
Discovered using the TREC 2005 Spam Public Corpora.
http://plg.uwaterloo.ca/~gvcormac/treccorpus/README.html
2016-09-01 15:38:21 +02:00
Christian Neukirchen
4bb35cbead blaze822: blaze822_addr: make a bit more robust
Start over when seeing another < in the address part.

Support "..." in the address part.
2016-08-09 15:49:59 +02:00
Christian Neukirchen
d458439970 import and use timegm from musl
It's ridiculous this function is not in the standards.
2016-08-08 16:28:25 +02:00
Christian Neukirchen
7575e07b9f blaze822: keep a pointer to the original header, if we have it anyway 2016-08-06 19:27:02 +02:00
Christian Neukirchen
2aaa3cecd8 blaze822: blaze822_chdr: downcase header 2016-08-01 00:04:35 +02:00
Christian Neukirchen
4296c369f6 blaze822: blaze822_hdr_: off-by-one for first header 2016-07-29 18:26:39 +02:00
Christian Neukirchen
7636f0977c blaze822: blaze822_file: allocate enough space for read 2016-07-29 15:41:41 +02:00
Christian Neukirchen
3d0c2f8b47 cleanups 2016-07-26 22:15:30 +02:00
Christian Neukirchen
fc4c696e3d blaze822: blaze822_file: allow unknown file size (e.g. pipes) 2016-07-26 19:39:27 +02:00
Christian Neukirchen
6592bdb912 import musl memmem 2016-07-26 18:10:39 +02:00
Christian Neukirchen
182a32ff9d blaze822: blaze822_addr: return 0 when no address is found
Also return null pointers instead of empty strings.
2016-07-25 13:10:35 +02:00
Christian Neukirchen
ac679b264c blaze822: fix header finding with CRLF 2016-07-21 20:37:10 +02:00
Christian Neukirchen
98c03d9023 blaze822: forgot to free
Found by clang-analyzer.
2016-07-21 20:27:33 +02:00
Christian Neukirchen
c12aa23777 blaze822: fix months. duh 2016-07-18 18:11:41 +02:00
Christian Neukirchen
22f456a2a0 clean up header includes 2016-07-18 17:06:41 +02:00
Christian Neukirchen
08032f89ba seq: import most parts of mseq, make blaze822_loop resolve ranges 2016-07-18 00:09:35 +02:00
Christian Neukirchen
d1e4b5f503 blaze822: add blaze822_headerlen 2016-07-16 22:18:29 +02:00
Christian Neukirchen
963380c9f1 blaze822: add blaze822_chdr to search for a header passed as C string 2016-07-16 19:44:21 +02:00
Christian Neukirchen
54f695dddf blaze822: iterate over headers 2016-07-14 15:40:48 +02:00
Christian Neukirchen
f101b728d9 blaze822: add mmap-based mail reader 2016-07-14 15:21:37 +02:00
Christian Neukirchen
7b6436797c blaze822: remaining fixes in new loop 2016-07-14 14:09:50 +02:00
Christian Neukirchen
1ff1ff3dd0 blaze822: avoid overflow in blaze822_hdr_ 2016-07-14 13:27:14 +02:00
Christian Neukirchen
266b904897 blaze822: rewrite inner loop
Do nul and crlf clean up first, only when required.
Replace line-detection loop with strchr.
2016-07-13 23:50:06 +02:00
Christian Neukirchen
4798cb386e blaze822: allow freeing of null pointers 2016-07-13 21:55:17 +02:00
Christian Neukirchen
005037e254 blaze822: blaze822_mem: use body=bodyend instead of body=0
Else we lose track of where we are during multipart when there is no
body (really a body of length 0).
2016-07-13 21:35:42 +02:00
Christian Neukirchen
411c9b632a blaze822: detect too short/empty headers 2016-07-13 21:08:05 +02:00
Christian Neukirchen
d0d371114c blaze822: compression fixes 2016-07-13 20:32:44 +02:00
Christian Neukirchen
d687378b62 blaze822: give in and actually unfold the lines 2016-07-13 18:00:09 +02:00
Christian Neukirchen
00954008cc blaze822: free line in blaze822_loop 2016-07-13 17:17:18 +02:00
Christian Neukirchen
39006b8c89 blaze822: off by one in blaze822_mem 2016-07-13 17:02:29 +02:00
Christian Neukirchen
5b84593e78 blaze822: fix blaze822_mem body start 2016-07-13 16:03:35 +02:00
Christian Neukirchen
6b639da842 blaze822: fix blaze822_file return value on error 2016-07-13 16:03:16 +02:00
Christian Neukirchen
8ba55bae99 blaze822_priv.h: macro cleanup 2016-07-13 15:56:50 +02:00
Christian Neukirchen
17355dbe63 blaze822: api refactoring 2016-07-13 15:52:39 +02:00
Christian Neukirchen
7c0663e0e5 blaze822: don't prefix first header with nul bytes
Instead, look for the first header as a special case.
This allows us to parse a header as-is without shifting in memory.
2016-07-13 15:22:47 +02:00
Christian Neukirchen
dab7da7bbc blaze822: parsing of in-memory messages 2016-07-13 15:01:38 +02:00
Christian Neukirchen
19ba414abc blaze822: header cleanup 2016-07-13 15:01:09 +02:00
Christian Neukirchen
5bc288f1aa blaze822: hackfix 2016-07-12 21:11:18 +02:00
Christian Neukirchen
4805ef9cce blaze822: default to 0 seconds when none given 2016-07-12 15:11:01 +02:00
Christian Neukirchen
44f781db44 blaze822: only increment end if we found the a header separator 2016-07-12 15:00:46 +02:00
Christian Neukirchen
a59445e614 blaze822: avoid tolower 2016-07-12 15:00:35 +02:00
Christian Neukirchen
d548547d99 add show 2016-07-11 21:50:04 +02:00
Christian Neukirchen
aa08ae31a0 extract main loop 2016-07-11 16:28:22 +02:00
Christian Neukirchen
171f44915f make blaze822 a library 2016-07-11 14:23:41 +02:00
Christian Neukirchen
30f0686fb2 various code that may end up as a mail client 2016-07-10 20:27:27 +02:00