def __init__(self):
"""
"""
try:
directory = settings.GENERAL_CONFIG['email_storage_dir']
if not os.path.exists(directory):
os.makedirs(directory)
except Exception as ex:
raise MailerServiceException(ex)
self._db_conn = sqlite3.connect(directory + '/' + CERBERUS_EMAIL_DB)
cursor = self._db_conn.cursor()
cursor.execute('''CREATE TABLE IF NOT EXISTS emails
(publicid text, sender text, recipient text, subject text, body text, category text, timestamp int)''')
self._db_conn.commit()
self._html_parser = html2text.HTML2Text()
self._html_parser.body_width = 0
评论列表
文章目录