178
147
"""Get the origin and destination addresses of a message.
180
149
:param message: A message object supporting get() to access its
183
151
:return: A pair (from_email, to_emails), where from_email is the email
184
152
address in the From header, and to_emails a list of all the
185
153
addresses in the To, Cc, and Bcc headers.
189
157
for header in ['To', 'Cc', 'Bcc']:
190
158
value = message.get(header, None)
192
160
to_full_addresses.append(value)
193
161
to_emails = [ pair[1] for pair in
196
164
return from_email, to_emails