How can you test a backup / secondary MX server?

Solution 1:

Just use a telnet session to test email delivery. As an example,

# telnet host.domain 25
Trying host.domain...
Connected to host.domain.
Escape character is '^]'.
220  ESMTP
HELO example.com
250
MAIL FROM:<[email protected]>
250 ok
RCPT TO:<[email protected]>
250 ok
DATA

To: [email protected]
From: [email protected]
Subject: a test message

Test message body.
.
250 ok

Solution 2:

When telnet is not enough, or too tedious, I use SWAKS

eg:

 cat email-content.txt | 
 swaks --body - --helo localhost.localhomain --server mail.example.com:25 \
  --auth-user fred --auth-password flintst1 -tls \
  --h-Subject Pebbles  --to [email protected]
  --from '[email protected]'