summaryrefslogtreecommitdiff
path: root/alot/account.py
Commit message (Collapse)AuthorAge
* Drop some unused imports.Anton Khirnov2021-11-24
|
* Cosmetics, clean up importsAnton Khirnov2021-02-10
|
* 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.
* account: stop using call_cmd_async() to run sendmailAnton Khirnov2021-01-26
| | | | | | | It does not actually save any code. The new code also uses a shell as is documented. Remove call_cmd_async(), as it no longer has any callers.
* More missed list->set conversions for tagsAnton Khirnov2020-07-01
|
* Remove unicode literals syntax from python2Lucas Hoffmann2019-11-06
|
* Options overwrite default values for sent_tags and draft_tagssgelb2019-07-07
| | | | | In addition, remove hardcoded default values from `account.py` and use defaults from `alot.rc.spec`
* 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
* 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()
* Improve error notification on failing sendmailLucas Hoffmann2018-10-10
|
* Check the return code from sendmailLucas Hoffmann2018-09-22
|
* account: Convert send_mail function to coroutineDylan Baker2018-07-26
|
* Remove old __future__ importsLucas Hoffmann2018-06-19
| | | | They are not needed for python >= 3.0.
* Wrap long statements on open-bracket syntax.Ben Finney2018-04-23
|
* drop bytes support from AddressDylan Baker2018-03-06
| | | | | | We don't want to be comparing bytes anyway, the decode would use utf-8, and that isn't right. Instead make the caller convert to a str of Address first.
* Merge branch 'master' into py3kDylan Baker2018-03-05
|\ | | | | | | | | This requires regenerating the accounts_table docs, as they've changed for python 3.
| * implement replied and passed tagsMichael J Gruber2018-03-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | maildir knows R and P flags which denote messages that have been replied to resp. passed on (fowarded, bounced). They correspond to IMAP flags \Replied and $Forwarded which are used by many clients and by synchronisation software. E.g., mbsync syncs \Replied to R, a patch for P is pending. Implement replied_tags and passed_tags for alot which work similar to sent_tags: sent_tags tags the sent message; replied_tags (resp. passed_tags) tags the message being replied to (resp. being fowarded). Basically, setting the replied_tags config to `replied` and replying to a message has the same effect as doing `tag replied; reply`, but the latter would tag even sending the reply is aborted or fails. The implementation in this patch makes sure that the tagging is done only if and when the reply resp. forward has been sent successfully.
* | fix account.pyDylan Baker2018-03-01
|/
* Print stderr of failed sendmail cmd in prompt.Julian Mehne2017-12-06
|
* commands/util: encrypt to selfRuben Pollan2017-09-26
| | | | | | | | Add account configuration variable 'encrypt_to_self' that if true when encrypting a message it will also be encrypted with the key defined for this account. Fixes #1140
* account: Fix Address comparison to b'' and u''Dylan Baker2017-09-06
| | | | | | | | | | | This uses a try/except because comparing an address to an empty string should be a fairly uncommon event and try/except will be faster than `if '@' not in other` in the case where '@' is in other. This stops alot from crashing if there is no 'From' header in the email. Outlook generates drafts without a 'From' header. Fixes #1050
* Merge branch 'master' into fix/spellingPatrick Totzke2017-09-02
|\
| * pep8 fixesPatrick Totzke2017-09-01
| | | | | | | | | | This mostly shortens lines down to <=79 chars and fixes some other small things I found using the pep8 tool.
| * Use new Address classDylan Baker2017-08-28
| | | | | | | | | | | | | | This just wries the new Address class into alot for use, and fixes up a few places where such fixups are needed. Fixes #1107
| * account: Add an Address classDylan Baker2017-08-28
| | | | | | | | | | This class will encapsulate the logic of comparing email addresses and the rules of handling when capitalization is allowed and when it's not.
* | Fix some spelling mistakesLucas Hoffmann2017-09-02
|/
* 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`.
* account: Don't assume that self.aliases is setDylan Baker2017-06-07
| | | | | | Currently this code works because alot always populates aliases so it's not None, but if for some reason it doesn't then get_addresses will assert.
* Merge pull request #984 from lucc/future/absolute-importsLucas Hoffmann2017-01-21
|\ | | | | Use absolute_imports from __future__
| * Use absolute_imports from __future__Lucas Hoffmann2017-01-18
| |
* | Add docstrings to some methods and functions.Lucas Hoffmann2017-01-20
|/
* Use abc module to signal abstract base classesDylan Baker2016-12-21
| | | | | | | | | | | | | The Completer class is abastract, and it's complete method is also abstract. Using ABCMeta achieve two thing, first it will cause an error if a developer doesn't overwrite the method in a subclass. And second that it tells the static analysis tools to ignore the unused arguments in the signature, since this is the definition of a signature, not an actual function. By the same logic addressbook.AddressBook, and account.Account have been extended to use ABCMeta as their metaclass and have had their abstract methods decorated with the abstract method attribute.
* Replace unused arguments with _Dylan Baker2016-12-21
| | | | | | | | | | This patch replaces a large number (but not all) unused arguments with the standard ``_`` placeholder. This has the advantage of signaling that these values are unused. There are a number of places that I've chosen not to apply this, largely in methods that have publicly define signatures that they inherit (usually from urwid).
* Turn methods with no `self` usage into staticmethodsLucas Hoffmann2016-12-18
|
* Replace mutable keyword argumentsDylan Baker2016-12-13
| | | | | | | | | | | | | | | | | | | | | | | There are a number of cases of mutable keyword arguments (list and dict in this case). Mutable keyword arguments are rather dangerous, since any mutation of the default value is persistent, which will inevitably lead to bugs. For example, imagine this code: def func(def=[]): def.append('foo') return def >>> func() ['foo'] >>> func() ['foo', 'foo'] This is almost certainly not what was intended. This code generally uses the idiom of setting the default value to None, and then assigning with or `value = value or []` which will replace value with the empty list (or dict) when value is falsey, like None or another empty list.
* Clean up importsLucas Hoffmann2016-12-09
| | | | | | - use relative imports if possible - group imports into standard library, third party, and alot modules - sort imports alphabetically
* Use logging's native string interpolationLucas Hoffmann2016-12-09
|
* Handle deprecated option values gracefully.Lucas Hoffmann2016-03-24
|
* Add deprecation warning for old format.Lucas Hoffmann2016-03-24
|
* Encrypt on reply to encrypted email and add 'encrypt_by_default' configRuben Pollan2015-12-16
|
* add account option alias_regexpvrs2015-12-16
|
* refactor addressbook codePatrick Totzke2015-04-15
|
* dont use trace as notification stringPatrick Totzke2013-06-29
| | | | closes #589
* Fix long line in previous commitBenjamin2012-10-04
|
* Include STDERR from sendmail_command in SendmailAccount error messageBenjamin2012-10-04
|
* doc: docstringsPatrick Totzke2012-09-05
|
* catch exceptions raised by account.store_mailPatrick Totzke2012-08-21
| | | | | | be more error concious when storing mails to a maildir and propagate Maildir errors to error notifications in the UI. cf issue #502
* cleanup: split widgets.py and pep8/pyflakes fixesPatrick Totzke2012-08-10
|
* Fix PGP/MIME attachmentsMichael Stapelberg2012-07-22
| | | | | This actually is a workaround for a Python bug as mentioned in alot/crypto.py