174
178
"""Get the origin and destination addresses of a message.
176
180
:param message: A message object supporting get() to access its
178
183
:return: A pair (from_email, to_emails), where from_email is the email
179
184
address in the From header, and to_emails a list of all the
180
185
addresses in the To, Cc, and Bcc headers.
184
189
for header in ['To', 'Cc', 'Bcc']:
185
190
value = message.get(header, None)
187
192
to_full_addresses.append(value)
188
193
to_emails = [ pair[1] for pair in
191
196
return from_email, to_emails