fhf
September 4, 2024, 3:39pm
1
I’m going throgh the bounces on my system and adding them to iana.toml (to be contributed back to KumoMTA!). My question is what is the regex matched against exactly? I’ve noticed that Yahoo returns this for disabled mailboxes:
30 Sorry, your message to recipient@yahoo.com cannot be delivered. This mailbox is disabled (554.30).
The bounce event is:
{
"type": "Bounce",
// ...
"response": {
"code": 554,
"enhanced_code": null,
"content": "30 Sorry, your message to recipient@yahoo.com cannot be delivered. This mailbox is disabled (554.30).",
"command": ".\r\n"
},
"peer_address": {
"name": "mta5.am0.yahoodns.net.",
"addr": "67.195.204.77"
},
"timestamp": 1725438601,
"created": 1725438601,
"num_attempts": 0,
// ...
"bounce_classification": "Uncategorized",
"delivery_protocol": "ESMTP",
"reception_protocol": "ESMTP",
// ...
}
which does not have an enhanced_code.
Is it even possible to match classify this response using iana.toml? Can I use something like this as the regex to match it?
"^554\\.30"
or
"^554.*This mailbox is disabled (554\\.30)"
Mike
(Mike Hillyer)
September 4, 2024, 3:43pm
3
Mike
(Mike Hillyer)
September 4, 2024, 3:47pm
4
I’d just match on mailbox is disabled, the rest of the string isn’t really necessary.
fhf
September 4, 2024, 3:52pm
5
So the regex is matched against the string in response.content ?
Mike
(Mike Hillyer)
September 4, 2024, 3:56pm
6
It matches against the entire response.
fhf
September 4, 2024, 3:59pm
8
Another question, what happens if multiple rules match for a response?
fhf
September 4, 2024, 4:03pm
9
For example, this response:
{
"response": {
"code": 550,
"enhanced_code": {
"class": 5,
"subject": 5,
"detail": 0
},
"content": "Requested action not taken: mailbox unavailable (S2017062302). [AMS1EPF00000041.eurprd04.prod.outlook.com 2024-08-20T09:47:15.861Z 08DCBE949F874AB8]",
"command": "RCPT TO:<recipient@outlook.com>\r\n"
}
}
It’s matched by "^\\d{3} [45]\\.5\\.\\d+ ", # misc protocol error under ProtocolErrors in iana.yaml which is incorrect. Will adding another for ^5\\.5\\.0.+mailbox unavailable to bounces.toml override the rule in iana.toml?
Mike
(Mike Hillyer)
September 4, 2024, 4:15pm
11
As long as it is defined before iana.toml when setting up bounce processing.