Below are the pre-requisite for the sendmail configuration.
1. The server-ip and the FQDN Name of the mail server.
2. The mail server should be reachable through the SMTP port number 25.
3. Ensure that the server-ip has been allowed to send and recieve mail from mail relay server or mail server .
Sendmail configuration:
1. Edit the /etc/sendmail.cf file and check for "DS" entry and add the FQDN name of the mail server infront of this.
2. Add the entry of mail server in /etc/hosts file
3.stop the sendmail services and again start the sendmail services
#stopsrc -s sendmail
#startsrc -s sendmail
4. Verify that the you are able to send mail using the below command.
#echo "test"|mailx -v abc123@gmail.com
WARNING: local host name (test_boot) is not qualified; see cf/README: WHO AM I?abc123@gmail.com... Connecting to mail.abc.com . via relay...
220 abc.com ESMTP
>>> EHLO test_boot
250-abc.com
250-PIPELINING
250-SIZE 10485760
250 8BITMIME
>>> MAIL From:<aks@test_boot> SIZE=28
250 ok
>>> RCPT To:<abc123@gmail.com
>>> DATA
250 ok
354 go ahead punk, make my day
>>> .
250 ok 1412847209 qp 31504 by mail.abc.com
abc123@gmail.com... Sent (ok 1412846609 qp 3188 by abc.com)
Closing connection to mail.abc.com.
>>> QUIT
221 abc.com Goodbye.
Common Errors
If you are getting the error 554 --Mail rejected.
1..Check the mail queue of the server using command #mailq of the server , if the sent mssg is not present in it. means there is no issues with the server configuration the issue seems that the mail server is rejecting the mail .
2. Check with the mail team whether the ip is allowed to send mail.
1. The server-ip and the FQDN Name of the mail server.
2. The mail server should be reachable through the SMTP port number 25.
3. Ensure that the server-ip has been allowed to send and recieve mail from mail relay server or mail server .
Sendmail configuration:
1. Edit the /etc/sendmail.cf file and check for "DS" entry and add the FQDN name of the mail server infront of this.
2. Add the entry of mail server in /etc/hosts file
3.stop the sendmail services and again start the sendmail services
#stopsrc -s sendmail
#startsrc -s sendmail
4. Verify that the you are able to send mail using the below command.
#echo "test"|mailx -v abc123@gmail.com
WARNING: local host name (test_boot) is not qualified; see cf/README: WHO AM I?abc123@gmail.com... Connecting to mail.abc.com . via relay...
220 abc.com ESMTP
>>> EHLO test_boot
250-abc.com
250-PIPELINING
250-SIZE 10485760
250 8BITMIME
>>> MAIL From:<aks@test_boot> SIZE=28
250 ok
>>> RCPT To:<abc123@gmail.com
>>> DATA
250 ok
354 go ahead punk, make my day
>>> .
250 ok 1412847209 qp 31504 by mail.abc.com
abc123@gmail.com... Sent (ok 1412846609 qp 3188 by abc.com)
Closing connection to mail.abc.com.
>>> QUIT
221 abc.com Goodbye.
Common Errors
If you are getting the error 554 --Mail rejected.
1..Check the mail queue of the server using command #mailq of the server , if the sent mssg is not present in it. means there is no issues with the server configuration the issue seems that the mail server is rejecting the mail .
2. Check with the mail team whether the ip is allowed to send mail.