QueryDNS will send DNS request to DNS server specified
in DNSHostname
property. It can be used for various tasks related to
hostnames and domains connecting to your SMTP server. For
example, you can use it to connect to ORDB database (open
relay database) and send queries to them to determine if
incoming mail is possible SPAM or not.
When QueryDNS is used, it will send request to the
server. When response arrives from the server, DNSResponse
event will be fired where you can read result of your
query. If error occurs, DNSResponse event will contain
Success argument that will tell you
if your query was successful or not.
If server replies with answer that was not expected,
recursive queries are automatically resent by
wodSmtpServer. For example, DNS server may reply that
it's not authoritative for your query and will point
you to another DNS server. wodSmtpServer will automatically
resend the request - until response is received or timeout
expires.
QueryDNS can be used anytime and any number of
times.
QueryTXT type can be used, for example, to obtain SPF (anti spam)
records from sender server. For example, you can try to retrieve it
for Google:
-
wodSmtpServer1.QueryDNS QueryTXT, "google.com", 30
to get response like this:
v=spf1 ptr ?all.google.com