checkmail
Test whether outbound mail port 25 works from this server, and whether the SMTP (465) and IMAP (993) SSL certificates are installed. This command also opens the local firewall.
- Command:
/go/checkmail - Category: Email
- Required option: None
- Output: Messages about port 25, SMTP SSL, and IMAP SSL
- Last updated: 2026-11-20
On this page: Overview · Quick start · Syntax · Options · Output · Examples · Troubleshooting · Details · See also
Overview
Many hosting providers block outbound connections on port 25, which stops a server from delivering email to other mail servers. /go/checkmail tells you whether your provider does this. It:
- tries to connect to Google's mail server (
gmail-smtp-in.l.google.com) on port 25 - names your provider when the connection is blocked
- when port 25 works, checks that the SMTP SSL certificate (port 465) matches the server host name
- when port 25 works, checks that the IMAP SSL certificate (port 993) matches the IMAP host name
[!WARNING] Despite its name, this command changes the firewall. It opens all ports in
iptablesand removes the firewalld rules that block outbound port 25. See Firewall changes.
Quick start
/go/checkmail
Syntax
/go/checkmail
The command takes no options or arguments. Run it as root. It needs nc (netcat), openssl, and whois.
Options
None. Any arguments you pass are ignored.
Output
| Message | Meaning |
|---|---|
Your ISP <name> blocking SMTP Port 25 |
The connection to port 25 failed or timed out. The name is taken from the whois record of the server's IP address, and can be empty. |
Port 25 is opened |
The connection to port 25 worked. |
Port 465 is opened |
The SMTP certificate contains the server host name. |
SMTP SSL is not installed (<hostname>) |
The SMTP certificate does not contain the host name. Recommended steps follow. |
Port 993 is opened |
The IMAP certificate contains the IMAP host name. |
IMAP SSL is not installed (<hostname>) |
The IMAP certificate does not contain the IMAP host name. |
When the SMTP certificate is missing, the command also prints:
Recommended:
1 - Point a Hostname <hostname> to your Server IP <server-ip>
2 - Run "/go/installmail"
The command prints nothing when the port 25 test gives a result that matches none of the cases above, for example when nc is not installed. Port 465 and port 993 are only reported when port 25 works. No email or WhatsApp alert is sent. Each run adds a line to /var/log/go/checkmail.log.
Examples
# Run the check
/go/checkmail
# Test port 25 yourself
nc -zv -w 3 gmail-smtp-in.l.google.com 25
# See the first rules of the local firewall
iptables -S | head
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
Your ISP <name> blocking SMTP Port 25 |
Your provider blocks outbound port 25. | Ask the provider to unblock it, or send mail through a relay. See smtp and brevo. |
| The message names your provider, but you know port 25 is open | A local firewall rule was blocking port 25 during the test. The command removes that rule only after the test (see Known issues). | Run the command a second time. |
| Nothing is printed | The test output matched no case, for example nc is not installed. |
Install netcat, then run again. |
SMTP SSL is not installed (<hostname>) |
The SMTP certificate is missing, or the host name does not point to this server. | Point the host name to the server IP, then run installmail. |
IMAP SSL is not installed (<hostname>) |
The IMAP certificate is missing or for another name. | See checkimap and mailssl. |
| The firewall is open to everything after the command | See Firewall changes. | Reinstall the firewall rules with firewall. |
Permission denied or the firewall is unchanged |
The command was run without root. | Run it as root. |
Details
What it does, in order
- Logs the run to
/var/log/go/checkmail.log. - Reads the server host name, the IMAP host name from
/etc/imap(or the server host name if the file does not exist), and the server's public IP. - Tests a connection to
gmail-smtp-in.l.google.comon port 25, with a 3 second limit. - Connects with
openssltolocalhost:465andlocalhost:993and saves the answers. - Changes the firewall (see below).
- Reads the test results and prints the messages.
Firewall changes
| System | Change |
|---|---|
iptables installed |
Inserts ACCEPT rules at the top of the INPUT and OUTPUT chains. All traffic is then accepted before any other rule is looked at. |
firewalld installed |
Permanently removes the direct rules that drop outbound TCP port 25 for IPv4 and IPv6, then reloads firewalld. |
The iptables rules are not removed afterwards. They are not saved, so a firewall reload or a restart normally removes them, but until then every port is open. Reinstall the firewall with firewall, and check the required ports with checkfirewall.
Known issues
- The port 25 test runs before the firewall is opened, so a local rule that blocks port 25 can make the first run blame your provider.
- The "Port 465 is opened" and "Port 993 is opened" messages mean the certificate contains the host name. A port that is open with an expired or wrong certificate is reported as "not installed", and an expired certificate with the right name passes.
- The port 465 check runs twice.
- The test only shows whether you can send to Google on port 25. It does not check that your own server accepts mail on port 25.
See also
| Command | Description |
|---|---|
checkimap |
Check the IMAP port and SSL certificate |
checksmtp |
Check the SMTP port and SSL certificate |
smtp |
Manage the SMTP port: block, unblock, and change it |
brevo |
Manage Brevo (Sendinblue) transactional email integration |
installmail |
Install and configure webmail services (Postfix and Dovecot) |
firewall |
Install a firewall on a GoAdmio server |
checkfirewall |
Verify that important required ports are open on your server |