How to configure Mail Server in Redhat Linux

An email message is created using a mail client program. Mail is digital messaging service and which generally consists of a message body.

=> These are the most commonly used in the transfer of email

Simple Mail Transport Protocols (SMTP-Port 25) delivery from a client application to the server, and from an originating server to the destination server, is handled by the Simple Mail Transfer Protocol (SMTP).

=> Mail Access Protocols

POP (Post Office Protocol): -( Port 110 ) It is an email accessing protocol used to receive mails from a mail server and  POP  will download all emails from the server to the user’s computer.

IMAP (Internet Message Access Protocol):- ( Port 143 ) It is another email accessing protocol however it is used to access the mails from the server.IMAP will synchronize a copy of the mail on the server to the user’s computer. All mail data is kept on the server as well as the user’s computer until they delete mail. 

=> Install postfix package

=> #yum install postfix* -y

=> #systemctl restart postfix.service

=> Check the postfix service status

=> #systemctl status postfix.service

=> Check Hostname

=> #hostname 

=> Now change the hostname

=> #vi /etc/hosts

=> Save and exit.

=> Now Update the postfix configurations file

=> #vi /etc/postfix/main.cf

=> If you are not able to see the line number then type -

=> :se nu



=> Go to Line Number 75 in RHEL 7 and Line Number 94 in RHEL 8, uncomment line. 

=> Then add your system hostname

=> Go to Line Number 83 in Redaht 7 and Line Number 102 in Redhat 8, uncomment mydomain.

=> Then add your system Domain name

=> Go to Line Number 98 in RHEL 7 and Line Number 117 in RHEL 8, uncomment line (myorigin).


=> Go to Line Number 113 in RHEL 7 and Line Number 132 in RHEL 8, uncomment line (inet_interfaces).

=> Go to Line Number 264 in RHEL 7 and Line Number 283 in RHEL 8, uncomment line (mynetworks).

=> Assign network ip

=> Go to Line Number 426 in RHEL 7 and Line Number 445 in RHEL 8, uncomment line (mail_spool_directory).
Then save and exit.
=> Add smtp service in firewall
=> #firewall-cmd --permanent --add-service=smtp
=> #firewall-cmd --reload
=> Enble the post fix service
=> #systemctl enable postfix
=> #systemctl restart postfix
=> Now send a mail to user

=> For send mail press dot (.) and then enter it will automatically exit.
=> For check mail delivered or it is in que.
=> #mailq
=> Go to "user1" and check mail received or not
=> #mail

=> For see the mail press one (1) and then enter.

Thank You....




Comments

Popular posts from this blog

interview Questions on User Management in Linux

Kernel and Module Interview Questions