Commit Graph

263 Commits

Author SHA1 Message Date
Son Nguyen Kim d9d67df126 remove unique constraint on TransactionalEmail.email 2021-09-21 11:15:40 +02:00
Son Nguyen Kim 1d09d76cb2 use re2 instead of re to avoid ReDOS attack 2021-09-21 10:57:36 +02:00
Son Nguyen Kim 17c13ee37f ignore smtp error in handle_bounce_forward_phase() 2021-09-20 13:51:16 +02:00
Son Nguyen Kim cbc20dd268 remove unused import 2021-09-18 19:19:17 +02:00
Son 9b89d7cc5d update package 2021-09-18 18:48:31 +02:00
Son ec2812bfa4 handle invalid email in email_can_be_used_as_mailbox 2021-09-18 18:46:26 +02:00
Son Nguyen Kim 8b676bc4af not disable alias if ALIAS_AUTOMATIC_DISABLE is not set 2021-09-17 18:05:35 +02:00
Son Nguyen Kim a6c874e914 Use validate_email in get_email_local_part and get_email_domain_part 2021-09-17 17:42:52 +02:00
Son Nguyen Kim 695a628e68 save email that can't be DKIM signed to temp dir to investigate 2021-09-15 09:29:08 +02:00
Son Nguyen Kim 567bee9a0b add exception trace when dkim fails 2021-09-14 09:13:39 +02:00
Son Nguyen Kim e4ed192cce rename 2021-09-13 19:50:15 +02:00
Son Nguyen Kim 106358da5f handle yahoo complaint 2021-09-13 19:49:40 +02:00
Son Nguyen Kim b3012376c3 use another DKIM header if one fails 2021-09-13 16:04:32 +02:00
Son Nguyen Kim 41478a5715 replace parseaddr_unicode by parse_full_address 2021-09-10 17:26:14 +02:00
Son Nguyen Kim 8023afe9be use email_validator instead of validate_email which isn't updated for a while 2021-09-10 16:42:02 +02:00
Son Nguyen Kim 6b65e00dcf install flanker, upgrade email_validator 2021-09-10 16:36:59 +02:00
Son Nguyen Kim defd7b159d Fix get_header_unicode: handle the case header contains several parts 2021-09-09 11:47:01 +02:00
Son Nguyen Kim 4df83f953d handle utf-8 decoding fail 2021-09-08 15:17:11 +02:00
Son Nguyen Kim 5ac78f2694 reformat 2021-09-08 11:29:55 +02:00
Son Nguyen Kim b53da25a41 handle hotmail complaint 2021-09-06 19:44:18 +02:00
Son Nguyen Kim bae9a6f431 flake8 2021-08-20 16:09:22 +02:00
Son Nguyen Kim 76c1b3d807 use deepcopy instead of email.message_from_string in copy() 2021-08-20 16:03:22 +02:00
Son Nguyen Kim fb29503b81 do not send bounce to IgnoreBounceSender 2021-08-02 11:33:58 +02:00
Son Nguyen Kim 383cd49f25 fix year copyright in email 2021-07-30 17:05:16 +02:00
Son Nguyen Kim 189eb8427e speed up should_disable() 2021-07-14 12:25:44 +02:00
Son Nguyen Kim e26287a4c7 Revert "disable should_disable() for now"
This reverts commit fb88654d84.
2021-07-14 12:23:02 +02:00
Son Nguyen Kim fb88654d84 disable should_disable() for now 2021-07-13 17:24:28 +02:00
Son 93991816c9 fix "Received" header is not str 2021-06-17 23:02:25 +02:00
Son NK 79d0ef8906 Use Postfix queue-id as log message-id 2021-06-04 17:15:59 +02:00
Son NK 2f96322977 make sure BOUNCE_PREFIX_FOR_REPLY_PHASE can't be used as directory name or for creating aliases on-the-fly 2021-05-25 17:59:40 +02:00
Son NK 159843a923 Add log for sl_sendmail 2021-05-24 12:04:22 +02:00
Son NK ade07f9449 return empty name when name can't be decoded 2021-05-22 16:47:44 +02:00
Son NK 0039b4c301 disable an alias if the user has too many bounces recently 2021-04-16 17:57:25 +02:00
Son NK 7c1af6a265 improve should_disable(): take into account repetitive bounces 2021-04-06 17:24:06 +02:00
Son NK a90fa49636 add submit for approval for app 2021-04-01 10:52:51 +02:00
Son NK 84b4c11086 handle UnicodeEncodeError in encode() 2021-03-24 10:08:11 +01:00
Son NK d59cee0bcc improve welcome email 2021-03-23 18:47:16 +01:00
Son NK 66eb93fe53 fix sanitize header 2021-03-17 10:59:13 +01:00
Son NK 826e4455cf refactor 2021-03-17 10:23:35 +01:00
Son NK 11789559f1 move spf_pass(), sl_sendmail() to email_utils.py 2021-03-17 10:23:35 +01:00
Son NK 3c8ec8fcf2 make DKIM_PRIVATE_KEY_PATH optional 2021-03-08 15:18:03 +01:00
Son NK 193f8d8ccc Handle UnicodeDecodeError in get_header_unicode() 2021-03-05 20:41:23 +01:00
Son NK 3aeaf6fe29 make include_sender_in_reverse_alias non nullable 2021-02-24 15:44:50 +01:00
Son NK e7063b6514 highlight reddit in welcome mail 2021-02-12 13:03:31 +01:00
Son NK 25afe4831c ignore amazonses.com encoding 2021-01-31 11:52:55 +01:00
Son NK 5f0930b291 handle header is None in get_header_unicode 2021-01-31 11:50:41 +01:00
Son NK 4cd49b66c2 use VERP for transactional email: remove SENDER, SENDER_DIR 2021-01-26 09:59:22 +01:00
Son NK 4a91db8e11 rename parse_email_log_id_from_bounce -> parse_id_from_bounce 2021-01-26 09:59:22 +01:00
Son NK da53b7fa00 Improve should_disable() to take into account last 7 days bounces 2021-01-19 10:45:39 +01:00
Son 8a74aee363 black 2021-01-16 10:55:14 +01:00
Son f9161dba20 Handle "message/rfc822" in replace() 2021-01-16 10:45:50 +01:00
Son NK c431abd917 take into account alias.cannot_be_disabled in should_disable 2021-01-13 11:03:30 +01:00
Son NK c83b146f14 Add BOUNCE_PREFIX, BOUNCE_SUFFIX config 2021-01-11 14:51:29 +01:00
Son NK e9adb3270d use sanitize_email instead of .lower().strip().replace(" ", "") 2021-01-11 12:29:40 +01:00
Son NK 01858ac452 sanitize contact email 2021-01-11 12:27:02 +01:00
Son NK ef7fae32b1 remove the "Hi {name}" from email template 2021-01-11 10:23:34 +01:00
Son NK 3ac159d073 use text/plain for text email instead of text/text 2021-01-04 15:11:12 +01:00
Son NK 3179d70df1 ignore text/csv in replace() 2020-12-31 18:03:42 +01:00
Son NK a34af98de8 handle "multipart/signed" in add_header() 2020-12-31 15:50:03 +01:00
Son NK ef2624ccea handle multipart/mixed in add_header 2020-12-31 15:11:46 +01:00
Son NK 74a63db835 ignore "text/directory" in replace() 2020-12-30 09:48:58 +01:00
Son NK 31774f9ea7 set include_sender_in_reverse_alias to False by default 2020-12-28 10:28:05 +01:00
Son NK 3015cd1dc0 ignore "text/calendar" content type 2020-12-18 16:07:32 +01:00
Son NK 6cec373b6d ignore UnicodeDecodeError in decode_text() 2020-12-18 13:10:33 +01:00
Son NK fb8a43fd5d use decode_text() in add_header() 2020-12-18 10:44:42 +01:00
Son NK 091ff3ad2c Add decode_text() 2020-12-18 10:43:06 +01:00
Son NK 3a8cdce650 Create should_disable 2020-12-16 18:50:09 +01:00
Son Nguyen Kim bf139f83b3
Merge pull request #342 from herrboyer/linting
Linting
2020-12-07 17:45:50 +01:00
Son NK ce3dae2a07 inform user when an alias can't be created when a directory is disabled 2020-12-07 10:55:13 +01:00
Son NK 37a74bc093 refactor: rename 2020-12-07 10:50:42 +01:00
Renaud Boyer 5d948faf56 black 2020-12-06 22:11:58 +01:00
Son NK ce2d68a64d take into account include_sender_in_reverse_alias when creating reverse-alias 2020-12-06 19:37:20 +01:00
Renaud Boyer 4bcc0d107f linting 2020-12-06 18:01:55 +01:00
Son NK 83df119178 do not replace for "application/*" 2020-12-04 11:33:49 +01:00
Son NK 59daaa3164 ignore multipart/signed when replacing message 2020-12-03 17:52:11 +01:00
Son NK cd680bcd7f ignore content type like image/, video/, audio/ in replace() 2020-12-01 18:34:38 +01:00
Son NK 652bb6a369 take into account multipart/mixed in replace() 2020-11-30 19:45:45 +01:00
Son NK cefa68d392 Create replace() in email_utils 2020-11-30 15:15:13 +01:00
Son NK 0b95ca33b8 use no encoding for 8bit and binary 2020-11-30 10:49:04 +01:00
Son NK f804332c2d refactor: create EmailEncoding enum 2020-11-30 10:48:16 +01:00
Son NK d61f45ea86 use 7bit as default encoding 2020-11-26 17:22:17 +01:00
Son NK 1241838b26 take into account message encoding in add_header() 2020-11-26 17:03:50 +01:00
Son NK e2a7061429 add get_encoding() and encode_text() 2020-11-26 17:01:05 +01:00
Son NK bcdf522174 create normalize_reply_email(): handle case where reply email contains space, quote, etc 2020-11-22 13:07:09 +01:00
Son NK f069d2f083 use getaddresses to parse multiple address from To, CC header. Remove get_addrs_from_header() 2020-11-21 19:15:02 +01:00
Son NK c25a5b50f6 make sure reply_email only contain lowercase 2020-11-20 10:03:40 +01:00
Son NK 75c3fa1c11 make sure reply-email only uses ascii-encoded char 2020-11-18 15:36:39 +01:00
Son NK 9ca129cb97 use warning level for cannot decode error 2020-11-18 11:43:25 +01:00
Son NK 319078fceb use contact email when generating reply-email 2020-11-18 10:24:39 +01:00
Son NK 0963049d1f use utf-8 when unknown charset in parseaddr_unicode() 2020-11-18 10:03:58 +01:00
Son NK 28d42a7a22 Use get_header_unicode() in get_addrs_from_header() 2020-11-18 10:03:00 +01:00
Son NK be510ea1d7 use utf-8 if unknown charset in get_header_unicode() 2020-11-18 10:02:10 +01:00
Son NK 9154b4656d refactor: create is_reply_email() 2020-11-16 19:22:19 +01:00
Son NK 75ba1669e0 Create generate_reply_email() and refactor 2020-11-16 19:15:09 +01:00
Son NK f16676e921 email.message_from_string can also throw LookupError when non-existent charset is set 2020-11-13 18:08:56 +01:00
Son NK 4e16eb7403 fix 2020-11-10 17:42:23 +01:00
Son NK 4666d21f63 email.message_from_string can also throw KeyError when 'content-transfer-encoding' is absent 2020-11-10 17:26:24 +01:00
Son NK 632a5bbbc8 handle UnicodeEncodeError in copy() and to_bytes() 2020-11-10 16:02:19 +01:00
Son NK c3f73b25b2 decode the subject 2020-11-09 21:16:50 +01:00
Son NK b2f9479bce failover when ascii encoding fails 2020-11-09 20:58:39 +01:00