diff --git a/datahub/interaction/email_processors/parsers.py b/datahub/interaction/email_processors/parsers.py index 1d66a58db..7a4e8e1da 100644 --- a/datahub/interaction/email_processors/parsers.py +++ b/datahub/interaction/email_processors/parsers.py @@ -111,8 +111,7 @@ def _extract_and_validate_contacts(self, all_recipients): return contacts def _extract_and_validate_sender_adviser(self): - # .from_ may come as [] or [('', '')] when missing. - if not any(from_[0] or from_[1] for from_ in self.message.from_): + if not self.message.from_ or self.message.from_ == [('', '')]: raise MalformedEmailError('Email was malformed - missing "from" header.') sender_email = self.message.from_[0][1] if not was_email_sent_by_dit(self.message):