summaryrefslogtreecommitdiff
path: root/alot
diff options
context:
space:
mode:
authorMichael J Gruber <github@grubix.eu>2018-11-14 13:52:37 +0100
committerPatrick Totzke <patricktotzke@gmail.com>2018-11-15 08:58:35 +0000
commit4feebc98fd5ef7d10dd7e790aa81604d60af7e73 (patch)
treef9a2f87e53adcc97877213ec02bc2f897c8a50e5 /alot
parent19192cd38d50820b638fdfda2262a5b2dc5b0a6d (diff)
make bounce command use the correct sender account
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.
Diffstat (limited to 'alot')
-rw-r--r--alot/commands/envelope.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/alot/commands/envelope.py b/alot/commands/envelope.py
index c442fbd7..b300125c 100644
--- a/alot/commands/envelope.py
+++ b/alot/commands/envelope.py
@@ -253,7 +253,7 @@ class SendCommand(Command):
if not isinstance(msg, email.message.Message):
msg = email.message_from_string(
self.mail, policy=email.policy.SMTP)
- address = msg.get('From', '')
+ address = msg.get('Resent-From', False) or msg.get('From', '')
logging.debug("FROM: \"%s\"" % address)
try:
account = settings.get_account_by_address(address,