/go/checksmtp: checksmtp from the Command Line

/go/checksmtp makes sure that people can send email through your server. It: The command does not check the SSL certificate. To check the certificates for SMTP and IMAP, use checkmail and checkimap. Every admin action in GoAdmio has a matching /go/ command, so anything you can click you can also script.

Quick start

/go/checksmtp

Options

None. Any arguments you pass are ignored.

Examples

# Run the check
/go/checksmtp

# Test the login on port 587 yourself
curl -v --url smtp://127.0.0.1:587 --user 'user@example.com:password' --mail-from user@example.com --mail-rcpt you@example.net -T /dev/null

# Check that the host name points to this server
dig $(cat /etc/hostname) +short

Output

The command prints nothing when the first test succeeds. Other results:

Message Meaning
Invalid Hostname (<hostname>), A hostname should consist of a name and a domain name. All valid hostnames should have 2 dots in them. The server host name has fewer than 2 dots. The administrator is alerted and the command stops.
Please Point <hostname> to A Record: <server-ip> The host name does not resolve to this server’s public IP. The administrator is alerted and the command stops.
SMTP failed. Our system is trying to fix it automatically. The first test failed. The mail configuration was rebuilt, and the test is run again.
SMTP error was automatically corrected. The second test succeeded.
CHECKSMTP: SMTP Server <hostname> is not working. All three tests failed. The administrator is alerted.

Each run also adds a line to /var/log/go/checksmtp.log.

The command ends with status 1 even when the test succeeds. Do not use its exit status to detect errors.

When nothing is tested

The command stops without any message, and without sending a test, in these cases:

Case Why
An outgoing SMTP relay is configured There is at least one entry in the SMTP relay list (/var/lib/sqlite/smtp.db), so the command assumes the relay is used.
The public IP of the server cannot be found The IP lookup returned nothing.
No mailbox has sent mail today There is no account to test with. In this case the command only rebuilds the mail maps with vmail.

See the full reference at /go/checksmtp and the GoAdmio command index.

GoAdmio is free and open source, with no license fees and no account limits. Read the GoAdmio docs, or see why it is a free cPanel alternative at goadmio.com.

By:

Posted in:


Leave a Reply

Your email address will not be published. Required fields are marked *