Uploaded by Isuru Subasinghe

Assignment 6

advertisement
ASSIGNMENT-6
System and Network Administration
MS 20914950
ISURU PRABATH SUBASINGHE
Prabath230@gmail.com
0716863995
MS 20914950
Assignment 4 – Install and configure Mail server.
1. Install Sendmail
If you don’t have installed Sendmail using the following command to install Sendmail with other required
packages using yum package manager.
sudo dnf install sendmail sendmail-cf
2. Configure Sendmail on Fedora
Sendmail configuration files exists in /etc/mail directory.
2.1 Comment out below line in /etc/mail/sendmail.mc to allow receiving email from anywhere. To comment a line
in sendmail.mc, just put dnl at start of line.
dnl # DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
2.2 Add this line also in sendmail.mc above ‘MAILER’ option
FEATURE(`relay_hosts_only')dnl
2.3 Add your PC’s full hostname in this file.
hostname >> /etc/mail/relay-domains
3. Recompile Configuration File
m4 ia a macro processor to compile the Sendmail configuration files. m4 is stream-based, that is, it doesn’t
understand about lines.
sudo m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
MS 20914950
Restart Sendmail service
sudo systemctl restart sendmail
4. Configure Domain-based E-mail Routing
As we read above that virtusertable file used for aliasing, allowing multiple virtual domains to be hosted on one
machine.
1. All emails addressed to @example.com domain delivered to support@mydomain.com
@example.com support@mydomain.com
2. All emails addressed to support@mydomain.com will forward to local user jack.
support@mydomain.com jack
3. All emails addressed to @mydomain.com will forward to domain @otherdomain.com with corresponding
usernames.
@mydomain.com %1@otherdomain.com
4. All emails addressed to @otherdomain.com will be rejected my mail server with acknowledging sender with the
message
@otherdomain.com
error:nouser User unknown
MS 20914950
After making all changes in virtusertable execute following command to create updated virtusertable.db file
containing the new configuration.
makemap hash /etc/mail/virtusertable < /etc/mail/virtusertable
Finally, restart the Sendmail service to apply changes
sudo systemctl restart sendmail
Download