Send Receive Email from CentOS Client Computer
Send And Receive Email from Domain Join CentOS Linux 7 Client Computer By Use of Postfix Server
In this Scenario we will send email from OpenLDAP Domain Join CentOS Linux 7 client computer and check receive email from Postfix Server by use of SSH.
To check the Host name and hosts file of CentOS Linux 7 client computer "ldapdnsclient" type the commands mention below.
To check the IP configuration of CentOS Linux 7 client computer "ldapdnsclient" type the command mention below.
To check the nameserver entry in "resolv.conf" file that available in "/etc/resolv.conf" directory type the below command, you must add your nameserver entry by use of "vi" editor.
In the above image first nameserver is OpenLDAP and DNS Server IP address and Second nameserver is the router IP address.
Authenticate CentOS Linux 7 client machine from OpenLDAP Server click on >>Read.
Add Host and PTR record of CentOS Linux 7 client computer "ldapdnsclient" go to OpenLDAP and DNS Server.
OpenLDAP and DNS Server "LDAP-DNS":
Installation and Configuration of DNS Server For OpenLDAP Server on CentOS 7 click on >>Read.
To enter in the directory of forward and reverse lookup zone file use cd command and list files and folders by use of ls command inside the directory. The both commands are mention below.
To edit the host entry of CentOS Linux 7 client computer "ldapdnsclient" in forward lookup zone file that is pakistan.local.forward type the command mention below.
Add the below mention lines in pakistan.local.forward file.
$TTL 86400@ IN SOA ldap-dns.pakistan.local. root.pakistan.local. (2011071002 ;Serial3600 ;Refresh1800 ;Retry604800 ;Expire86400 ;Minimum TTL)@ IN NS ldap-dns.pakistan.local.@ IN A 192.168.10.215ldap-dns IN A 192.168.10.215linux2 IN A 192.168.10.216linux2.pakistan.local IN A 192.168.10.216ldapdnsclient IN A 192.168.10.218ldapdnsclient.pakistan.local IN A 192.168.10.218;Specify MX RecordIN MX 10 linux2.pakistan.local.pakistan.local. IN MX 10 192.168.10.216
To edit the PTR record of CentOS Linux 7 client machine "ldapdnsclient" in reverse lookup zone file that is pakistan.local.reverse type the command mention below.
Add the below mention lines in pakistan.local.reverse file.
$TTL 86400@ IN SOA ldap-dns.pakistan.local. root.pakistan.local. (2011071002 ;Serial3600 ;Refresh1800 ;Retry604800 ;Expire86400 ;Minimum TTL)@ IN NS ldap-dns.pakistan.local.ldap-dns IN A 192.168.10.215215 IN PTR ldap-dns.pakistan.local.216 IN PTR linux2.pakistan.local.218 IN PTR ldapdnsclient.pakistan.local.
Use rndc reload command for proper resolve Host entries.
After edit the Host and PTR record of CentOS Linux 7 client machine "ldapdnsclient" in forward and reverse lookup zone files respectively, Check the CentOS Linux 7 client machine "ldapdnsclient" resolve DNS Server Host Name and itself by use of nslookup command.
To use nslookup command first install "bind-utils" package. To Install "bind-utils" package type the command mention below.
yum install bind-utils
The "bind-utils" package has successfully installed.
Check DNS Server is resolving from CentOS Linux 7 client Machine "ldapdnsclient" type the command mention below.
Check CentOS Linux 7 client Machine "ldapdnsclient" is resolve its Full Qualified Domain Name "FQDN" type the command mention below.
Send Email from OpenLDAP user "user1" to OpenLDAP user "user2" with domain name "pakistan.local".
To send email user1 to user2 type the below command. In email give subject and message then press dot "." for send email.
mail -v firstname.lastname@example.org
To check email in user2 mailbox, ssh the Postfix Server "Linux2" and type mail command to check email.
In above image the email that user1 has send to user2 is number 17, type number 17 then press enter to check email and for reply type r give message then type dot "." to send the message. For Quit Heirloom mailx type q then press enter.
To check the reply message that user2 reply to user1, first switch to user1 in Postfix Server "Linux2" then type mail command to check email.
su - user1
In above image the email user2 reply to user1 its number is 14, to check email type 14 then press enter.
In above image you can see that reply message has received.
Thanks for read this Article