on_response Event
Fired for each MailServer accepting email for the domain.
Syntax
class MXResponseEventParams(object): @property def request_id() -> int: ... @property def domain() -> str: ... @property def mail_server() -> str: ... @property def precedence() -> int: ... @property def time_to_live() -> int: ... @property def status_code() -> int: ... @property def description() -> str: ... @property def authoritative() -> bool: ... # In class MX: @property def on_response() -> Callable[[MXResponseEventParams], None]: ... @on_response.setter def on_response(event_hook: Callable[[MXResponseEventParams], None]) -> None: ...
Remarks
A on_response event is fired for each mail server handling email for the requested domain. The RequestId parameter identifies the request and equals the value of request_id property right before the resolve method is called. MailServer is the name of the server handling email for the requested Domain. A lower Precedence value should be preferred. The TimeToLive parameter gives the validity time in seconds before the dns_server should be queried again.
Possible values for the StatusCode and Description parameters are:
StatusCode | Description |
0 | Ok |
1 | Format error |
2 | Server failure |
3 | Name error |
4 | Not implemented |
5 | Refused |
After the last on_response event is fired, the class sets the mail_server and status properties to the best MailServer and the error or success code respectively.