| Commit message (Collapse) | Author | Age |
|
|
|
|
| |
The code doesn't need the context manager to be active, hence it can run
outside of the with block.
|
|
|
|
|
| |
This makes it possible to silence the test output with normal unittest
settings (e.g. command line parameters).
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fixes the following crashes:
1. tag completion with regex special chars
:search tag:[<tab>
2. Changing tag representation of an (existing) tag with regex special
chars:
[tags]
[[my**tag]]
normal = '','', 'white','light red', 'white','#d66'
3. Contact completion with regex special chars and no external command:
To:**foo<tab>
|
| |
|
| |
|
| |
|
|
|
|
| |
This makes drafts display correctly.
|
|
|
|
|
|
|
| |
If the message doesn't have a sender, try to come up with one. If the
message has the draft tag we known that the user is the sender, just use
the default account as the from if we can't find one another way. If it
doesn't have the draft tag just set the sending to 'Unknown'.
|
|
|
|
|
| |
These are just enough to look at the bug that will be fixed in the
patches that follow.
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|\
| |
| | |
Handle servers that treat the user segment of an address as case insensitive
|
| |
| |
| |
| |
| |
| |
| | |
This just wries the new Address class into alot for use, and fixes up a
few places where such fixups are needed.
Fixes #1107
|
| |
| |
| |
| |
| | |
This class will encapsulate the logic of comparing email addresses and
the rules of handling when capitalization is allowed and when it's not.
|
| |
| |
| |
| | |
This currently fails as there is not way to toggle case sensitivity
|
|\ \
| |/
|/| |
more tests + cleanups
|
| | |
|
| |
| |
| |
| |
| |
| | |
there are probably still some corners with mailcap handling (parameters
like copiousoutput) that are untested, but this covers a large swath of
the functionality.
|
| | |
|
| |
| |
| |
| |
| | |
There are a couple of pieces of this function that aren't covered,
including a bug. yay bugs.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Otherwise the editor will crash.
I can't figure out for the life of me to test this. I thought that I
would be able to do something like detect if stdin is a tty or something
else, but that doesn't seem to work.
Fixes #1137
|
| | |
|
| |
| |
| |
| |
| | |
These tests were wrong they would always pass, even if the code
underneath was broken. With this fix they actually work.
|
|\ \
| | |
| | | |
Submit/external command tests
|
| | | |
|
| |/
| |
| |
| |
| |
| | |
This doesn't test the spawn path, which is a little bit more
complicated since it's running code in a thread instead of in the main
thread.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
An assignment `e = os.environ` creates a reference not a copy, which
means that modifying one necessarily modifies the other. Using
`dict.copy` creates a shallow copy (the keys and values are references,
but the dicts are different objects), which means only modifications to
mutable objects are shared. In the case of os.environ which only
contains immutable objects like strings, bools, and numbers this isn't
an issue.
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Twisted.trail.unittest doesn't provide an expectedFailure decorator, nor
does it work with the one from the builtin library. Instead it relies on
having a "todo" attribute set.
This new utilities decorator simply sets that attribute to a string
value (booleans don't work).
|
|/ |
|
|\
| |
| | |
Fix #1132 by reverting part of fa3dd1b04567.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This undoes a small subset of the changes from
fa3dd1b04567c4ea03fa658c3838b569531c79f5 and thus fixes #1132.
The io.BytesIO object was not able to handle the unicode header names
that where returned by envelope.construct_mail, which in turn did just
copy them from the envelope header.
|
| |
| |
| |
| |
| | |
Since email_as_string uses io.BytesIO it can not handle the unicode
header names that might result from a envelope.construct_mail().
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The old implementation would raise an error when the translated tag
string was a unicode string (might be defined as an abbreviation in the
users config).
The official docs suggest this kind of implementation:
https://docs.python.org/3/reference/datamodel.html#object.__hash__
|
|/ |
|
|\
| |
| | |
Load default settings even if a user config doesn't exist
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This is necessary even if the config file is None to ensure that the
spec file is loaded
Also mock out the setting.const module in the docs, otherwise they'll
fail to generate.
Fixes #1094
|
| |
| |
| |
| | |
Which fail, per #1094
|
|\ \
| | |
| | | |
Fix issue with account selection
|
| | |
| | |
| | |
| | |
| | | |
This decorates test methods that internally call a `cmd.apply()`,
which represents asynchronous code that returns a `twisted.deferred`.
|
| | |
| | |
| | |
| | |
| | | |
These test only check if get_account_by_address is called correctly.
All other parts of `apply()` are left out.
|
| | | |
|
| |/
| |
| |
| |
| |
| | |
This instantiates an actual Envelope object instead of a Mock object
for use in the tests for envelope commands. The tests then do not fail
when they hit implicit getters of the form envelope['From'].
|
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| |
| |
| | |
It is valid to encapsulate the multipart/signed and multipart/encrypted
payloads in a multipart/mixed payload.
All of these tests currently fail.
|
| |
| |
| |
| |
| |
| | |
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 class tests most of the function fairly thoroughly. There are a
couple of error cases that are untested, but could be tested fairly
easily with some mocking.
There is one test marked as expected failure. In this case I disagree
with what alot does, though there probably isn't a canonical correct
behavior. Specifically, if a message is encrypted but unsigned, we
generate a header that says the signature is invalid. This seems
incorrect for a number of reasons. First, since there is no signature,
it cannot be invalid. Second, the reasoning is that it "seems
suspicious" that someone would encrypt but not sign a message. This is
silly, there are plenty of people who encrypt but don't sign their
messages, since signing and encrypting have two totally different
purposes. Signatures verify who *wrote* the message, but encryption
verifies who *reads* the message. People who need some level of
deniability about who wrote the message, but not about who read it (like
a political activist or whistle blower) might encrypt but not sign.
|