Edit (it wasn't clear what I was asking):
I wanted to send email to my Verizon address by submitting it from my home network to the Verizon MSA. So my question was: how can I find the name of an MSA server if all I have is the domain name. (I was incorrectly asking for the MX server.) I wanted to go from verizon.net
to smtp.verizon.net
reliably, so I could replicate it in a program. I still think it's a valuable question if you're writing a program where the user inputs their email address and credentials with the intention of sending email from the address.
Generally though, you should only need to find an MSA once, to send all of your email. Because the MSA finds the destination MX for you, and generally MX servers block dynamic IP ranges anyway.
I'm trying to send error logging emails to myself from my Python scripts. I was able to successfully send email to a Yahoo address using this server: smtp.mail.yahoo.com
. But I want to send email to a Verizon address.
How do I find the mail server for [email protected]
? I'm using Linux and have tried:
dig -t ANY verizon.net
:
; <<>> DiG 9.9.2-P1 <<>> -t ANY verizon.net
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 28223
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4000
;; QUESTION SECTION:
;verizon.net. IN ANY
;; ANSWER SECTION:
verizon.net. 260 IN MX 0 relay.verizon.net.
verizon.net. 218 IN A 206.46.232.39
;; Query time: 107 msec
;; SERVER: 127.0.1.1#53(127.0.1.1)
;; WHEN: Wed Jul 22 20:26:42 2015
;; MSG SIZE rcvd: 78
host -t mx verizon.net
:
verizon.net mail is handled by 0 relay.verizon.net
For comparison, host -t mx yahoo.com
:
yahoo.com mail is handled by 1 mta6.am0.yahoodns.net.
yahoo.com mail is handled by 1 mta5.am0.yahoodns.net.
yahoo.com mail is handled by 1 mta7.am0.yahoodns.net.
These commands haven't worked.