Firefox 16, a treat for developers http://t.co/cnd27CzT
Configuring Sendmail SMTP server on CentOS & Scientific Linux
Sendmail is the default SMTP (Simple mail transfer protocol) server installed on CentOS and although it can be slightly more complicated for beginners to learn than similar alternatives such as Postfix, it can be quite powerful and useful to learn. Sendmail by itself as the name suggests is a MTA (Mail transfer agent) which is useful for sending emails from your server to other servers. However in order to create a proper mail server you will also need a few other pieces of
software such as a MUA (Mail user agent) to connect to the MTA and a POP3/IMAP (Post office protocol / Internet message access protocol) server to listen for incoming emails. These will all be covered in later tutorials, but in this tutorial we will just cover some of the basics of Sendmail to help you become familiar with email servers.
This all might be a bit confusing to understand at first, but it’s actually quite straight forward once you get to know all of the terms. I have included some more information below which will help you to remember some of the terms and their role in a mail server.
MTA – Mail Transfer Agent – Sendmail, Postfix
MDA – Mail Delivery Agent – Procmail
MUA – Mail User Agent – Outlook, Thunderbird
SMTP – Simple Mail Transfer Protocol – Sendmail, Postfix
POP3 – Post Office Protocol 3 – Dovecot
IMAP – Internet Message Access Protocol – Dovecot
Sendmail can also be used exclusively for the use of scripts and programs that do not require an email back. One example of this is PHP, many web applications require Sendmail to be installed in order to send out Administrator emails containing password information.
I will begin by presuming that you have a domain name and that you know how to modify the DNS records for your domain name.
To check what version of Sendmail is installed you can enter the following command
rpm –qa sendmail
If you are not using the latest version of Sendmail you can update Sendmail by using yum
yum update sendmail
Next you should make sure that the sendmail service is running and that it loads on startup
service sendmail restart
chkconfig sendmail on
Next we will need to open up and modify the Sendmail config file located in /etc/mail/sendmail.mc and remove the line which limits Sendmail to work only from the local IP.
DAEMON_OPTIONS(`Port=smtp, Addr=127.0.0.1 Name=MTA’)dnl
Once you have saved the configurations restart Sendmail again.
service sendmail restart
You will also need to make sure that if you are using a firewall that you allow incoming and outgoing connections to port 25.
Next you will need to modify your DNS records so that you can use your domain name as an email address. First you will need to create a sub-domain under your domain name, for example mail.example.com then you will need to forward the MX records of mail.example.com to point to the IP address of your server. Modifying the records of your DNS server particularly if you are using an external hosting company may take 24 to 48 hours to propagate, so make sure that your settings are correct before you modify them.
3- Accepting incoming mail
You will also need to specify on your server which domains you would like to accept mail from. You can do this by editing the /etc/mail/local-host-names file and adding the domain names as well as the sub-domains that you wish to accept.
For example you can add the following lines to the file.
4- Testing Sendmail
Finally you can test out if Sendmail is working by either using the mail command or Sendmail itself. Sending emails from mail is much easier as it formats the email for you, but Sendmail will allow you to pipe a file into the email.
cat email.txt | sendmail email@example.com
5- Using your domain name
When you check your email the first thing you will notice is that your email came from your hostname not your domain name. If you want a quick fix to change this you can simply change your hostname to become your domain name either through the /etc/hosts file or by entering the following command.
You can also masquerade as another domain name through the sendmail.mc file. Adding the following lines to your sendmail.mc file will allow all your emails to appear as though they are coming from the domain name example.com.
6- Forwarding emails
Sendmail also has the ability to forward emails to multiple addresses; you can do this by editing the alias file located at /etc/aliases. The aliases file allows you to forward emails to local accounts or other emails. This is especially useful for people who want to create a simple mailing list or create email groups.
For example if you have a set of users to answer support emails you could add the following line to /etc/aliases to allow them all to receive supports emails.
support: bob, henry, john, firstname.lastname@example.org
7- Setting relay access
By default only the localhost is setup to be able to relay emails to other servers. You can give relay access to users by specifying the servers you’d like them to connect to or the IP that they are connecting from.
To modify the relay access open the /etc/mail/access file
You can relay or reject domain names by adding the lines below
You can also specify IP addresses of hosts you would like to relay or reject
That is all.
Like us on Facebook
This week Top Posts
- Top Things to do After Installing Ubuntu 13.04 ‘Raring Ringtail’ : Ubuntu 13.04 Raring Ringtail final is almost out. The final release it scheduled for release on Apri...0 comment(s) |
- Install lamp with 1 command in Ubuntu 12.10, 13.04 Raring Ringtail & LinuxMint13 : Updated: 10/09/2012 :LAMP (Linux, Apache, MySQL and PHP) is an open source Web development platform ...0 comment(s) |
- Howto: Upgrade to Ubuntu 13.04 Raring Ringtail from 12.04, 12,10 | Desktop & Server : Updated 05-04-2013: Ubuntu 13.04 Raring Ringtail will be released Soon, If you have ubuntu 12,10, 12...0 comment(s) |
- Install and Configure Samba share in Ubuntu 13.04 Raring Ringtail , 12.10, 12.04| Howto : Updated 05-04-2013: One of the most asked features for Samba is a graphical user interface to help w...0 comment(s) |
- How to use Remote Desktop in Ubuntu : Sometimes, we need to access our computer from other locations when we’re not at home and such. This...0 comment(s) |
- Configure conky-Lua in Ubuntu (12.10 & 13.04 Raring Ringtail), Fedora, debian and LinuxMint | Howto Conky : Updated 05-04-2013: Conky is a free, light-weight system monitor for X, that displays any informatio...0 comment(s) |
- Setup Backup server using rsnapshot on RHEL / CentOS / Ubuntu / Debian
- How to disable/change default PDF viewer in Mozilla Firefox
- Dictionaries in Python
- How to Install uTorrent Client on Ubuntu/Debian/Linux Mint
- Lists in Python
- Argument Handling in Python
- Setup your own Wikipedia like website using MediaWiki
- Administer your Server using Ajenti Server Manager
- “Brand New” Unixmen Forum is Now Live!
- How To: Disable or Enable Guest Account in Ubuntu 13.04
Copyright © 2008-2013 Unixmen.com .