'Removes all the dangerous and useless staff'

def parse_email_body(self, body):

    body = body.replace('\r', '').replace('=\n', '').replace('=\n\r', '')
    body = body.replace('=20\n', '\n\n')
    HARDTREE_MESSAGING_UNSAFE_BLOCKS = getattr(settings, 'HARDTREE_MESSAGING_UNSAFE_BLOCKS', ('head', 'object', 'embed', 'applet', 'noframes', 'noscript', 'noembed', 'iframe', 'frame', 'frameset'))
    tags_str = '    '.join(HARDTREE_MESSAGING_UNSAFE_BLOCKS)
    body = removetags(body, tags_str)
    rules = [{'\\s*<br\\s*/?>\\s*': u'\n'}]
    for rule in rules:
        for (k, v) in rule.items():
            regex = re.compile(k)
            body = regex.sub(v, body)
    if (body.startswith('<!DOCTYPE') or body.startswith('<html') or body.startswith('<meta')):
        body = body.replace('\n\n\n', '\n').replace('\n\n', '\n').replace('>\n<', '><')
    elif ('<html' not in body):
        body = body.replace('\n', '<br    />\n')
    return body
