SMTP/POSTFIX
MTA – Mail Transfer Agent MDA – Mail Delivery Agent MUA – Mail User Agent MRA – Mail Retrieval Agent MAA- Mail Access Agent Internet DNS Chk MX Record MTA <XYZ.com> MDA MTA <ABC.com> MRA/MAA POP3/IMAP /var/spool/mail MUA (Ex: Outlook) MUA (Ex: Outlook) user1@abc.com user2@xyz.com
Steps: TCP port used by postfix – TCP 25 Yum remove <sendmail> Package Name – Postfix Script file - /etc/init.d/postfix /etc/init.d/postfix <start> /etc/init.d/postfix <stop> /etc/init.d/postfix <restart> /etc/init.d/postfix <status> Or Service postfix <start> <stop> <restart> Chkconfig postfix on (for run-level 3,5) Configuratin File /etc/postfix/master.cf /etc/postfix/main.cf To install Yum install –y <postfix>
Update configuration file: Vi /etc/postfix/main.cf ## Line no 75 - Uncomment and set your mail server FQDN ## myhostname = server.unixmen.local ## Line 83 - Uncomment and Set domain name ## mydomain = unixmen.local ## Line 99 - Uncomment ## myorigin = $mydomain ## Line 116 - Set ipv4 ## inet_interfaces = all ## Line 119 - Change to all ## inet_protocols = all ## Line 164 - Comment ## #mydestination = $myhostname, localhost.$mydomain, localhost, ## Line 165 - Uncomment ##\ mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain ## Line 264 - Uncomment and add IP range ## mynetworks = 192.168.1.0/24, 127.0.0.0/8 ## Line 419 - Uncomment ## home_mailbox = Maildir/ And… Restart the postfix mail service /etc/init.d/postfix restart
Test the mail: Create new user ID – student useradd –d /home/student –c “student ID” –m student As a root user, send test email to student ID <student> $ su – root #
Login as a <student> & check the mail:
Send mail with Attachment: (MUTT) Yum install -y <mutt> mail -s "test mail with attachment" user2@example.com < /home/user1/atachment.txt To send mail with attachment: # mutt mail student@node3.example.com
To read the mail with attachment Login as student, they type <mutt>
Configure to send emails to relay server: # vi /etc/postfix/main.cf