Skip to content

Commit

Permalink
Make reply creation logic more robust to not having a from address
Browse files Browse the repository at this point in the history
  • Loading branch information
BjarniRunar committed Jul 1, 2015
1 parent 8f5cbc3 commit 11ad01a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions mailpile/plugins/compose.py
Original file line number Diff line number Diff line change
Expand Up @@ -431,16 +431,18 @@ def merge_contact(ai):
force_name=True)

def addresses(addrs, exclude=[]):
alist = [from_ai.address] + [a.address for a in exclude]
alist = [from_ai.address] if (from_ai) else []
alist += [a.address for a in exclude]
return [merge_contact(a) for a in addrs
if a.address not in alist
and not a.address.startswith('noreply@')
and '@noreply' not in a.address]

# If only replying to messages sent from chosen from, then this is
# a follow-up or clarification, so just use the same headers.
if len([e for e in ref_from if e.address == from_ai.address]
) == len(ref_from):
if (from_ai and
len([e for e in ref_from
if e and e.address == from_ai.address]) == len(ref_from)):
if ref_to:
result['to'] = addresses(ref_to)
if ref_cc:
Expand Down

0 comments on commit 11ad01a

Please sign in to comment.