summaryrefslogtreecommitdiff
path: root/alot/commands/envelope.py
Commit message (Collapse)AuthorAge
* commands/envelope: refactor deriving headers to be editedAnton Khirnov2021-11-20
| | | | | | | | | Split the code into its own function. Make it properly case-insensitive. Apply either the blacklist or the whitelist setting, trying to apply both makes no sense. Enforce that either a blacklist or a whitelist is configured in the settings.
* mail/envelope: add a special class for headersAnton Khirnov2021-11-20
| | | | Handle multiple headers with ordering and case-insensitive operations.
* commands/envelope: fix accessing the attachment filenameAnton Khirnov2021-05-15
|
* Cosmetics, clean up importsAnton Khirnov2021-02-10
|
* Fix access to Attachment filename.Anton Khirnov2021-02-01
|
* 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.
* SendCommand: stop using an instance attribute unnecessarilyAnton Khirnov2021-01-29
|
* SendCommand: remove unnecessary instance attributeAnton Khirnov2021-01-29
| | | | It is only used inside one function.
* commands/envelope: remove unused SendCommand parametersAnton Khirnov2021-01-29
|
* 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.
* Use super() where applicable.Anton Khirnov2021-01-21
|
* db: make write operations asyncAnton Khirnov2021-01-20
|
* helper: get rid of decode_string()Anton Khirnov2021-01-16
| | | | | | | | It just adds unnecessary type confusion. In most places where it is used, the types are always str, so it does nothing. In the few others, the encoding/decoding is better handled explicitly.
* More missed list->set conversions for tagsAnton Khirnov2020-07-01
|
* buffer: drop the ui parameter when not neededAnton Khirnov2020-04-25
|
* ui: rewrite notification/status bar handlingAnton Khirnov2020-04-23
| | | | | | | | | Do not recreate all the widgets on every update, just update the widget contents. Make the statusbar update async, since some calls to get_info() can take a long time (especially noticeable for counting threads for searches with many results).
* envelope: do not add another Date header if one is already presentpacien2019-11-23
| | | | | Fixes https://github.com/pazz/alot/issues/1435: Do not add a Date header if it is already present
* commands/envelope: keep editable headers orderpacien2019-11-23
| | | | | | | | | | | Use the ordered set of header keys from the settings or from the current envelope when generating an editable envelope. Fixes https://github.com/pazz/alot/issues/898: Message header ordering isn't preserved from the editor Note: collections.OrderedDict has been used for backward compatibility with Python <3.7.
* Remove unicode escape codesLucas Hoffmann2019-11-06
|
* Remove unicode literals syntax from python2Lucas Hoffmann2019-11-06
|
* 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.
* attach accounts to envelopesvrs2018-12-10
| | | | simplifies a few tests, fixes #1177
* 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
* 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
* 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
|
* 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.
* Capitalize option and command descriptions consistentlyAlexander Shpilkin2018-07-25
|
* update gpg keys only if envelope asks for encryptionPatrick Totzke2018-06-21
| | | | | | | This prevents the update of the gpg keys stored in an envelope, triggered by a header change, in case envelope.encrypt is set to false. Fixes the issue that I reported on #1228
* rename function that updates gpg keys in envelopesPatrick Totzke2018-06-21
|
* Merge pull request #1228 from dcbaker/auto-encrypt-newPatrick Totzke2018-06-19
|\ | | | | envelope: Update encryption keys when CC, To, or From is changed
| * envelope: Update encryption keys when CC, To, or From is changedDylan Baker2018-03-12
| | | | | | | | | | | | | | | | | | | | | | | | Currently the encryption keys will only be updated when they are toggled, which means that if you change a Cc or To then the keys encrypted to might be wrong, either too many keys will be encrypted to, or not enough, or just the wrong ones. This patches fixes this by calling set_encrypt whenever the 'To', 'Cc', or 'From' headers are changed by set or unset. Fixes #1227
* | Remove old __future__ importsLucas Hoffmann2018-06-19
| | | | | | | | They are not needed for python >= 3.0.
* | 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.
* | alot/command/envelope: py3k fixesDylan Baker2018-03-01
| |
* | fix rebasing errorsDylan Baker2018-03-01
| |
* | py3k: Replace 'e.message' with 'str(e)' when handling exceptionsDylan Baker2018-03-01
| |
* | py3k: convert email.Utils to email.utilsDylan Baker2018-03-01
|/
* commands/envelope: Acknowledge keyids param on encryptRuben Pollan2017-09-25
|
* 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.
* | Fix some spelling mistakesLucas Hoffmann2017-09-02
|/
* 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.