Commit Graph

41 Commits (a7e177586aa363e7dee2d5c311bb79d254d833ab)

Author SHA1 Message Date
Manos Pitsidianakis a7e177586a
Fix clippy lints 2020-07-06 15:27:08 +03:00
Manos Pitsidianakis def3997d6f
email/parser.rs: replace "FIXME" errors 2020-06-26 21:12:57 +03:00
Manos Pitsidianakis 01d83d8088
email/parser: do not set has_colon newline
When parsing a field-name, and expecting a colon (:) if a newline is
first encountered do not set `has_colon` flag to true.
2020-06-20 13:14:40 +03:00
Manos Pitsidianakis 75f9256a50
email/parser: change Error type to include error location
Add ParsingError type that includes a string with the location and
possibly an explanation for the error.
2020-06-20 13:14:40 +03:00
Manos Pitsidianakis 6ec249dd7f
melib: update nom dependency from 3.2.0 to 5.1.1
That was hecking exhausting
2020-06-06 23:19:07 +03:00
Manos Pitsidianakis 815ff98acc
imap: add smarter untagged reply detection 2020-05-30 14:43:44 +03:00
Manos Pitsidianakis 671d473894
email/parser: avoid slice index panic if slice is empty 2020-05-19 13:01:09 +03:00
Manos Pitsidianakis b00d3c28c5
parser: fix panic on invalid encoded_word, display_addr
found by cargo-fuzz
2020-05-06 19:11:49 +03:00
Manos Pitsidianakis 5981f98f17
parser: fix panic on invalid message id 2020-05-06 18:58:00 +03:00
Manos Pitsidianakis f2ecb81612
parser: fix panic on invalid input
Found with cargo-fuzz
2020-05-06 18:47:37 +03:00
Manos Pitsidianakis 5d07a5147b
datetime: fix panic on invalid cstr conversion 2020-05-06 18:46:38 +03:00
Manos Pitsidianakis 33c1bf6558
Add consume newlines flag to phrase() 2020-02-26 15:53:46 +02:00
Manos Pitsidianakis 68007a0842
View decoded email source by default
Toggle between decoded/raw source with view_raw_source shortcut, default
M-r
2020-02-25 22:15:13 +02:00
Manos Pitsidianakis 6b7dea35dc
melib/parser: fix minor encoded word error 2020-02-08 23:55:47 +02:00
Manos Pitsidianakis 6afac835e0
melib/datetime: fix overflow panic on early date input 2020-02-08 23:55:47 +02:00
Manos Pitsidianakis 853fe14128
melib: fix two minor email parsing bugs
- windows-1250 encoding not being recognized
- spaces in Message-ID header messing up parsing '<' + msg-id + '>'
structure
2020-01-20 15:58:59 +02:00
Manos Pitsidianakis c0ac643f05
melib: add datetime module
Datetime module adds POSIX time functions interface
2020-01-06 16:10:36 +02:00
Manos Pitsidianakis 6671fe926e
melib: don't treat missing end boundary as error
Don't treat missing end boundary as error in multipart attachments.

