about summary refs log tree commit diff stats
path: root/worker/lib
Commit message (Collapse)AuthorAgeFilesLines
* go.mod: change base git urlRobin Jarry2021-11-053-4/+4
| | | | | | | I'm not sure what are the implications but it seems required. Link: https://github.com/golang/go/issues/20883 Signed-off-by: Robin Jarry <robin@jarry.cc>
* lib/parse: simplify parseAddressListReto Brunner2021-02-221-13/+5
|
* lib/parse: use go-message msgid parsing if it succeedsReto Brunner2020-11-141-2/+6
|
* remove models.Address in favor of go-message AddressReto Brunner2020-11-142-10/+11
| | | | | | | We made a new type out of go-message/mail.Address without any real reason. This suddenly made it necessary to convert from one to the other without actually having any benefit whatsoever. This commit gets rid of the additional type
* handle message unknown charset errorJeff Martin2020-08-313-2/+99
| | | | | | | | | | | | | | This change handles message parse errors by printing the error when the user tries to view the message. Specifically only handling unknown charset errors in this patch, but there are many types of invalid messages that can be handled in this way. aerc currently leaves certain messages in the msglist in the pending (spinner) state, and I'm unable to view or modify the message. aerc also only prints parse errors with message when they are initially loaded. This UX is a little better, because you can still see the header info about the message, and if you try to view it, you will see the specific error.
* base models.Address on the mail.Address typeReto Brunner2020-08-202-12/+2
| | | | | | | | | | | | This allows us to hook into the std libs implementation of parsing related stuff. For this, we need to get rid of the distinction between a mailbox and a host to just a single "address" field. However this is already the common case. All but one users immediately concatenated the mbox/domain to a single address. So this in effects makes it simpler for most cases and we simply do the transformation in the special case.
* improve date parsing for notmuch/maildirReto Brunner2020-08-101-24/+49
| | | | | | | | | | | | | | | | | | | | If a message date would fail to parse, the worker would never receive the MessageInfo it asked for, and so it wouldn't display the message. The problem is the spec for date formats is too lax, so trying to ensure we can parse every weird date format out there is not a strategy we want to pursue. On the other hand, preventing the user from reading and working with a message due to the error format is also not a solution. The maildir and notmuch workers will now fallback to the internal date, which is based on the received header if we can't parse the format of the Date header. The UI will also fallback to the received header whenever the date header can't be parsed. This patch is based on the work done by Lyudmil Angelov <lyudmilangelov@gmail.com> But tries to handle a parsing error a bit more gracefully instead of just returning the zero date.
* Remove hard coded bodystruct path everywhereReto Brunner2020-07-271-6/+4
| | | | | | | Aerc usually used the path []int{1} if it didn't know what the proper path is. However this only works for multipart messages and breaks if it isn't one. This patch removes all the hard coding and extracts the necessary helpers to lib.
* Make it easier to debug date parsing errorsLyudmil Angelov2020-07-111-1/+1
| | | | | | | | | When message dates failed to parse, the error displayed would try to include the time object it failed to obtain, which would display as something like 0001-01-01 00:00:00 UTC, which isn't of much help. Instead, display the text we were trying to parse into a date, which makes the problem easier to debug.
* Guess date from received if not presentelumbella2020-05-061-1/+41
|
* Initial support for PGP decryption & signaturesDrew DeVault2020-03-031-3/+3
|
* Cleanup sorting logicJeffas2020-02-281-155/+55
| | | | | | There was an unused error value as well as unnecessary usage of the sort interface. There should now be less copying so a bit better performance in some cases.
* worker/lib/parse: be more tolerant with parsing email addressesTimmy Douglas2020-02-061-1/+1
|
* maildir/notmuch: don't re-encode readersReto Brunner2020-01-051-37/+4
|
* Add labels to index format (%g)Reto Brunner2019-12-271-0/+6
| | | | Exposes the notmuch tags accordingly, stubs it for the maildir worker.
* Parse Reply-To header while parsing envelopeSrivathsan Murali2019-11-171-0/+5
|
* Add sorting functionalityJeffas2019-09-201-0/+253
| | | | | | | | There is a command and config option. The criteria are a list of the sort criterion and each can be individually reversed. This only includes support for sorting in the maildir backend currently. The other backends are not supported in this patch.
* all: rewrite references to strings.Index to strings.ContainsWagner Riffel2019-09-041-1/+1
| | | | Signed-off-by: Wagner Riffel <wgrriffel@gmail.com>
* Extract message parsing to common worker moduleReto Brunner2019-08-081-0/+240
Things like FetchEntityPartReader etc can be reused by most workers working with raw email files from disk (or any reader for that matter). This patch extract that common functionality in a separate package.