Using Sendmail is Easy.
---This bit is optional
If you want to make technical changes to the sendmail.cf file you modify the sendmail.mc file then re-compile it using the m4 macro compiler, this is only needed if you want to add stuff like spamcop, masquerading etc.
You need to have the sendmail-cf RPM installed to use the M4 compiler, you can check what (sendmail) rpms you have installed with this command:
rpm -q -a | grep sendmail
get sendmail.cf from your redhat 8 disks or from rpmfind.net.
see
for details on M4
--------------
Set the ip address range of your LAN in /etc/mail/access
eg if your lan is 192.168.5.0/255.255.255.0 and domain is mydomain.com
add
192.168.5 RELAY
mydomain.com RELAY
Edit the sendmail.cf file /etc/mail/sendmail.cf and find the line
O DaemonPortOptions=Port=smtp,Addr=127.0.0.1, Name=MTA
insert a "#" at the beginning to comment it out, note if
you use the M4 macro compiler you can take out the loopback restriction by removing the macro defination before recompiling sendmail.cf, this way short circuits that process though.
If you want the mail for mydomain.com to be delivered to local users, add it to /etc/mail/local-host-names. Once a domain is listed in /etc/mail/local-host-names then you can use the virtualusrtable in /etc/mail to map email addresses to users or aliases.
The virtusrtable has the format:
joebloggs@mydomain.com joeb
where joebloggs@mydomain.com maps to user or alias joeb,
a line like
@mydomain.com joec
maps all mail not included in other mappings in the virtusrtable to joec .
if joec is in /etc/aliases like this:
joec: joec@aol.com, joed, joef
Then email to joec goes to joec@aol.com, local user joed and local user joef, if the alias line looked like this:
joec: joec, joec@aol.com
mail would go to a local user called joec (who has the same name as the alias) and to joec@aol.com
After modifying these settings you can do a service sendmail restart to apply changes, if you want to just update the virtusrtable settings or access settings, just go to /etc/mail dir and type "make" an ls -lrt will show you which .db files were recreated (last in the list). A newaliases command rebuilds the just aliases file.
If mail for mydomain.com is to beforwarded to an internal mailserver call internal.mydomain.com and not delivered to the localmachine, make sure mydomain.com is not in /etc/mail/local-host-names and add an entry in the /etc/mail/mailertable like this:
mydomain.com relay:internal.mydomain.com
don't forget to do a "make" from /etc/mail or a service sendmail restart after this.
you can test where mail is actually going to go by using the command
sendmail -bv username@mydomain.com sendmail will reply telling you if the mail is going to a local user, or being relayed on for example - a very useful debugging tool.
In summary:
If the domain is in local-host-names, mail is processed via the virtusrtable and aliases files.
If its not, then it is process via the mailertable etc.
the access file controls how mail is relayed.
Use the M4 macro compiler to create custom sendmail.cf files (advanced use)
If you have any questions about sendmail just ask, and I'll answer if I can.
Postfix in my opinion is not an entreprise mail mta, use of exmim or sendmail is by far the best choices (thats why most people use them)
regard
PEte