summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* Fix some formatting requests for @luccDylan Baker2018-04-24
|
* Revert "Extract some context managers for patch objects."Dylan Baker2018-04-24
| | | | | | | | This reverts commit d01d2e51da45dd87f0abf98b8a856f3b3de69153. I don't think that this patch really improved readability that much. The right solution is to split ComposeCommand.apply so we don't need so many mocks.
* This merges Pazz split of the extract_body functionDylan Baker2018-04-24
|\ | | | | | | | | And attempts to fix handling of non text/plain parts by leaving them as bytes until they've been passed to the program that will render them.
| * Merge pull request #1237 from pazz/extract-bodyDylan Baker2018-04-24
| |\ | | | | | | refactor extract_body
| | * refactor db/utils.extract_bodyPatrick Totzke2018-04-24
| |/ | | | | | | | | | | | | This moves out the plaintext rendering of email parts (that are not multipart/* and not text/plain) into a separate utility function render_part. This function looks up and calls the apropriate mailcap handler.
* | db/utils: fix bad merge conflict resolutionDylan Baker2018-04-24
| | | | | | | | oops
* | Merge remote-tracking branch 'bignose/wip/issue/python3-codeclimate' into py3kDylan Baker2018-04-24
|\ \ | | | | | | | | | | | | One small conflict caused by "db/utils: correctly handle 8bit encoded mail"
| * | Extract a level of nested control flow.Ben Finney2018-04-23
| | |
| * | Wrap long statements on open-bracket syntax.Ben Finney2018-04-23
| | |
| * | Raise an exception with a meaningful message.Ben Finney2018-04-23
| | | | | | | | | | | | | | | | | | The `assert` statement is not always executed (it can be optimised away) so is not a suitable run-time check. Also, an exception allows for a better error message.
| * | Refactor some long statements to allow shorter lines.Ben Finney2018-04-23
| | |
| * | Re-format an over-long comment.Ben Finney2018-04-23
| | |
| * | Rename some test functions to have shorter names.Ben Finney2018-04-23
| | |
| * | Extract some context managers for patch objects.Ben Finney2018-04-23
| | | | | | | | | | | | This allows writing less-nested statements.
| * | Reformat a long statement in documentation code.Ben Finney2018-04-23
| | |
| * | Correct over-long comment lines in documentation code.Ben Finney2018-04-23
| | |
| * | Extract a level of nested conditionals for tag command.Ben Finney2018-04-23
| | |
| * | Reformat a long string in Setuptools metadata.Ben Finney2018-04-23
| | |
* | | db/utils: handle mail with bogus encodingsDylan Baker2018-04-24
| | | | | | | | | | | | | | | I've run into this with misconfigured git-send-email messages, where the encoding is utf-8, but the declared encoding is true or 8bit.
* | | db/utils: correctly handle 8bit encoded mailDylan Baker2018-04-24
|/ /
* | Fix 8bit some moreDylan Baker2018-04-10
| | | | | | | | | | For reasons I don't understand python sometimes converts 8bit to a string properly, and other times it doesn't. This is a bit of a hack.
* | db/utils: correctly handle 8bit encodings.Dylan Baker2018-04-10
| | | | | | | | | | | | Because python's mail will use raw-unicode-escape for anything that isn't ascii we need to encode back into the original raw bytes, then decode into the proper encoding.
* | db/utils: attempt to unwrap Content-Transfer-Encodings manuallyDylan Baker2018-04-10
| | | | | | | | | | | | | | | | The builtin for this assumes that inside of a Content-Transfer-Encoding that the format must be ascii. That is pretty silly, since the reason to use something like base64 is to transfer something that is not ascii, like utf-8. This attempts to handle the base64 and quoted-printable cases manually.
* | helper: add debug for what encoding was guessed.Dylan Baker2018-04-06
| |
* | Merge branch 'py3k-chardet' into py3kDylan Baker2018-04-06
|\ \
| * | require chardetDylan Baker2018-03-06
| | | | | | | | | | | | | | | | | | | | | magic struggles to decode a number of encodings, particularly it struggles with windows-1252, which Exchange *loves* to silently re-encode mail in, without updated the charset of the payload. Chardet successfully guesses these oddball encodings much more often.
| * | db/utils: Update docstring for message_from_bytesDylan Baker2018-03-06
| | |
| * | USe get_payload.decode instead of decoding ourselves.Dylan Baker2018-03-06
| | |
| * | 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.
| * | utils: Fix types for add_signature_headerDylan Baker2018-03-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | currently _handle_signatures will pass `False~ for the error_msg if there is no error, but the documentation for add_signature_headers says it only accepts strings. Don't do either of these, instead use None if there is no error, otherwise a string, and updated the assert and documentation to match.
* | | fix saving attachmentsDylan Baker2018-03-14
| | | | | | | | | | | | | | | | | | Attachments are encoded into bytes, but the file we open to write them into was being opened in text mode. That doesn't work. Open the file in bytes mode instead.
* | | Merge branch 'master' into py3kDylan Baker2018-03-12
|\ \ \ | | |/ | |/|
| * | rename parameter of Command.apply methodPatrick Totzke2018-03-11
| | | | | | | | | | | | | | | | | | .. from "caller" to "ui", as used throughout all subclasses. The inconsistent naming causes the codacity code checker (pylint) to complain every time we add a new command subclass.
| * | Merge pull request #1158 from dcbaker/wip/fix-bad-signature-encryptedDylan Baker2018-03-05
| |\ \ | | | | | | | | crypto: Handle message that is encrypted, but the signature is invalid
| | * | crypto: Handle message that is encrypted, but the signature is invalidDylan Baker2017-09-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | One case of this would be not having the public key of the signer. If the verification of the signatures fails, then use the signatures from the error, and try to redecrypt without verification. I have no tests yet, and this probably deserves tests. Fixes #1157
* | | | db/utils: decoded_headers will be passed str not bytesDylan Baker2018-03-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | I had made the assumption early on that this would get bytes, but when I added `assert isinstance(header, bytes)` alot would crash on startup, changing `bytes` to `str` fixed that. I noticed this when trying to fix the warning generated in the logging call.
* | | | db/utils: Update docstring for message_from_bytesDylan Baker2018-03-06
| | | |
* | | | USe get_payload.decode instead of decoding ourselves.Dylan Baker2018-03-06
| | | |
* | | | 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.
* | | | utils: Fix types for add_signature_headerDylan Baker2018-03-06
| |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | currently _handle_signatures will pass `False~ for the error_msg if there is no error, but the documentation for add_signature_headers says it only accepts strings. Don't do either of these, instead use None if there is no error, otherwise a string, and updated the assert and documentation to match.
* | | Use urwid.util.detected_encoding instead of try_decodeDylan Baker2018-03-06
| | | | | | | | | | | | | | | Commands running in a subprocess should return the terminal encoding so we don't need to guess their encoding.
* | | use helper.try_decode instead of guess_encodingDylan Baker2018-03-06
| | | | | | | | | | | | basically just remove hand rolling what try_decode does.
* | | NEWS: add a news item for python 3Dylan Baker2018-03-05
| | |
* | | Merge branch 'master' into py3kDylan Baker2018-03-05
|\| | | | | | | | | | | | | | This requires regenerating the accounts_table docs, as they've changed for python 3.
| * | Merge pull request #1218 from mjg/tag-replied-passedDylan Baker2018-03-05
| |\ \ | | | | | | | | Tag replied passed
| | * | 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.
| | * | provide defaults and doc for draft_tagsMichael J Gruber2018-03-05
| | | | | | | | | | | | | | | | | | | | draft_tags works the same way as sent_tags, so provide the same defaults and doc.
| | * | remove superfluous list() for ConfigObjMichael J Gruber2018-03-05
| | | | | | | | | | | | | | | | | | | | | | | | force_list() converts single items to lists already. Thus, remove a superfluous list() that could be mistaken for converting a single string into a list of chars.
* | | | Merge branch 'master' into py3kDylan Baker2018-03-02
|\| | |
| * | | Merge pull request #1217 from dcbaker/fix-1216Patrick Totzke2018-03-01
| |\ \ \ | | | | | | | | | | CompleteEdit: go up when the up key is pressed