Skip to content

Commit 3247574

Browse files
committed
chore: Handle errors
1 parent 83d7f93 commit 3247574

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/maily/services/ses.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import email.errors
2+
13
import boto3
24
import botocore.exceptions
35
from maily.services import AWS
@@ -10,6 +12,7 @@
1012
from maily.config import AWS_SES_CONFIG_SET, REPLY_EMAIL, AWS_REGION
1113

1214

15+
1316
class SES(AWS):
1417
def __init__(self):
1518
super().__init__()
@@ -107,7 +110,8 @@ def ses_send_raw_email(self, from_address, to_address, subject, message_body, at
107110
return False
108111
except (ConnectionClosedError, SSLError):
109112
return None
110-
except:
113+
# TODO: Handle email.errors.HeaderWriteError: folded header contains newline
114+
except email.errors.HeaderParseError:
111115
return None
112116
return True
113117

0 commit comments

Comments
 (0)