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