| Commit message (Collapse) | Author | Age |
|
|
|
| |
This probably isn't completely right, but it's a start.
|
|
|
|
|
| |
cStringIO doesn't exist in python 3.x, instead one simply uses
io.StringIO and python provided a C accelerated version if possible.
|
|
|
|
|
| |
these are internal nodes in the mail tree and do not contain displayable
content.
|
| |
|
|\ |
|
| |
| |
| |
| |
| | |
add returns and rtype for sphinx and reflow the rest of the docstring a
bit.
|
| | |
|
|/ |
|
|
|
|
|
|
|
|
| |
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).
|
|
|
|
|
|
|
|
| |
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>".
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
This can create circular imports in unittests, which causes difficult to
debug errors.
Fixes #1076
|
|
|
|
|
| |
Nested ternaries are awful to read, especially in this case. Putting it
into an if statement is actually more terse, and is much easier to read.
|
|
|
|
|
|
| |
1) dont use len() to test that a list is non-empty
2) only go down the else clause if it's possible to have a valid
signature.
|
|
|
|
|
|
| |
Currently if a signature name has a non-ascii unicode character in it,
the thread will fail to load because a UnicodeEncodeError. This patch
fixes that by converting the str into unicode.
|
|
|
|
|
|
|
|
|
| |
To verify the signature correctly we need to ensure that the body of the
message is decoded the same way as it was when it was signed,
specifically using helper.email_as_string to insert \r\n instead of
.as_string, which only inserts \n.
Fixes #1079
|
|
|
|
|
|
|
| |
Instead of manual parsing with regexp and manual string formatting the
functions from email.utils are used. This fixes some small
inconsistencies with addresses with empty realnames and with commas in
realnames.
|
|
|
|
| |
Message doesn't have an iterkeys method, just a keys method.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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).
|
|
|
|
|
|
|
|
| |
This patch replaces a number of uses of dict.items, dict.values, and
dict.keys with their iterative siblings. The advantage of using the
iterator version is that they don't copy the keys, values, or items, but
simply return references. This reduces memory usage and may speed up the
these operations a bit.
|
|
|
|
|
|
|
|
| |
This had the advantage of being more readable to people without a
functional programming background, and it avoids the need to use lambdas
which are both slow and have many corners in python. In a few cases it
also allows us to use a generator expression instead of a materialized
list, which save some memory.
|
|
|
|
| |
This just adds the `r` prefix to a few strings.
|
| |
|
|
|
|
| |
This is the default value.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|\
| |
| | |
Allow specifing the mailcap field key for `pipeto`
|
| |
| |
| |
| |
| | |
When decoding the message, use the mailcap field specified for command
lookup.
|
|\ \ |
|
| | | |
|
| | | |
|
|/ / |
|
|/ |
|
|
|
|
| |
issue #539
|
| |
|
| |
|
|
|
|
|
| |
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
|
|
|
|
| |
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>
|