if an alias is disabled, accept email but not forward to user inbox

This commit is contained in:
Son NK 2019-11-16 15:46:32 +01:00
parent 0b9f28970f
commit a5a3bbbd63

View file

@ -92,6 +92,11 @@ class MailHandler:
with app.app_context():
gen_email = GenEmail.get_by(email=alias)
if not gen_email.enabled:
LOG.d("%s is disabled, do not forward", gen_email)
return "250 Message accepted"
website_email = parse_srs_email(envelope.mail_from)
forward_email = ForwardEmail.get_by(