summaryrefslogtreecommitdiff
path: root/alot/db
Commit message (Collapse)AuthorAge
* db/manager: support flexible database locationAnton Khirnov2022-02-05
| | | | | In newer notmuch versions it no longer needs to be stored along with the emails themselves.
* helper: move guess_mimetype into its own fileAnton Khirnov2021-11-24
|
* mail/reply: rewrite recipient selectionAnton Khirnov2021-11-24
| | | | | | | | Thoroughly ensure that To+Cc contains neither our own address (except when it is wanted) nor any duplicates. Use structured headers provided by email.headerregistry to simplify dealing with addr-spec vs. mailbox (display name + <addr-spec>).
* mail: add a custom email policyAnton Khirnov2021-11-24
| | | | Uses structured parsing for more headers.
* utils/mailcap: fix filename handlingAnton Khirnov2021-11-20
| | | | | It is only relevant for the sanitize_attachment_filename hook, so never got triggered.
* db/message: work around python bug 39100Anton Khirnov2021-11-20
|
* db/message: do not assume all messages have a 'from' headerAnton Khirnov2021-06-07
|
* db/message: make sure attachment data is always a byte sequenceAnton Khirnov2021-05-15
| | | | Encode text strings to UTF-8 and set the charset parameter accordingly.
* db/message: apply _fixup_charset() to attachments as wellAnton Khirnov2021-05-15
|
* db/message: override missing content-type charset to utf-8Anton Khirnov2021-05-15
| | | | | Strictly speaking it should be inferred to be us-ascii when missing, but utf-8 is a safer (and compatible) choice.
* db/message: stop loading the email in the constructorAnton Khirnov2021-05-13
| | | | | | | The last bit of code in the constructor accessing the email was the chunk parsing the author. Move it to the author accessor, and also make it use the 'From' header value loaded from the Notmuch message (which is stored in the database).
* db/message: turn _email and body into cached propertiesAnton Khirnov2021-05-13
| | | | | Does not really change much for now, since the email is still loaded in the constructor, but will allow optimization later.
* db/message: remove get_email()Anton Khirnov2021-05-13
| | | | | It has no more callers left. The email object should no longer be accessed directly.
* commands/thread:ReplyCommand: use the message headers object for building replyAnton Khirnov2021-05-13
|
* commands/thread: use the headers object for building reply subjectAnton Khirnov2021-05-13
|
* db/manager: optimize database modificationsAnton Khirnov2021-03-18
| | | | | | | Add only tags that are not present on the message, remove only tags that are present. Otherwise the no-op modification results in an actual db write, even though nothing changes.
* widgets/search: display the number of matching messages in the threadAnton Khirnov2021-02-10
|
* db/message: handle text MIME with invalid charsetsAnton Khirnov2021-02-08
|
* commands/search: refactor applying the tag commandAnton Khirnov2021-02-07
| | | | Apply toggle as a single db write rather than two.
* db/manager: rewrite db write operation APIAnton Khirnov2021-02-07
| | | | Allows to apply multiple operations together as a single unit.
* db/manager: use only one worker thread for write operationsAnton Khirnov2021-02-05
| | | | | There is no point in having more, as the database cannot have more than one writer at any moment.
* buffers/search: fix handling malformed queriesAnton Khirnov2021-01-31
|
* db: use symbolic constants for sort ordersAnton Khirnov2021-01-31
|
* db: drop unused module-level importsAnton Khirnov2021-01-30
|
* db/manager: handle notmuch exceptions in count_*Anton Khirnov2021-01-30
|
* db/attachment: move to mail/Anton Khirnov2021-01-30
| | | | It has nothing whatsoever to do with the database.
* db/attachment: simplify the Attachment classAnton Khirnov2021-01-30
| | | | | Make it a plain container around raw data and a few bits of metadata, rather than around a whole MIME part.
* db/envelope: move to a new module "mail"Anton Khirnov2021-01-30
| | | | It has nothing to do with the database.
* db/envelope: switch to the "new" (EmailMessage) python APIAnton Khirnov2021-01-30
| | | | | | | | | | email.mime is a part of the old API, which does not mix well with the new one (i.e. when email.policy.SMTP is used), specifically when non-ASCII headers are used. Additionally, clean the APIs that accept either EmailMessage or a str to only expect EmailMessage. Supporting both just adds confusion and complexity.
* helper: move mimewrap() to the only place where it is calledAnton Khirnov2021-01-26
|
* db/message: use DEVNULL stdin when there is no inputAnton Khirnov2021-01-26
| | | | Avoid the child grabbing our stdin.
* Rewrite mailcap handling.Anton Khirnov2021-01-26
| | | | | | | | | | | Add a class that encapsulates the handler and is responsible for managing the temporary file, if one is needed. Use this class for both rendering inline content and displaying attachments externally. External attachments are now wrapped in an asyncio task that is added to a pool of tasks managed by ui.
* db/manager: fix signature of Database.add()Anton Khirnov2021-01-24
|
* db/message: make sure not to leave temporary files aroundAnton Khirnov2021-01-21
| | | | | Use a contextlib.ExitStack to remove the temporary file used by external handler, even if an exception is raised.
* db/message: split _render_part()Anton Khirnov2021-01-21
| | | | | | | | Rename it to _render_part_external() and make it only handle external rendering. Move the other code - dealing with text parts without an external handler - to _MimeTree.render_str(). This takes into account overridden content types, and also processes text/plain parts if that is configured.
* db/message: pass content-type to _render_part()Anton Khirnov2021-01-21
| | | | | Do not get it from the underlying EmailMessage, since we may override it.
* db/message: implement __str__Anton Khirnov2021-01-21
|
* db/message: guess a better content type for octet-stream partsAnton Khirnov2021-01-21
| | | | Same as what is done for Attachment.
* widgets/thread: generic pygments highlightingAnton Khirnov2021-01-21
|
* db/message: fix email-missing warningAnton Khirnov2021-01-21
|
* buffers: make get_info() asynchronousAnton Khirnov2021-01-20
| | | | | Allows computing message/thread counts asynchronously in a separate thread.
* db/thread: add parentheses for chaining queriesAnton Khirnov2021-01-20
|
* db: make sure to close the read-only database instancesAnton Khirnov2021-01-20
|
* db: make write operations asyncAnton Khirnov2021-01-20
|
* db/manager: drop unused variableAnton Khirnov2021-01-19
|
* helper: move humanize_size to the only place where it is usedAnton Khirnov2021-01-16
|
* helper: rewrite mailto_to_envelope/parse_mailto to Envelope.from_mailtoAnton Khirnov2021-01-16
|
* db/message: export headers per-MIME partAnton Khirnov2021-01-15
|
* db/message: passthrough text parts if there is no handlerAnton Khirnov2021-01-13
|
* db/manager: Drop async methodDylan Baker2021-01-10
| | | | | | | | | | As far as I can tell using a separate process doesn't actually improve performance, it makes it worse. The work that we're passing off to the separate function isn't necessarily work that's well suited to being handed off, there isn't a lot of computation and the objects that need to be passed across the pipe are fairly large (at least when considering a pipe). Converting the function to a generator gives better performance and simplifies the implementation.