python3's nntplib seems to return MIME attachments with this property
2020-01-02 00:09:21 +02:00
Manos Pitsidianakis c23cc45edd
melib: fix test import not found 2019-12-18 08:59:04 +02:00
Manos Pitsidianakis 1ee8ef7a05
JMAP WIP #4 2019-12-13 00:04:58 +02:00
Manos Pitsidianakis 7732b851e6
melib: fix minor header parsing errors
- set_subject checked if last byte was control character instead of last
character. Characters can be multi-byte, duh.
- email::parser::date didn't provide for Date values that had -0000
instead of +0000 (that's a chrono requirement/bug)
2019-12-12 00:44:47 +02:00
Manos Pitsidianakis e79d9aa1c2
melib/parser: parse quote-printable CRLF soft breaks
Check for CRLF soft breaks after checking for LF ones
2019-12-11 15:10:59 +02:00
Manos Pitsidianakis bb486ca9d8
melib: Remove quotes from addresses in email/parser.rs 2019-11-28 22:15:32 +02:00
Manos Pitsidianakis 3dfb2f4f2c
melib: fix out-of-bounds parser bug 2019-11-28 18:52:12 +02:00
Manos Pitsidianakis 58209d6f6b
Replace some panics with errors 2019-11-27 17:42:11 +02:00
Manos Pitsidianakis 449a24d075
ui: ListActions changes
- Parse List-Post value like List-Unsubscribe: comma separated angle bracket limited list of <mailto:> or <url> values
- Check if List-Archive value is angle bracket delimited
2019-11-18 14:55:48 +02:00
Manos Pitsidianakis fc2d9a684d
melib/imap: set has_attachments based on BODYSTRUCTURE
fetch BODYSTRUCTURE along with ENVELOPE from server and set
has_attachments based on the MIME structure of the envelope.

Notes: BODYSTRUCTURE returns the MIME structure of the envelope without
the data, so if it includes a multipart/mixed it *should* have
attachments.
ENVELOPE returns basic headers of the message like Sender, Subject, Date
etc.
2019-11-18 13:00:43 +02:00
Manos Pitsidianakis 56cda63c83
Fix some warnings 2019-11-14 17:55:24 +02:00
Manos Pitsidianakis a907b9c21d
Fix melib test errors 2019-11-09 18:10:22 +02:00
Manos Pitsidianakis 250129665b
Pass attachment names through decoding
Attachment names in Content-Type parameters can be encoded (eg
=?UTF-8...), so try decoding with phrase() first
2019-09-27 22:21:35 +03:00
Manos Pitsidianakis c44056a9ff
melib: fix bug in parser::parts
At a certain point when expecting a line terminator parts() checks for
'\n' but not '\r\n'. This resulted in all multipart attachments coming
from b"\r\n" sources like IMAP having only one part when parsed.
2019-09-26 13:11:54 +03:00
Manos Pitsidianakis 9305e543cf
melib: add a `body` field to Attachment
Attachment needs to know the range of bytes where the body part of the
attachment is located. The Attachment.raw field contains the entire
attachment, headers and body. The new Attachment.body fields contains a
`StrBuilder` which contains the offset and length of the body part inside
`raw`.
2019-09-26 13:10:06 +03:00
Manos Pitsidianakis ecb3fd7f3d
Add dyn keyword to Trait objects
And fix some unused var warnings as well
2019-09-15 13:21:14 +03:00
Manos Pitsidianakis 0812242f60
Add IMAP backend
TODOs: new message events (untagged responses)
2019-09-15 13:21:13 +03:00
Matthias Beyer 79becdcc42
Fix: This comment is not a proper rustdoc comment and probably should not be one anyways
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-08-02 01:00:54 +03:00
Matthias Beyer fb36dc58c8
Remove unused variable
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-08-02 01:00:53 +03:00
Manos Pitsidianakis 391e5b5d13
melib: tighten bounds check in email/parser.rs 2019-08-02 00:22:27 +03:00
Manos Pitsidianakis ba1d0c42e0
melib: add struct and parser for mailto: links 2019-06-18 21:59:50 +03:00
Manos Pitsidianakis 24831b3c13
Fix warnings, lints, and 2018 errors 2019-06-18 21:14:14 +03:00
Manos Pitsidianakis f0bd999f8c
parser: fix empty header value when header is last or when prefixed with
'\n'

when an empty header is last, the rest of the body keeps getting parsed
as headers. when header starts with '\n' because the value is long, the
value gets parsed as a name and the header parser fails.

closes #100

closes #101

closes #122
2019-06-10 19:40:51 +03:00
Manos Pitsidianakis c6674a294d
melib: unwrap mailbox module 2019-06-10 19:40:50 +03:00