take into account status.E518

This commit is contained in:
Son 2022-05-17 18:15:39 +02:00
parent a224f4faa6
commit 11dc28941b
1 changed files with 6 additions and 1 deletions

View File

@ -2237,8 +2237,13 @@ def handle(envelope: Envelope, msg: Message) -> str:
# to know whether both successful and unsuccessful deliveries can happen at the same time
nb_success = len([is_success for (is_success, smtp_status) in res if is_success])
# ignore E518 which is a normal condition
nb_non_success = len(
[is_success for (is_success, smtp_status) in res if not is_success]
[
is_success
for (is_success, smtp_status) in res
if not is_success and smtp_status != status.E518
]
)
if nb_success > 0 and nb_non_success > 0: