Mail senders: a 421 to QUIT isn't a failed send #41

Merged
jcoffey-dev merged 1 commits from fix/mailflow-quit-421 into main 2026-11-20 23:43:31 +00:00
Owner

The chaos tests sometimes saw a message arrive twice after a pod kill or a drain (3 of about 22 chaos jobs). Each time the send had been retried after 421 4.3.0 ... Server shutting down. That 421 answered QUIT, after the end of DATA already had its 250: smtplib's with sends QUIT on exit and raises on anything but 221, so the lab took a delivered message for a failed one and sent it again. Reproduced against a fake server that answers QUIT with 421. The server did nothing wrong.

mailflow.py and soak-load.py now QUIT and close whatever the answer, and retry only what failed before the 250.

The soak running on the bench keeps the old sender (it isn't touched until it ends); a message twice in its report gets checked against its retries.

Tracker: inbuxa-charts#14

The chaos tests sometimes saw a message arrive twice after a pod kill or a drain (3 of about 22 chaos jobs). Each time the send had been retried after `421 4.3.0 ... Server shutting down`. That 421 answered QUIT, after the end of DATA already had its 250: smtplib's `with` sends QUIT on exit and raises on anything but 221, so the lab took a delivered message for a failed one and sent it again. Reproduced against a fake server that answers QUIT with 421. The server did nothing wrong. `mailflow.py` and `soak-load.py` now QUIT and close whatever the answer, and retry only what failed before the 250. The soak running on the bench keeps the old sender (it isn't touched until it ends); a message twice in its report gets checked against its retries. Tracker: inbuxa-charts#14
jcoffey-dev added 1 commit 2026-11-20 23:26:02 +00:00
Mail senders: a 421 to QUIT isn't a failed send
ci / check (pull_request) Successful in 21s
130c1e405f
The chaos tests saw a message arrive twice after a pod kill or a drain,
three times in about twenty runs. Each time the send had been retried after
"421 4.3.0 Server shutting down". That 421 was the answer to QUIT, after
the end of DATA had its 250: smtplib's with-statement sends QUIT on the way
out and raises on anything but 221, so the lab took a delivered message for
a failed one and sent it again. The server did nothing wrong.

mailflow.py and soak-load.py now QUIT and close whatever the answer, and
retry only what failed before the 250. The soak running now has the old
sender; a message twice in its report is checked against its retries.
jcoffey-dev merged commit 3b8b124502 into main 2026-11-20 23:43:31 +00:00
jcoffey-dev deleted branch fix/mailflow-quit-421 2026-11-20 23:43:31 +00:00
Sign in to join this conversation.