'Parses headers, content, attachments from given raw message.
:param content: Raw message.'

def __init__(self, content):

    self.raw = content
    self.mail = email.message_from_string(self.raw)
    self.text_content = u''
    self.html_content = u''
    self.attachments = []
    self.cid_map = {}
    self.parse()
    self.set_content_and_type()
    self.set_subject()
    self.set_from()
    self.message_id = (self.mail.get(u'Message-ID') or u'').strip(u'    <>')
    if self.mail[u'Date']:
        try:
            utc = email.utils.mktime_tz(email.utils.parsedate_tz(self.mail[u'Date']))
            utc_dt = datetime.datetime.utcfromtimestamp(utc)
            self.date = convert_utc_to_user_timezone(utc_dt).strftime(u'%Y-%m-%d    %H:%M:%S')
        except:
            self.date = now()
    else:
        self.date = now()
    if (self.date > now()):
        self.date = now()
