Commit Graph

748 Commits

Author SHA1 Message Date
Son NK 4799721667 remove DKIM-Signature if any 2019-12-17 19:06:17 +02:00
Son NK a61b900675 Sign DKIM at app level
- add DKIM_PRIVATE_KEY_PATH param
- create email_utils.add_dkim_signature
- add DKIM signature for transactional emails
- add DKIM signature for forward & reply emails. In reply phase, only non-custom-domain emails have DKIM added.
2019-12-17 18:50:26 +02:00
Son NK f8293bc618 make ADMIN_EMAIL optional 2019-12-16 19:36:59 +02:00
Son NK 615e2a4d91 use send_by_postfix instead of sending bounce email directly 2019-12-15 18:55:18 +02:00
Son NK 7e76c3a0a9 send bounce directly instead of return 550 2019-12-15 18:55:18 +02:00
Son NK 881525dfc2 use random_string for email_handler as reply email is not user-facing 2019-12-15 18:55:18 +02:00
Son NK c5bf95fffe forward reply email can only by used by user email 2019-12-15 18:55:18 +02:00
Son NK 46b0872710 handle both emails with reply+ and ra+ prefix 2019-12-15 18:55:18 +02:00
Son NK 8c3834c957 generate a reply_email, make sure it is unique 2019-12-15 18:55:18 +02:00
Son NK 62e0ae27a0 move get_email_name, get_email_part to email_utils 2019-12-15 18:55:18 +02:00
Son NK ec62fad3a0 remove notify_admin, replace by general stats 2019-12-15 18:55:18 +02:00
Son NK b0f4ab8a6d use sendmail instead of send_message in reply phase to avoid unicode problem 2019-12-15 18:55:18 +02:00
Son NK 572ce1de57 fix db connections leaks in email_handler: override the default app.teardown_appcontext 2019-12-15 18:55:18 +02:00
Son NK 7f908a9da8 display website_from on alias log 2019-12-15 18:55:18 +02:00
Son NK 8d60ebd456 handle the case email from header has the format "First Last <ab@cd.com>" 2019-12-15 18:55:17 +02:00
Son NK c37ba0e1de website_email: use From header instead of envelope from 2019-12-15 18:55:17 +02:00
Son NK 29d48b7d0f reduce sleep time in email_handler 2019-12-15 18:55:17 +02:00
Son NK 1435a77130 send raw message instead of using EmailMessage object 2019-12-15 18:55:17 +02:00
Son NK a9112c0480 remove DKIM-Signature for custom domain 2019-12-15 18:55:17 +02:00
Son NK 66b59a265a remove redundant check in handle_RCPT to support custom domain. Add check to reply phase. 2019-12-15 18:55:16 +02:00
Son NK fbf4a97a3e do NOT modify "to" header as it's not displayed in mail client anyway 2019-12-15 18:55:15 +02:00
Son NK e0bf5245a3 remove DKIM-Signature as Postfix will add this header 2019-12-15 18:55:15 +02:00
Son NK 64f7d04960 fix forward phase: use reply email as envelope-from 2019-12-15 18:55:15 +02:00
Son NK 1cb8282cb2 change the to: header so target is user email 2019-12-15 18:55:15 +02:00
Son NK 9eb85abac4 remove srs 2019-12-15 18:55:15 +02:00
Son NK 837e1ffcf6 add List-Unsubscribe-Post header. Block alias directly if POST, otherwise ask user confirmation. 2019-12-15 18:55:15 +02:00
Son NK cb14277bc7 add List-Unsubscribe header to block quickly an alias 2019-12-15 18:55:15 +02:00
Son NK 75e07fff04 put original name and email to from: header 2019-12-15 18:55:15 +02:00
Son NK 5b1819e891 do not modify subject 2019-12-15 18:55:15 +02:00
Son NK 7207312ec9 refactor email_handler: create handle_forward and handle_reply 2019-12-15 18:55:15 +02:00
Son NK 34cf72eaee create POSTFIX server 2019-12-15 18:55:15 +02:00
Son NK 0ae7f2d68a no need to modify reply-to. Remove this header if present. 2019-12-15 18:55:15 +02:00
Son NK a70928d166 Modify From: header to reply_email so email passes DMARC 2019-12-15 18:55:15 +02:00
Son NK a28c90f110 Change subject to let user know the email is forwarded from SL 2019-12-15 18:55:15 +02:00
Son NK cf3a2258b2 return 510 if no such alias 2019-12-15 18:55:15 +02:00
Son NK 49d66c4226 tentative to fix UnicodeEncodeError https://sentry.io/organizations/son/issues/1339911828/?project=1478143&query=is%3Aunresolved 2019-12-15 18:55:15 +02:00
Son NK 032322a3d4 log forwarded emails 2019-12-15 18:55:14 +02:00
Son NK a5a3bbbd63 if an alias is disabled, accept email but not forward to user inbox 2019-12-15 18:55:14 +02:00
Son NK e335ae7d52 fix replace_header 2019-12-15 18:55:13 +02:00
Son NK 8b67a13581 fix case where reply-to is already present 2019-12-15 18:55:13 +02:00
Son NK 6015dbd4d1 Revert "try fixing spam issue: use personal email in forward phase"
This reverts commit 2f46a225e1b9099c2905a771132445caf42b4284.
2019-12-15 18:55:13 +02:00
Son NK bfb1c27528 try fixing spam issue: use personal email in forward phase 2019-12-15 18:55:13 +02:00
Son NK b80dbdf60b notify admin if someone uses reply phase 2019-12-15 18:55:13 +02:00
Son NK a01c94187f v1 of email handler, forward and reply phase work! 2019-12-15 18:55:13 +02:00
Son NK 80babefdb9 use 1.1.1.1 as host IP 2019-12-15 18:55:13 +02:00
Son NK 8f878b4c5d try to make working with postfix outside docker (in host) 2019-12-15 18:55:13 +02:00
Son NK c2546cb0de fix test 2019-12-15 18:55:13 +02:00
Son NK d3985e2cf3 email handler: forward phase. Todo: reply phase 2019-12-15 18:55:13 +02:00