SEND MAIL (LINUX ENTERPRISE MAIL SERVER)
Mail Server:
MTA (Mail Transfer Agent). It has some certain duties to do.
i) Send mail on behalf of a designated domain.
ii) Receive mails by verifying proper account database.
iii) Relay/Allow all mails of trusted/authorized source.
iv) Discard/Block irrelevant emails and across.
v) Any MTA using two protocols SMTP (simple mail transfer protocol) for sending emails and POP (post office protocol) receiving emails. For receiving emails IMAP is also getting used.
Note:
1) In case of pop3 once the email has been fetched it will be flushed out from server
2) In case of IMAP one copy will always be on server and not removed but for this purpose we need heavy storage on server.
Linux/Unix Email Server:
There are several email servers used in Linux/Unix families. Some of those are
i) Sendmail (Freeware) http://sendmail. org
ii) Qmail (Freeware) http://lifewithqmai l.org
iii) Postfix
Sendmail Configuration:
Following packages must be installed
Packages: sendmail sendmail-cf
Configuration File: /etc/mail/sendmail.cf
/etc/mail/sendmail.mc
Other Config Files: /etc/mail/local- host-names
/etc/mail/access
/etc/aliases
/var/spool/mail
/var/spool/mqueue
Following services takes part in this process so should be up
Services: sendmail
Download and install required packages and lets move for further configuration.
Configuration:
In configuration file find the following parameters and change those to your own ones.
# vi /etc/mail/sendmail.mc
Find the following line in this file and comment it out. For commenting out any line in sendmail.mc put “dnl” in start of that.
# dnl # DAEMON_OPTIONS( `Port=smtp, Addr=127. 0.0.1, Name=MTA')dnl
Now save and exit
# :wq!
To update this change in configuration file we use m4 utility.
# m4 /etc/mail/sendmail.mc /etc/mail/sendmail.cf
Now edit local-host-names file and put your default domain name for which you setting up sendmail to receive emails.
# vi /etc/mail/loca- host-names
Put your domain address there then save and exit
Now edit your access file to relay trusted domains and your networks.
# vi /etc/mail/access
Here is just an example of this file
redhat.com RELAY (for relaying a domain)
192.168.0 RELAY (for relaying a network)
10.0.0 REJECT (for rejecting a network)
yahoo.com REJECT (for rejecting a domain emails)
Ok now check your dns server that its pointing mx records towards this email server.
Installing POP3 Service:
Package imap-2001a
After installing this package enable IPOP3 service in xinetd. It’s a xinetd service after installing go to the xinetd folder located in /etc/exinet. d and edit ipop3 file change the parameter from
disable=yes to disable=no
Now start sendmail service and you are ready to go.
# service sendmail start
Test Mail:
Send a test mail to verify.
# mail recipient address –v
Subject: now press ctrl+d
Enter text here now press ctrl+d twice and your email is gone
Note:
You should be taking care of following things.
i) your hostname should be same as per you entered in local-host-names file
ii) your dns mx records should be point towards your newly configured mail server
iii) change hostnames in following files as per you entered in local-host-names
# /etc/sysconfig/ network
#/etc/hosts
No comments:
Post a Comment