(msg)
return None
Unwrap a email from the spamassasin email.

    Args:
        msg (email.message.Message): email to unwrap.

    Returns:
        [email.message.Message]: A list with the unwraped mails.
Unwrap a email from the spamassasin email.
Unwrap a email from the spamassasin email .
def sa_unwrap_from_email(msg):
    """Unwrap a email from the spamassasin email.

    Args:
        msg (email.message.Message): email to unwrap.

    Returns:
        [email.message.Message]: A list with the unwraped mails.

    """
    if msg.is_multipart():
        parts = []
        ploads = msg.get_payload()
        for pload in ploads:
            if pload.get_param('x-spam-type', '') == 'original':
                # We remove the headers added by spamassassin:
                if hasattr(pload, 'as_bytes'):
                    pl_bytes = pload.as_bytes()
                else:
                    pl_bytes = pload.as_string()
                el_idx = pl_bytes.index(b'\n\n')
                parts.append(MESSAGE(pl_bytes[el_idx + 2:]))
        if parts:  # len(parts) > 0
            return parts
    return None
def sa_unwrap_from_email ( msg ) : if msg . is_multipart ( ) : parts = [ ] ploads = msg . get_payload ( ) for pload in ploads : if pload . get_param ( 'x-spam-type' , '' ) == 'original' : # We remove the headers added by spamassassin: if hasattr ( pload , 'as_bytes' ) : pl_bytes = pload . as_bytes ( ) else : pl_bytes = pload . as_string ( ) el_idx = pl_bytes . index ( b'\n\n' ) parts . append ( MESSAGE ( pl_bytes [ el_idx + 2 : ] ) ) if parts : # len(parts) > 0 return parts return None