Answer: Here your Local LAN means your domain named example.com.
1.vi /etc/mail/local-host-names
example.com
2.vi /etc/mail/sendmail.mc
dnl # DEAMON_OPTIONS(`Port=smtp,Addr=127.0.0.1,Name=MTA`)dnl
3.m4 /etc/mail/sendmail.mc >/etc/mail/sendmail.cf
4.vi /etc/mail/access
192.168.0RELAY
5.service sendmail start | restart
6.chkconfig sendmail on
/etc/mail/local-host-names file contains the aliases to hostname. Mail server program reads the /etc/mail/sendmail.cf. To change the configuration on mail server, we should edit the /etc/mail/sendmail.mc file and should generate the sendmail.cf using m4 command.
By default sendmail server allows to connect to local host only. So we should edit the /etc/mail/sendmail.mc file to allow connect to other hosts.
By default sendmail server will not forward mail. we should specify on /etc/mail/access to relay or to block mail coming from domain or network or individual email address.
7.vi /etc/aliases
john:jane
8.newaliases
We can redirect the mail of one user to another user using /etc/aliases file. In example all mail of john goes to jane user.
Submit