summaryrefslogtreecommitdiff
path: root/alot
Commit message (Collapse)AuthorAge
* commands/globals: Only set stdin to a pipe if there is dataDylan Baker2017-08-23
| | | | | | | | | | Otherwise the editor will crash. I can't figure out for the life of me to test this. I thought that I would be able to do something like detect if stdin is a tty or something else, but that doesn't seem to work. Fixes #1137
* Merge pull request #1135 from dcbaker/submit/external-command-testsDylan Baker2017-08-23
|\ | | | | Submit/external command tests
| * command/globals: Test for not None rather than callableDylan Baker2017-08-23
| | | | | | | | | | | | If someone passes us something other than None or a callable they're abusing the API. Instead, use is not None, and let the code except if something else is passed.
| * commands/globals: Simplify ExternalCommand thread_CodeDylan Baker2017-08-23
| | | | | | | | | | | | This simplifies the code but not using an if/else, but to just use a ternary to set the input to Popen.communicate. This also pulls some code out of the try/except block that isn't being tried.
| * commands/globals: spelling and grammar of a commentDylan Baker2017-08-22
| | | | | | | | It's just a little off
* | alot/helper: Fix call_cmd_async polluting global environmentDylan Baker2017-08-22
| | | | | | | | | | | | | | | | | | | | An assignment `e = os.environ` creates a reference not a copy, which means that modifying one necessarily modifies the other. Using `dict.copy` creates a shallow copy (the keys and values are references, but the dicts are different objects), which means only modifications to mutable objects are shared. In the case of os.environ which only contains immutable objects like strings, bools, and numbers this isn't an issue.
* | alot/helper: print ellipsis in codeDylan Baker2017-08-22
|/ | | | | Since the file is encoded in utf-8 we can actually print the ellipsis. Most people can more readily read that than the raw utf-8 escape.
* Merge pull request #1133 from lucc/fix/bug-1132Dylan Baker2017-08-22
|\ | | | | Fix #1132 by reverting part of fa3dd1b04567.
| * Use cStringIO.StringIO to fix #1132Lucas Hoffmann2017-08-21
| | | | | | | | | | | | | | | | | | This undoes a small subset of the changes from fa3dd1b04567c4ea03fa658c3838b569531c79f5 and thus fixes #1132. The io.BytesIO object was not able to handle the unicode header names that where returned by envelope.construct_mail, which in turn did just copy them from the envelope header.
* | Merge pull request #1131 from lucc/fix/hashDylan Baker2017-08-22
|\ \ | | | | | | Fix hash(TagWidget) with unicode tag representation
| * | Use a tuple to build a hash valueLucas Hoffmann2017-08-20
| |/ | | | | | | | | | | | | | | | | The old implementation would raise an error when the translated tag string was a unicode string (might be defined as an abbreviation in the users config). The official docs suggest this kind of implementation: https://docs.python.org/3/reference/datamodel.html#object.__hash__
* | Merge pull request #1126 from lucc/py3/py2-compatibleDylan Baker2017-08-22
|\ \ | |/ |/| Some small changes that are py2 and py3 compatible
| * py3k: Use build in next functionLucas Hoffmann2017-08-20
| |
| * py3k: Use logging.warning instead of warnLucas Hoffmann2017-08-20
| | | | | | | | | | The short version is deprecated as of python3. Both are available in both python versions.
| * py3k: Fix function signatureLucas Hoffmann2017-08-20
| | | | | | | | | | | | | | | | | | With python3 sublists are not allowed in function definitions any longer. But the same can be done with call time iterable expansion. References: https://docs.python.org/2/reference/compound_stmts.html#grammar-token-sublist https://docs.python.org/3/reference/compound_stmts.html#function-definitions
* | Merge pull request #1129 from dcbaker/submit/py3k-small-fixesPatrick Totzke2017-08-20
|\ \ | | | | | | py3k small fixes
| * | widgets/globals: drop functools.totalordering from TagWidgetDylan Baker2017-08-19
| | | | | | | | | | | | | | | | | | Implementing the comparison functions as a shared method rather than in terms of each other (as functools.totalordering does) makes the search interface much snappier.
| * | widgets/globals: Implement __hash__ for TagWidgetDylan Baker2017-08-19
| | | | | | | | | | | | | | | | | | | | | | | | Which is required in python3 when implementing the __eq__ method. The implementation caches the hash method, since it's being called each time the focus is changed in the search view. This doesn't really seem correct to me, but I'm not sure it's wrong.
| * | widgets/thread: Delete unused variableDylan Baker2017-08-19
| | | | | | | | | | | | | | | This wasn't caught by static checkers since it is used in the other brach of the if statement containing this value.
| * | Use io.BytesIO and io.StringIODylan Baker2017-08-19
| | | | | | | | | | | | | | | | | | | | | | | | In python3 StringIO and cStringIO are gone. In their place are io.BytesIO and io.StringIO. They are somewhat different in that they are not separated on implementation, but on the type they emulated. BytesIO works like the bytes class (str in python 2), while StringIO works like the str class (unicode in python2).
| * | Replace Exception.message with str(Exception)Dylan Baker2017-08-19
| | | | | | | | | | | | | | | | | | In python3 Exception doesn't have a message attribute, the only way to get the string output is to call str() on the Exception. This also works in python 2.7, so go ahead and make that change.
* | | Merge pull request #1125 from dcbaker/submit/deprecated-encrypt-by-defaultPatrick Totzke2017-08-20
|\ \ \ | |_|/ |/| | mark old options for encrypt_by_default as deprecated
| * | defaults/alot.rc.specDylan Baker2017-08-18
| |/ | | | | | | Mark all values for [account]encrypt_by_default as deprecated
* | Merge pull request #1127 from lucc/simplifyPatrick Totzke2017-08-19
|\ \ | | | | | | Simplify for loop and string building
| * | Simplify for loop and string buildingLucas Hoffmann2017-08-19
| |/
* | bump versionPatrick Totzke2017-08-19
| |
* | bump version stringPatrick Totzke2017-08-19
|/
* Merge pull request #1095 from dcbaker/submit/use-default-theme-if-no-configDylan Baker2017-08-17
|\ | | | | Load default settings even if a user config doesn't exist
| * settings: Load spec file even if config file is undefined.Dylan Baker2017-08-16
| | | | | | | | | | | | | | | | | | | | This is necessary even if the config file is None to ensure that the spec file is loaded Also mock out the setting.const module in the docs, otherwise they'll fail to generate. Fixes #1094
| * settings/manager: remove duplicate _config from constructorDylan Baker2017-08-16
| | | | | | | | | | SettingsManager sets it's _config attribute to the exact same value twice in the constructor. This is wrong.
* | Merge pull request #1115 from pazz/fix-account-selectionDylan Baker2017-08-17
|\ \ | | | | | | Fix issue with account selection
| * | let SendmailAccount.send_mail cast the mail to strPatrick Totzke2017-08-16
| | | | | | | | | | | | | | | | | | instead of assuming that it already receives a string. The new behaviour is in sync with the type documented for the superclass `Account`.
| * | send complete addresses to settings.get_account_by_addressPatrick Totzke2017-08-16
| | | | | | | | | | | | | | | .. as read from the From-header directly, potentially including realname parts.
| * | ignore realname part in get_account_by_addressPatrick Totzke2017-08-15
| |/ | | | | | | | | This allows to simply pass the content of a messages' From-header value when determining an account to send/save/encrypt from.
* | db/utils: Allow encrypted messages to be put in mixed payloads as wellDylan Baker2017-08-17
| | | | | | | | | | | | | | | | Since a multipart/mixed can contain anything that a normal message could, this should be allowed. The only case that I can think of this actually happening is if an email server takes the original message, puts it in a multipart/mixed, and then attaches it's own message, like on of the annoying "this mail scanned for viruses by <product>".
* | db/utils: Handle multipart/signed inside multipart/mixedDylan Baker2017-08-17
| | | | | | | | | | | | | | | | It is possible (and actual mail clients such as kmail do) to embed a multipart/signed within a multipart/mixed (this is briefly mentioned in the acknowledgements of RFC 3156, and is perfectly valid according to RFC 1341, which says that a multipart/mixed is exactly like a top level message, except that the header may be empty.
* | db/utils: Don't attach invalid signature to unsigned but encrypted messagesDylan Baker2017-08-17
| | | | | | | | | | | | The logic in the comment is faulty. There are perfectly legitimate reasons to encrypt but not sign a message, some of them are fleshed out in the previous commit.
* | alot/crypto: make keys required for detached_signature_forDylan Baker2017-08-17
| | | | | | | | | | | | This function is always passed a key to sign with, and not passing one leads to the first available signing key in the keyring being selected otherwise, which is problematic if one has two signing keys.
* | crypto: Don't sign when encryptingDylan Baker2017-08-17
| | | | | | | | | | | | | | | | | | | | This is a missed difference between pygpgme and gpg, gpg signs by default when encrypting with an attached signature. Since this isn't being toggled it's bad, it's a kind of information leak, and increases the size of the mail for no reason. NOTE: This is the kind of signature proposed by RFC 2440, which we're missing tests for.
* | alot: replace email.Utils with email.utilsDylan Baker2017-08-16
|/ | | | | In python 3 email.Utils doesn't exist, in python 2.7 both do, but Utils is deprecated.
* crypto: simplify check_uid_validityDylan Baker2017-08-14
| | | | | This splits the loop into a closure and a call to any, which makes it a little bit easier to read and understand.
* just use the OpenPGP fingerprint instead of inventing "hash_key"Daniel Kahn Gillmor2017-08-14
|
* convert from pygpgme to the python "gpg" moduleDaniel Kahn Gillmor2017-08-14
| | | | | | | | | | | | | | | This converts from the now abandoned pygpgme project for wrapping gpgme, to the upstream gpgme python bindings (which are descended from the pyme project, before they became official). Largely this change should not be user visible, but there are a couple cases where the new bindings provide slightly more detailed error messages, and alot directly presents those messages to users. This patch has been significantly revised and updated by Dylan Baker, but was originally authored by Daniel Kahn Gillmor. Fixes #1069
* Merge pull request #1111 from dcbaker/submit/signcommand-testsDylan Baker2017-08-14
|\ | | | | Fix issue 1113
| * envelope: Allow signing if address is in "name <email>" formDylan Baker2017-08-11
| | | | | | | | | | | | | | | | | | Currently anything except "user@domain" (such as "User Name <user@domain>"), will not work with the sign command, because settings.get_account_by_address wants just the "user@domain" bit, and we don't split it. Fixes #1113
* | commands: Don't try to sign_by_default without a gpg keyDylan Baker2017-08-11
|/ | | | | | Currently it's possible to set sign_by_default without setting a default key. This is obviously not a good plan for all sorts of reasons. This fixes the two failing tests from the last commit.
* Merge pull request #988 from lucc/move-next-matchingLucas Hoffmann2017-08-07
|\ | | | | Add `move next matching` command in thread buffer
| * Fix operator precedence when matching messagesLucas Hoffmann2017-08-05
| | | | | | | | | | If the querystring did contain an OR the results where misleading as the AND binds stronger.
| * Add missing movements to completionLucas Hoffmann2017-08-05
| |
| * docs: Update docstrings for move commandsLucas Hoffmann2017-08-05
| |