summaryrefslogtreecommitdiff
path: root/alot/commands
Commit message (Collapse)AuthorAge
* directly import Completers from their resp modulePatrick Totzke2019-08-17
| | | | ... instead of from alot.completion
* Fix UnboundLocalErrorLucas Hoffmann2019-08-16
| | | | The local variable proc was not defined in these branches.
* trailing whitespacesPatrick Totzke2019-08-15
|
* retire Message.accumulate_bodyPatrick Totzke2019-08-15
| | | | | | ... in favour of get_body_text to de-clutter the Message class. The functionality is implemented in alot.db.utils.extract_body, which now contains the hard-coding of the html warning.
* remove field_key parameter from PipetoCommandPatrick Totzke2019-08-15
| | | | I don't think anyone needs anything else but copiousoutput here
* cosmeticsPatrick Totzke2019-06-02
|
* refactor ReplyCommandPatrick Totzke2019-06-02
| | | | | This moves the static methods clear_my_address and ensure_unique_address out of ReplyCommand and into alot.db.utils.
* fix: use from-header from disk when replyingPatrick Totzke2019-06-02
| | | | | | | | | | | | | | | | see issue #1402 If the "author" string (a decoded version of the From header value) is read from the notmuch index, it may have already removed quotes around real name parts containing a comma. This means that `alot.db.message.get_author()` will potentially misinterpret it because python's email libs decoding behaviour is different. For example, 'Ä, B <a@b.c>' will yield address 'Ä' and empty name!. This commit makes sure that the original from header is read from disk when one replies to a message, which avoids the above problem.
* fix formataddrPatrick Totzke2019-06-02
| | | | | | | | | | | | | | | | | | | | | This adds a local utility function `formataddr` which acts as the direct inverse of `email.utils.parseaddr`. The problem with `email.utils.formataddr` is (currently) that - it encodes non-ascii characters and - it does not re-introduce quotes around the real name parts in case parseaddr removed them: >>>parseaddr('"Ö, Ä" <a@b.c>') >>>('Ö, Ä', 'a@b.c') >>>formataddr(('Ö, Ä', 'a@b.c')) >>>'=?utf-8?q?=C3=96=2C_=C3=84?= <a@b.c>' >>>parseaddr('=?utf-8?q?=C3=96=2C_=C3=84?= <a@b.c>') >>>('=?utf-8?q?=C3=96=2C_=C3=84?=', 'a@b.c') related issue #1402
* remove old new-style classes syntaxPatrick Totzke2019-05-27
| | | | | | Python3 only supports "new-style" classes (those extending object), and we don't need to explicitly inherit from this root class any more. See http://pylint-messages.wikidot.com/messages:c1001
* update docs for tag commands in search modePatrick Totzke2019-05-11
| | | | Closes #1391
* cleanup trailing whitespacePatrick Totzke2019-05-11
|
* fix mergePatrick Totzke2019-05-11
| | | | | | | | Since this branch was created, master has diverged in that ComposeCommand now stores the determined sender account in the envelope. (see #117). This commit makes sure that the newly split methods read the account from there.
* fix pyflakes issuesPatrick Totzke2019-05-11
|
* commands/globals: split remaining functionality out of applyPatrick Totzke2019-05-11
| | | | The last few functions are very small so just doe them in one go.
* commands/globals: Split encryption code into a helperDylan Baker2019-05-11
|
* commands/globals: Split code for setting a missing To headerDylan Baker2019-05-11
|
* commands/globals: split gpg signing code into a helperDylan Baker2019-05-11
|
* commands/globals: split envelope setting codePatrick Totzke2019-05-11
|
* commands/globals split out the signature setting codeDylan Baker2019-05-11
|
* commands/globals: split the code for setting ...Patrick Totzke2019-05-11
| | | | account and From header
* commands/globals: split out the code for loading a templateDylan Baker2019-05-11
|
* commands/globals: wrap apply in an error handlerDylan Baker2019-05-11
| | | | | | | | As we split the apply method up into separate methods we need a way for those helpers to stop execution of the method. This wraps the real apply method inside of a try/except block with a custom exception. Any helper that is intended to run in the apply method simply needs to raise this exception, and apply will return.
* expose subject and to headers to forward_prefix hookNick Hu2019-05-11
|
* Set local variable before useageLucas Hoffmann2018-12-14
| | | | Fixes #1351.
* rename get_account_by_address to account_matching_addressvrs2018-12-10
| | | | | ... since accounts' addresses can overlap and get_account_by_address promises too much. Also remove now-obsolete get_addresses.
* match addresses against accounts, not address listsvrs2018-12-10
| | | | fixes #1230, fixes an unfiled bug in clear_my_address()
* attach accounts to envelopesvrs2018-12-10
| | | | simplifies a few tests, fixes #1177
* fix: ui.notify is no coroutinePatrick Totzke2018-11-21
| | | | this fixes #1336
* make bounce command use the correct sender accountMichael J Gruber2018-11-15
| | | | | | | | | | | | | | | Bounce correctly determines the address and account to send the bounce from. It uses the account to choose an address book for "to:" completion and passes the sender address as "Resent-From:" to SendCommand(). The latter uses the "From:" header, though, to determine the sending account again and (in the case of a bounce) wrongly. Make SendCommand() use "Resent-From:" if present and "From:" else. Code remark: specifying "False" as the default return value for get() ist not necessary; it is meant to make this short form clearer to read, and to safeguard for times when '' or None do not evaluate to False here.
* Check set of encryption keys before sendingAndre Bianchi2018-10-16
| | | | Closes: #1232
* commands/thread: Don't refresh after movingDylan Baker2018-08-08
| | | | | | | | | | For large threads (I can reproduce on threads with ~50 messages), changing messages can become quite slow, especially if there are a significant number of folded messages. Removing the call to refresh the body after moving seems to fix this. There may be side effects of this change, and it may be required in some cases, just not all of them.
* Set the policy for email.message_from_*Dylan Baker2018-08-06
| | | | | | | Otherwise they default to the Compat32 policy, which isn't want we want, since we end up with a mixture of new and old types. Fixes: #1292
* db/utils: Replace encode_header with Message.add_headerDylan Baker2018-08-04
| | | | | Which appears to be capable of doing all the same things, but is in the stdlib instead of something we hand rolled.
* commands/globals: use getattr/setattr instead of manipulating __dict__Dylan Baker2018-08-02
| | | | Since that's what they're for.
* commands/globals: Convert CallCommand.apply to a coroutineDylan Baker2018-08-02
| | | | | | This allows it to easily wrap calls that are themselves coroutines, while it's still able to wrap synchronous calls. This fixes the async test and allows hooks that are coroutines to work.
* helper: replace email_as_* with email builtinsDylan Baker2018-08-02
| | | | | | | | | | | | | | Python 3.3 added a new feature to the email module, policies (https://docs.python.org/3.5/library/email.policy.html). Policy objects allow precise control over how numerous features work when converting to and from str or bytes. With the `email.policy.SMTP` the behavior of email_as_bytes and email_as_string can be achieved using the builtin `.as_string()` and `.as_bytes()` methods, without custom code or the need to test it. Additionally these methods handle corner cases that we don't currently handle, such as multi-part messages with different encodings. Fixes #1257
* ui: Convert apply_command to a coroutineDylan Baker2018-07-26
| | | | | | This is a pretty invasive patch, since the ui code is used so extensively, it requires going into a lot of other code and converting those to coroutines, since before they returned deferred's.
* command/envelope: Don't use a deferred, use awaitDylan Baker2018-07-26
|
* account: Convert send_mail function to coroutineDylan Baker2018-07-26
|
* commands/globals: implement ExternalCommand.apply as coroutineDylan Baker2018-07-26
| | | | | | Rather than returning a deferred in some cases, this makes the function a coroutine, in some cases it calls regular subprocess, in other cases it uses asyncio subprocess.
* commands/thread: Use asyncio coroutines instead of twisted deferredsDylan Baker2018-07-26
|
* commands/globals: Use asyncio coroutines instead of twisted deferredsDylan Baker2018-07-26
|
* command/envelope: use asyncio coroutines instead of twisted inlineCallbacksDylan Baker2018-07-26
|
* commands/envelope: check that self.envelope is not NoneDylan Baker2018-07-26
| | | | | | If the mail is passed a string then envelope will always be None. There is one case in the final callback where self.envelope is assumed set, but it isn't guaranteed to be, so guard that properly.
* Merge pull request #1276 from alexshpilkin/copyeditDylan Baker2018-07-25
|\ | | | | Copyedit documentation
| * Capitalize option and command descriptions consistentlyAlexander Shpilkin2018-07-25
| |
* | commands/globals: Convert Address to string for email.utilsDylan Baker2018-07-25
|/ | | | | | | | Email utils apparently assumes it's getting a string, and calls encode directly. This can only be hit if you have a single account configured, not with multiple accounts. Fixes #1277
* add global command 'removequery'Patrick Totzke2018-07-24
| | | | that removes a named query string from the notmuch index
* new command "savequery"Patrick Totzke2018-07-24
| | | | | | ...that stores a query string as named search. in Search buffers, this will fall back on the current search string unless a full query string is provided as (second) argument.