def _handle_if_body(self, content_disp, content_type, part, bodies, file_path, parsed_mail):
    process_as_body = False
    if (content_disp is None):
        process_as_body = True
    elif (content_disp.lower().strip() == 'inline'):
        if (('text/html' in content_type) or ('text/plain' in content_type)):
            process_as_body = True
    if (not process_as_body):
        return (phantom.APP_SUCCESS, True)
    part_payload = part.get_payload(decode=True)
    if (not part_payload):
        return (phantom.APP_SUCCESS, False)
    charset = part.get_content_charset()
    with open(file_path, 'wb') as f:
        f.write(part_payload)
    bodies.append({'file_path': file_path, 'charset': part.get_content_charset()})
    self._add_body_in_email_headers(parsed_mail, file_path, charset, content_type)
    return (phantom.APP_SUCCESS, False)
def _handle_if_body(self, content_disp, content_type, part, bodies, file_path, parsed_mail):
    process_as_body = False
    if (content_disp is None):
        process_as_body = True
    elif (content_disp.lower().strip() == 'inline'):
        if (('text/html' in content_type) or ('text/plain' in content_type)):
            process_as_body = True
    if (not process_as_body):
        return (phantom.APP_SUCCESS, True)
    part_payload = part.get_payload(decode=True)
    if (not part_payload):
        return (phantom.APP_SUCCESS, False)
    charset = part.get_content_charset()
    with open(file_path, 'wb') as f:
        f.write(part_payload)
    bodies.append({'file_path': file_path, 'charset': part.get_content_charset()})
    self._add_body_in_email_headers(parsed_mail, file_path, charset, content_type)
    return (phantom.APP_SUCCESS, False)