handle case cannot parse mailbox_id
This commit is contained in:
parent
a3a99ac3f4
commit
6835c5b69d
|
@ -874,8 +874,13 @@ def handle_bounce(contact: Contact, alias: Alias, msg: Message, user: User):
|
||||||
file_path, BytesIO(orig_msg.as_bytes()), random_name
|
file_path, BytesIO(orig_msg.as_bytes()), random_name
|
||||||
)
|
)
|
||||||
# <<< END Store the bounced email >>>
|
# <<< END Store the bounced email >>>
|
||||||
|
try:
|
||||||
mailbox_id = int(orig_msg[_MAILBOX_ID_HEADER])
|
mailbox_id = int(orig_msg[_MAILBOX_ID_HEADER])
|
||||||
|
except TypeError:
|
||||||
|
LOG.warning("cannot parse mailbox from %s", orig_msg[_MAILBOX_ID_HEADER])
|
||||||
|
# use the alias default mailbox
|
||||||
|
mailbox = alias.mailbox
|
||||||
|
else:
|
||||||
mailbox = Mailbox.get(mailbox_id)
|
mailbox = Mailbox.get(mailbox_id)
|
||||||
if not mailbox or mailbox.user_id != user.id:
|
if not mailbox or mailbox.user_id != user.id:
|
||||||
LOG.exception(
|
LOG.exception(
|
||||||
|
|
Loading…
Reference in New Issue