sendmail
First, let me say that this will not be any sort of comprehensive sendmail page. Go to http://www.sendmail.org for more information. Red Hat users just have to edit a few configs and they are basically done.
I am basing this on a "clean" install of RedHat 5.2. You could add it to an existing box as well. It will allow a standard smtp and pop3 configuration. I will not deal with pop2 or imap (even though you have to install the imap rpm file for pop services).
Now, you need to get sendmail and imap on the machine.
cd /mnt/cdrom/RedHat/RPMS/
rpm -i imap*
rpm -i sendmail*
Now you have all of the files you need. Just a bit of editing and you are on your way.
The first file to work with is /etc/inetd.conf. This file controls tcp wrappers and is explained fully here.
Edit the pop3 entry to look like this:
pop-3 stream tcp nowait root /usr/sbin/tcpd ipop3d
SMTP is handled through the sendmail daemon, not tcpd or smtpd.
Now, to restart tcpd type in
killall -HUP inetd
So, here we are. We have everything we need. Time for configuration, eh?
Ok, the first file to change is /etc/sendmail.cw. This file should contain a list of domains you support, like this:
www.foo.com
mail.foo.com
smtp.foo.com
The next file is the main configuration file for sendmail. /etc/sendmail.cf
Below are all of the relevant changes. Few are required - the .cf file is
almost ready to roll out of the box.
Substitute "foo.com" with
your machine.
# my official domain name
# ... define this only if sendmail cannot automatically determine your domain
#Dj$w.Foo.com.
# class E: names that should be exposed as from this host, even if we masquerade
# class L: names that should be delivered locally, even if we have a relay
# class M: domains that should be converted to $M
#CL root
CE root
CM myhost.foo.com
# who I masquerade as (null for no masquerading) (see also $=M)
DMfoo.com
# timeouts (many of these)
#O Timeout.initial=5m
#O Timeout.connect=5m
#O Timeout.iconnect=5m
#O Timeout.helo=5m
#O Timeout.mail=10m
#O Timeout.rcpt=1h
#O Timeout.datainit=5m
#O Timeout.datablock=1h
#O Timeout.datafinal=1h
#O Timeout.rset=5m
#O Timeout.quit=2m
#O Timeout.misc=2m
#O Timeout.command=1h
#O Timeout.ident=30s
#O Timeout.fileopen=60s
O Timeout.queuereturn=5d
#O Timeout.queuereturn.normal=5d
#O Timeout.queuereturn.urgent=2d
#O Timeout.queuereturn.non-urgent=7d
O Timeout.queuewarn=4h
#O Timeout.queuewarn.normal=4h
#O Timeout.queuewarn.urgent=1h
#O Timeout.queuewarn.non-urgent=12h
#O Timeout.hoststatus=30m
# should we not prune routes in route-addr syntax addresses?
#O DontPruneRoutes
# queue up everything before forking?
O SuperSafe=True
OK! With that said and done, you just need to fix these files:
This section is important, because the latest versions of sendmail disable relaying of mail via smtp by default. If you need to relay from different domains, you will have to edit these files! The basic format for the files is like this. Say you have the 192.168.10.0/24 network. To allow connections from all of your hosts, edit ip_allow to read "192.168.10.". Note the period at the end.Same format for name_allow if you need it. ".foo.com or foo.com" will suffice.
The final step is to either start sendmail or reboot. To start it, type in
/etc/rc.d/init.d/sendmail start
Now give it a test with a pop3 and smtp client. Eudora or Netscape are good ones to use.