Even though Postmark is up and not reporting any issues on the status site, you may encounter cases where your application cannot connect to Postmark. The most common causes for these issues are related to networking configuration changes that might have occurred in your environment, or done by your hosting provider without your knowledge.
What we need to confirm is:
- You server(s) can lookup the IP address to connect to our API or SMTP servers.
- You are able to connect to our servers from your server(s). Ports 80 or 443 for the API, and ports 25, 587, or 2525 for SMTP.
When contacting us, please provide us with the public IP(s) that your server(s) are connecting from, we will be better able to look at logs for connectivity issues on our end.
Below are the commands we ask you to run from your server(s), if you can provide the full output from these commands when contacting support, we will be much better able to assist you in sorting out connectivity issues:
Troubleshooting API Connectivity:
First, verify that DNS is working properly:
$ nslookup api.postmarkapp.com
This should produce the public IP for our API. If it times out, then check and make sure you can lookup other public domains, such as example.com, yahoo.com, google.com, etc.
Next, verify that you can initiate a connection and download content from our API using the command line:
$ curl -vvv https://api.postmarkapp.com
It is uncommon, but if your system root certificates are out of date, curl may not be able to verify the TLS connection to the API, try the same command without TLS verification:
$ curl -vvv -k https://api.postmarkapp.com
If this fails, you may also attempt to connect without encryption:
$ curl -vvv http://api.postmarkapp.com
If you’re concerned about latency issues, then it may be useful to run `time` first:
$ time curl -vvv https://api.postmarkapp.com
If all of the above items are successful, then it’s time to look at code.
Troubleshooting SMTP Connectivity:
First — make sure SMTP is enabled on the Postmark server. SMTP is enabled by default on new Postmark servers but if it was disabled at some point, enable it again in the stream’s settings (Stream > Settings).
Similarly to the API, we want to make sure that your connections are able to resolve DNS for our SMTP servers, then we need to check connectivity.
$ nslookup smtp.postmarkapp.com
This should produce one of our published SMTP IPs.
Next, verify that you can connect to one of the following ports: 25, 587, or 2525. NOTE: Some ISPs and hosting providers will block these ports. In other cases, they redirect this traffic to their own SMTP servers.
Attempt to open a telnet connection to each port, and send two commands by typing each and then a newline (EHLO <hostname>, then QUIT), as in the example below:
$ telnet smtp.postmarkapp.com <port> EHLO localhost QUIT
The following is what a typical successful test will look like:
telnet smtp.postmarkapp.com 25 Trying 22.214.171.124... Connected to smtp.postmarkapp.com. Escape character is '^]'. 220 smtp.postmarkapp.com ESMTP p-pm-smtp02-pktewr1 EHLO localhost 250-smtp.postmarkapp.com 250-PIPELINING 250-SIZE 20480000 250-VRFY 250-ETRN 250-STARTTLS 250-AUTH PLAIN LOGIN CRAM-MD5 DIGEST-MD5 250-AUTH=PLAIN LOGIN CRAM-MD5 DIGEST-MD5 250-ENHANCEDSTATUSCODES 250-8BITMIME 250 DSN QUIT 221 2.0.0 Bye Connection closed by foreign host.<br>
Assuming this worked as expected, you can send a simple test to yourself using a command-line tool called “swaks”:
$ swaks --auth --tls -s smtp.postmarkapp.com --to="email@example.com" --from="firstname.lastname@example.org" --port=25<br>
When you run the command above, will be prompted for your username and password, which are both your Server API Token.
If these items were all successful, then it’s time to look at the SMTP client code in the application.