| Commit message (Collapse) | Author | Age |
|
|
|
| |
This is needed by unittest that mock Thread.refresh.
|
|
|
|
|
|
|
|
| |
The safely_get helper is just a wrapper around try/except, and is used
twice in the whole code base, in the same function. It really doesn't
even end up saving code because to get around line wrapping a lambda is
assigned (which is not the greatest style wise), it ends up saving one
line of code when it's called, and the function itself is 16 lines long.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
This uses open() as a context manager instead of calling close()
explicitly. This has the advantage of closing even in the event of an
exception, being easier to visually inspect for correctness, and being
the more modern idiom.
This does leave one case of file.close(), where FILE is opened in an if
tree.
|
|
|
|
| |
This is the default value.
|
|
|
|
|
|
|
| |
Instead of using set([l for l in list]) use {l for l in list} (which
shouldn't be confused with a dict comprehension which requires the ':'
in the first value}. This avoids creating a list before reducing it to a
set. This feature is new in 2.7 and 3.3.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
| |
- use relative imports if possible
- group imports into standard library, third party, and alot modules
- sort imports alphabetically
|
| |
|
|
|
|
|
| |
`del` and `return` are keywords and not functions so the braces are not
needed.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Default value 'first_message' lists authors in the order they joined the
conversation. Value 'latest_message' order authors by their latest
message, which makes it easier to see which authors who wrote the most
recent messages.
Note that authors with duplicate emails were previously filtered. We now
keep all authors where name + email is unique. This is behavior is
desired for some email notification services. For example, Jira will
set the From header to "Joe User <jira@company.com>" meaning you will
only see one author if you only keep unique email addresses.
|
|\
| |
| | |
Allow specifing the mailcap field key for `pipeto`
|
| |
| |
| |
| |
| | |
When decoding the message, use the mailcap field specified for command
lookup.
|
|\ \
| | |
| | | |
Removed incorrect backslash-t substitution in envelope.
|
| | | |
|
|\ \ \
| |/ /
|/| | |
|
| | | |
|
| | | |
|
|/ / |
|
| | |
|
| | |
|
|/
|
|
| |
see also issue #794
|
|
|
|
| |
issue #539
|
|
|
|
|
|
|
|
| |
Some versions of AppleMail apparently send out attachements
with incorrect mimetypes "application/octetstream"
(instead of "application/octet-stream").
This patch makes alot use libmagic on the attachments content
to determine the actual content type.
|
| |
|
|
|
|
|
|
|
|
|
| |
The email_as_string function, and the related RFC3156_canonicalize
function, are now used by the ForwardCommand and are not specific
anymore to the crypto routine. So we move them to the global helper
module.
fix an import removal mistake while moving email_as_string function: StringIO was not only used by email_as_string
|
| |
|
| |
|
|
|
|
|
| |
This patch makes the use of unicode more consistent, and enforces the
UTF8 charset for the added payload in case of failure.
|
|
|
|
|
| |
This delays the encoding of special chars, if any, to the actual display
which is supposed to know into what it should be encoded.
|
|
|
|
| |
mostly automatically fixed
|
| |
|
| |
|
|
|
|
| |
i.e., one not below that of notmuch's root path
|
|
|
|
| |
this is used in the Database manager
|
|
|
|
|
|
|
|
|
| |
Formerly None was used as failobj, but None is not iterable and that
is all that get_params does. Use list() instead which is iterable.
Closes #626.
Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
|
|
|
|
|
|
|
|
|
| |
Formerly any SMIME signed mail triggered a malformed OpenPGP message
warning. Be more selective wrt what to interpret as OpenPGP data by
looking at the protocol parameter first. Includes minor stylistic
changes.
Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
|
|
|
|
|
|
|
| |
Fix detection of OpenPGP encrypted data and also check the 'protocol'
parameter.
Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
|
|
|
|
|
|
|
| |
Move the parameter extraction to its own function and generalize it so
it can be reused.
Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
|
|
|
|
|
|
|
| |
RFC 2045 specifies that parameter names are case-insensitive, so
normalize them by converting them to their lower case version.
Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
|
|
|
|
|
|
|
|
|
| |
OpenPGP states that the Content-Type header is annotated with
parameters, namely 'protocol' and 'micalg'. Use .get() to retrieve
this values with a default value to handle the case of malformed
(according to RFC 3156) messages gracefully.
Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
|
|
|
|
|
|
|
|
|
| |
Parse and decrypt OpenPGP encrypted data as specified by RFC 3156. If
such a message is detected and found to be well-formed, it is
decrypted and any MIME messages found within the plain text are
attached to the original message.
Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
|
|
|
|
|
|
|
| |
Verify OpenPGP signatures as specified in RFC 3156. Display the result
in the header list above the message.
Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
|
| |
|
|
|
|
|
| |
with missing 'code' parameter.
cf issue #590
|
|
|
|
|
|
|
| |
this feature was not yet changed after an Envelope rewrite
and was still based on Envelope._headers[foo] being a str and not a list of str.
fixes #587
|
|
|
|
|
|
|
|
| |
This ensures that we respect if a command as specified per mailcap expects its input via stdin and not per tempfile.
This was already done for opening of attachments but not
for interpreting non-text/plain message parts.
fix #584
|
| |
|
| |
|