commit
db5bd7d196
|
@ -67,6 +67,7 @@ def get_alias_log(gen_email: GenEmail, page_id=0):
|
|||
db.session.query(ForwardEmail, ForwardEmailLog)
|
||||
.filter(ForwardEmail.id == ForwardEmailLog.forward_id)
|
||||
.filter(ForwardEmail.gen_email_id == gen_email.id)
|
||||
.order_by(ForwardEmailLog.id.desc())
|
||||
.limit(_LIMIT)
|
||||
.offset(page_id * _LIMIT)
|
||||
)
|
||||
|
|
|
@ -199,7 +199,13 @@ class MailHandler:
|
|||
forward_email = ForwardEmail.get_by(
|
||||
gen_email_id=gen_email.id, website_email=website_email
|
||||
)
|
||||
if not forward_email:
|
||||
if forward_email:
|
||||
# update the From header if needed
|
||||
if forward_email.website_from != msg["From"]:
|
||||
LOG.d("Update From header for %s", forward_email)
|
||||
forward_email.website_from = msg["From"]
|
||||
db.session.commit()
|
||||
else:
|
||||
LOG.debug(
|
||||
"create forward email for alias %s and website email %s",
|
||||
alias,
|
||||
|
|
Loading…
Reference in a new issue