Sunday, December 25, 2011

Setup and Configure Sendmail Server

Hello Everyone,
After verifying connectivity, DNS, and telnet to smtp, it is right time to configure your Sendmail server. To enable masquerading and binding your domain for sendmail, you should change the sendmail configuration file which is located in /etc/mail/ Open this file with vi and change the following lines:
LOCAL_DOMAIN(`localhost.localdomain')dnl     to     LOCAL_DOMAIN(
dnl MASQUERADE_AS(`')dnl      to   MASQUERADE_AS(
dnl FEATURE(masquerade_envelope)dnl            to   FEATURE(masquerade_envelope)dnl
dnl FEATURE(masquerade_entire_domain)   to FEATURE(masquerade_entire_domain)dnl
dnl MASQUERADE_DOMAIN(localhost.localdomain)dnl   to MASQUERADE_DOMAIN(

Replace with your domain name.
Now, you should run the following command in order to take effect your change in configuration file. You should use m4 command like this:
m4 /etc/mail/ > /etc/mail/
Now, restart your sendmail with this command:    service sendmail restart
If everything is fine, you should able to send an email. Create a file and put some text on this file. Name this file to message_file. Run this command in order to send an email to your friend.

mail -v -s "Test from Khosro" < message_file

Change to your machine name and domain name. Use mail command to check the inbox and verify your email that you already sent it.  
Please leave your comments or questions. I will try to answer as soon as possible.
Khosro Taraghi

No comments:

Post a Comment