def infer_recipients(msg):
    """Infer the proper recipients based on msg's headers.

    return a list of recipients including all addresses listed in the
    To, Cc, and Bcc headers.
    """
    recipients = []
    for hdr in ('To', 'Cc', 'Bcc'):
        for addr in msg[hdr].split(','):
            addr = addr.strip()
            recipients.append(addr)
    return addr
