Login

Register

Testing Email Server configuration in Linux ( RHEL5/RHEL6)

If you’ve been following along, you’ve likely been so busy setting up the mail servers that you still haven’t had the chance to test them. Verifying the functionality of your mail servers is always a good idea to make sure they are working properly.

Even though you configured a secure Dovecot server in the preceding section, I changed it back to the unsecure version for testing purposes. First, you need to check the Postfix server both locally and remotely to make sure outgoing mail is working.

You can use the mail command to make some quick tests to the SMTP protocol.

Step 1. For the local mail test, use the following:

# echo “Hello User01” | mail -s “Local Test” user01

If you don’t see any error messages, your message went through.

Step 2. For the remote mail test, use the following:

# echo “Hello again User01” | mail -s “Remote Test”user01@example.com

After your messages are sent, you can use the mailq command with the -v option to view the queue of messages that have been sent or are waiting to be sent. This command produces a lot of output, so you may
need to scroll around to find what you’re looking for.

Step 3. A third way to test that the mail server is accepting connections properly is to telnet into the Postfix server on port 25:

For some reason, this message seems to be stuck in the queue (I disabled the network interface to generate an error). You can just delete it from the queue and send it again later.

Syntax: postsuper [options]Options:-d queue_id Deletes one message with the named queue ID (you can also specifyALL as the queue_id to erase all messages in the queue)-h queue_id Puts the specific message defined by queue_id “on hold”-H queue_id Releases the message that was put “on hold”-r queue_id Requeues a message-s Performs a structure check of directories-v Provides verbose logging

About iGURKUL

IGURKUL I.T. Training Hub offering various Career Certification courses in Computer Networking, Unix, Linux, Cloud Computing and DevOps Technologies. With its rich experience in IT training service sector, iGURKUL has been able to set Industry best practices in IT Training for the past five years.

In Past five years, more than 5000 professionals have been trained by iGURKUL for System administration, Cloud Computing and DevOps Skill set through our Online Training portal www.unixadminschool.com. And , each day , more than 10000 working professionals from all over the globe visiting our knowledge base www.unixadminschool.com/blog for the best practices and Knowledge learning.