1.1 --- a/imiptools/__init__.py Tue Oct 13 23:33:25 2015 +0200
1.2 +++ b/imiptools/__init__.py Wed Oct 14 00:46:48 2015 +0200
1.3 @@ -93,10 +93,15 @@
1.4 ).process(msg, senders)
1.5
1.6 # However, outgoing messages do not usually presume anything about the
1.7 - # eventual recipients and focus on the sender instead.
1.8 + # eventual recipients and focus on the sender instead. If possible, the
1.9 + # sender is identified, but since this may be the calendar system (and
1.10 + # the actual sender is defined in the object), and since the recipient
1.11 + # may be in a Bcc header that is not available here, it may be left as
1.12 + # None and deduced from the object content later.
1.13
1.14 else:
1.15 - Recipient(None, messenger, store, publisher, preferences_dir, self.handlers, self.outgoing_only, self.debug
1.16 + senders = [sender for sender in get_addresses(get_all_values(msg, "From") or []) if sender != config.MESSAGE_SENDER]
1.17 + Recipient(senders and senders[0] or None, messenger, store, publisher, preferences_dir, self.handlers, self.outgoing_only, self.debug
1.18 ).process(msg, senders)
1.19
1.20 def process_args(self, args, stream):