Email functionality stopped when we moved to a different sub-domain

Hi All,
Four our ERPNext instance, we were using for production a server/host called
From that we moved the entire domain to At the same time, we also went from HTTP to HTTPS.
Ever since, we are getting errors in error log + our emails are not going out.

{‘retry’: 0, ‘log’: <function log at 0x7f613edf4050>, ‘site’: u’’, ‘event’: u’all’, ‘method_name’:
u’’, ‘method’: <function flush at 0x7f613ea9d140>, ‘user’: u’Administrator’, ‘kwargs’: {}, ‘async’: True, ‘job_name’: u’’}
Traceback (most recent call last):

Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/”, line 65, in execute_job
File “/home/frappe/frappe-bench/apps/frappe/frappe/email/”, line 281, in flush
File “/home/frappe/frappe-bench/apps/frappe/frappe/email/”, line 188, in check_email_limit
smtp_server = SMTPServer()
File “/home/frappe/frappe-bench/apps/frappe/frappe/email/”, line 134, in init
File “/home/frappe/frappe-bench/apps/frappe/frappe/email/”, line 137, in setup_email_account
self.email_account = get_outgoing_email_account(raise_exception_not_set=False, append_to=append_to)
File “/home/frappe/frappe-bench/apps/frappe/frappe/email/”, line 54, in get_outgoing_email_account
email_account = get_default_outgoing_email_account(raise_exception_not_set=raise_exception_not_set)
File “/home/frappe/frappe-bench/apps/frappe/frappe/email/”, line 84, in get_default_outgoing_email_account
email_account.password = email_account.get_password(raise_exception=False)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/”, line 660, in get_password
return get_decrypted_password(self.doctype,, fieldname, raise_exception=raise_exception)
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/”, line 16, in get_decrypted_password
return decrypt(auth[0][0])
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/”, line 101, in decrypt
plain_text = cstr(cipher_suite.decrypt(encode(pwd)))
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/cryptography/”, line 103, in decrypt
raise InvalidToken

Guess After Migration encryption key invalid - #4 by Julian_Robbins will help you

Thanks. That is not the error i am facing. My errors are coming in via logs.