Sendmail is a general purpose internetworking email routing facility that supports many kinds of mail-transfer and delivery methods, including the Simple Mail Transfer Protocol (SMTP) used for email transport over the internet.
Install Sendmail
Sendmail requires 3 packages to work; sendmail, sendmail-cf and m4.
There are 3 ways to install sendmail:
1) Installing through Yum
2) Install RPM packages
3) Build from source
Yum (Yellowdog Updater Modified)
Install through Yum is simple. Just execute the following command to install.
_________________________________________________
~]#Yum install sendmail sendmail-cf m4
_________________________________________________
RPM Package Manager
Installing through RPM Package manager requires a bit more work. Normally we will install from the CD/DVD-ROM provided. If in any case a CD/DVD-ROM is not available, we might have to download the rpm file from online source.
a. Navigate to the source, which most like be the CD/DVD-ROM. The source CD/DVD-ROM have to be inserted first
____________________________________________
~]# cd / media/RHEL_5.3\ x86_64\ DVD/Server
____________________________________________
b. Install the rpm
_____________________________________________
~]# rpm –ivh sendmail*
~]# rpm –ivh m4*
_____________________________________________
Install from source
a.Download the source
_________________________________________________
~]# wget ftp://ftp.sendmail.org/pub/sendmail/sendmail.8.14.4.tar.gz
_________________________________________________
b.Unzip the source
____________________________________
~]# tar –zxv sendmail.8.14.4.tar.gz
____________________________________
c. Compile the source
____________________________
~]# cd sendmail.8.14.4
# ./Build
# ./Build install
____________________________
Configure Sendmail
Sendmail is a very huge topic to cover. Yet in this document we will be covering on a simple installating to get sendmail working and the methods to test and troubleshooting sendmail should problem arises.
Dovecot is used in this document to IMAP and POP access to the clients. In this document we will also be covering how clients from both Linux and Windows platform are able to access the mail server.
Ensure DNS is configured properly for Mail Exchange
1.Make sure the fully qualified domain name (fqdn) of the mail server host can be resolved.
________________________________________
~]# host mail.ca.com
mail.ca.com is an alias for svr1.ca.com.
svr1.ca.com has address 192.168.205.10
________________________________________
2. Ensure that the MX record in the DNS zone file is pointed correctly to the IP address of the mail server.
_________________________________________________________________________________
~]# cat /var/named/ca.com.zone
;
; Zone file for my-site.com
;
; The full zone file
;
$TTL 3D
@ IN SOA ns1.ca.com. hostmaster.ca.com. (
200211152 ; serial#
3600 ; refresh, seconds
3600 ; retry, seconds
3600 ; expire, seconds
3600 ) ; minimum, seconds
IN NS ns1.ca.com. ; Inet Address of nameserver
IN MX 10 mail.ca.com. ; Primary Mail Exchanger
svr1 IN A 192.168.205.10
mail IN CNAME svr1
____________________________________________________________________
Configure sendmail.mc
1.Ensure that sendmail is listening to the correct network
a.Using netstat to determine to network that the server is listening to
Correct result:
______________________________________
~]# netstat -an grep :25 grep tcp
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN
______________________________________
Incorrect result:
_______________________________________
~]# netstat -an grep :25 grep tcp
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN
_______________________________________
b. If the server is only listening to localhost, make the following changes by commenting the daemon_options line in sendmail.mc. To comment, just add dnl in front of the line.
~]# vi /etc/mail/sendmail.mc
_______________________________________________________________
dnl # The following causes sendmail to only listen on the IPv4 loopback address
dnl # 127.0.0.1 and not on any other network devices. Remove the loopback
dnl # address restriction to accept email from the internet or intranet.
dnl #
dnl DAEMON_OPTIONS(`Port=smtp, Name=MTA')
_________________________________________________________
2. Comment out SMART_HOST entry, which is only required for client.
________________________________________
dnl define(`SMART_HOST',`mail.ca.com')
3. Regenerate sendmail.cf and start sendmail
_____________________________________________________
~]# m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
~]# service sendmail restart
_____________________________________________________
Configure DoveCot for POP access
1. Install dovecot if required
~]# rpm –ivh dovecot*
2.Ensure dovecot is configured for pop3
______________________________________________________________________
~]# vi /etc/dovecot.conf
# Protocols we want to be serving: imap imaps pop3 pop3s
# If you only want to use dovecot-auth, you can set this to "none".
protocols = imap imaps pop3 pop3s
3. Start dovecot
_______________________________________________
~]#service dovecot start
_______________________________________________
4. Ensure dove
______________________________________
~]# netstat -a egrep -i 'popimap'
tcp 0 0 *:imaps *:* LISTEN
tcp 0 0 *:pop3s *:* LISTEN
tcp 0 0 *:pop3 *:* LISTEN
tcp 0 0 *:imap *:* LISTEN
_______________________________________
Configure Linux Sendmail Client
1. Install Sendmail onto the client and ensure DNS is working properly
a) Refer to "Install Sendmail" section for installation
b) Ensure that FQDN of the mail server can be resolved.
________________________________________
~]# nslookup mail.ca.com
Server: 192.168.205.10
Address: 192.168.205.10#53
mail.ca.com canonical name = svr1.ca.com.
Name: svr1.ca.com
Address: 192.168.205.10
_____________________________________________________________
2.Configure sendmail.mc. Ensure that the option below is configured properly by pointing it to the FQDN of the mail server.
__________________________________________
~]# vi /etc/mail/sendmail.mc
3. Regenerate sendmail.cf and start sendmail
____________________________________________________
~]# m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
~]# service sendmail restart
_____________________________________________________
Configure Windows Client (Microsoft Outlook 2007)
1) Start MS Outlook 2007. Cancel wizard if promted.
2) Setup the account.
a) Go to Account setting
b. Add new account
c. Check “Manually configure server settings or additional server type” and click next
d. Select “Internet E-mail” for E-mail service and click next
e.Enter the following information for E-mail settings:
i.User Information:
•Your Name: student
•E-mail Address: student@ca.com
ii.Server Information
•Account Type: POP3
•Incoming mail server: 192.168.205.10
•Outgoing mail server: mail.ca.com
iii.Login Information
•Username: student
•Password: *omitted*
f.Click on Test Account Setting to test the connectivity of the service. Click next once everything is configured properly.
No comments:
Post a Comment