EXIM   

Install Exim from source

Install requirements
#yum install gcc -y
#yum install db4-devel -y 

Create user 

[root@vps exim-4.69]# vim /etc/passwd
Add the entry
exim:x:93:93::/var/spool/exim:/sbin/nologin 

[root@vps exim-4.69]# cat /etc/passwd|grep exim (you see the added entry)
exim:x:93:93::/var/spool/exim:/sbin/nologin
  
Then in /etc/group, add :
 exim:x:93:

[root@vps exim-4.69]# id exim uid=93(exim) gid=93(exim) groups=93(exim),10(mail)

Then execute the following commands to create your mail log and mail storage storage (MSA)

#mkdir -p /var/spool/mail 
#mkdir -p /var/log/exim 
#chown exim:exim /var/spool/mail 
#chown exim:adm /var/log/exim 
#chmod 1777 /var/spool/mail
#chmod 2750 /var/log/exim


Download and install Exim

#cd /usr/local/src
wget ftp://idcnetwork.org/pub/exim/exim/exim4/exim-4.69.tar.gz tar -zxvf exim-4.69.tar.gz
cd /usr/local/src/exim-4.69
sed -e 's,^BIN_DIR.*$,BIN_DIRECTORY=/usr/sbin,' \ -e 's,^CONF.*$,CONFIGURE_FILE=/etc/exim.conf,' \ -e 's,^EXIM_USER.*$,EXIM_USER=exim,' \ -e 's,^EXIM_MONITOR,#EXIM_MONITOR,' src/EDITME > Local/Makefile
make
make install 

Note: Though Exim have its own binaries to execute mail, I recommend to run the following.

#ln -s /usr/sbin/exim /usr/lib/sendmail 
#ln -s /usr/sbin/exim /usr/sbin/sendmail 
 
Creating a secure runtime configuration

All the functionality of Exim is controlled from /etc/exim.conf

Edit the new /etc/exim.conf and find the following entries:
 
primary_hostname = mail.example.com (mail domain) or hostname(localhost)
never_users = exim
host_lookup = * (reverse DNS lookup on all incoming IP calls, in order to get the true host name.)
# Set this the the name that appears after the @ in your email address
local_domains =
# Set this to localhost and the name that appears after the @
# in your email address separated by a colon.
# for example localhost:enterprise-hr.com for Patrick.
host_accept_relay = 127.0.0.1:
# Add in the range used by machines on your LAN. If you #do not have a
# LAN or are unsure, don't edit this. Example: #for a LAN with IP
# Address range 192.168.0.0/24, you put #that in here:
# host_accept_relay = 127.0.0.1:192.168.0.0/24

Everything else in /etc/exim.conf should just work nicely.
  Starting Exim   killall sendmail /usr/sbin/exim -bd -q15m    Note:Use telnet to check whether exim runs in 25 port telnet localhost 25   Exim is now listening on port 25 for mail from the machine itself or from the address range you specified in /etc/exim.conf To Send Mail exim - v user1@localhost  Heloooo . Note:If you have configured properly you will see a Log message showing mail transfer completed. Check  # tail /var/log/exim/[exim_maillog,exim_rejectlog,exim_paniclog] for log details. # cat /var/spool/mail/user1 [To read the mail] Thank You.

 


Comments (2)

On 8 June 2013 at 23:17 , Anonymous said...

After searching www.google.com, I found this blog to install Exim. It helped me install Exim in 5 minutes - wonderful work!! Thansk Shiju for another great post

 
On 27 November 2013 at 08:32 , Anonymous said...

Good Write Up. Useful. Very happy to share with my Friends.

Thank you
ZAK