How can I force a specific SMTP 4xx error (452 4.2.2 mailbox full) to become a HardFail instead of SoftFail? #3596
Unanswered
kewayne
asked this question in
Help with using Postal
Replies: 1 comment
|
Unfortunately this would require a code change as you suggest, would be good to see a PR for it though. That said, I did just yesterday see a case where an email was rejected for the inbox being full and then later that same day, successfully delivered so it being temporary does happen 😅 |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
I am running Postal (Docker installation) and I am trying to customize the delivery behavior for a specific SMTP response.
Currently, when delivering to Gmail, I get this:
452-4.2.2 The recipient's inbox is out of storage space. Please direct the recipient to
452 4.2.2 https://support.google.com/mail/?p=OverQuotaTemp
Postal correctly treats this as a SoftFail because it is a 4xx response, but in my use case I would like this specific error (452 4.2.2 mailbox full) to be treated as a HardFail instead of retrying.
I found the logic in:
/opt/postal/app/app/senders/smtp_sender.rb
specifically the Net::SMTPServerBusy rescue block, where Postal creates:
create_result("SoftFail")
for temporary SMTP errors.
Has anyone implemented a clean way to override this behavior?
My goal is:
Keep normal 4xx SMTP errors as SoftFail
Only convert 452 4.2.2 mailbox full / OverQuotaTemp responses into HardFail
I am wondering if there is a recommended way to do this in Postal, or if modifying smtp_sender.rb is the correct approach.
Thanks!
All reactions