From f9daaf9bd23ef4b1b15326a96c350b20f1d64b4a Mon Sep 17 00:00:00 2001 From: Son NK <> Date: Mon, 11 May 2020 09:49:44 +0200 Subject: [PATCH 1/2] add .gitattributes file to override linguist --- .gitattributes | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..2fcb5b2a --- /dev/null +++ b/.gitattributes @@ -0,0 +1,3 @@ +# https://github.com/github/linguist#overrides +static/* linguist-vendored +docs/* linguist-documentation From 7c55c5c44a683f5a71e3918f59792a020e351e3b Mon Sep 17 00:00:00 2001 From: Son NK <> Date: Mon, 11 May 2020 10:21:44 +0200 Subject: [PATCH 2/2] return 250 instead of 451 when SPF fails --- email_handler.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/email_handler.py b/email_handler.py index 6c76b4db..b7fad61f 100644 --- a/email_handler.py +++ b/email_handler.py @@ -483,7 +483,8 @@ def handle_reply(envelope, smtp: SMTP, msg: Message, rcpt_to: str) -> (bool, str if ENFORCE_SPF and mailbox.force_spf: ip = msg[_IP_HEADER] if not spf_pass(ip, envelope, mailbox, user, alias, contact.website_email, msg): - return False, "451 SL E11" + # cannot use 4** here as sender will retry. 5** because that generates bounce report + return True, "250 SL E11" delete_header(msg, _IP_HEADER)