Mail forwarding between mail servers in different network segments

  

The topic requires a DNS server to act as a domain name resolution server for two mail servers. 1. Set up a DNS server to add 2 network cards to the DNS server and set IP addresses separately. . Set the primary DNS configuration file. vim /var/named/chroot/etc/named.conf options { directory "/var/named"; }; zone "hanfangzhou.com" { type master; file "hanfangzhou.com. Zone"; }; zone "laohu.com" { type master; file "laohu.com.zone"; }; Configure the zone file for 2 mail servers vim /var/named/chroot/var/named/hanfangzhou. Com.zone @ IN SOA @ root ( 42 ; serial (d. adams) 3H ; refresh 15M ; retry 1W ; expiry 1D ) ; minimum hanfangzhou.com. IN NS mail.hanfangzhou.com. mail IN A 192.168.18.48 hanfangzhou. Com. IN MX 10 mail.hanfangzhou.com. vim /var/named/chroot/var/named/laohu.com.z One

@ IN SOA @ root ( 42 ; serial (d. adams) 3H ; refresh 15M ; retry 1W ; expiry 1D ) ; minimum laoyu.com. IN NS mail.laohu.com. mail IN A 10.1 .1.2 laoyu.com. IN MX 10 mail.laohu.com. Restart DNS service service named restart Enable NIC forwarding vim /etc/sysctl.conf net.ipv4.ip_forward = 1 MAIL server 1 (mail.hanfangzhou.com) settings Stop the sendmail service to turn off the boot add-on service sendmail stop chkconfig sendmail off install postfix yum install postfix -y modify the configuration file vim /etc/postfix/main.cf 69 myhostname = mail.hanfangzhou.com 77 mydomain = hanfangzhou.com 93 myorigin = $ Mydomain 107 inet_interfaces = all 155 mydestinatio n = $myhostname, localhost.$mydomain, localhost 255 mynetworks = 192.168.18.0/24, 127.0.0.0/8 287 relay_domains = hanfangzhou.com Save Exit Set SMTP Authentication Profile vim /etc/sysconfig/saslauthd MECH=shadow Save Exit Service saslauthd restart Check if the firewall and SElinux are closed. Verify the user chaoyue [root@hanfangzhou ~]# useradd chaoyue [root@hanfangzhou ~]# passwd chaoyue Changing password for user chaoyue. New UNIX password: BAD PASSWORD: it is WAY too short Retype new UNIX password: passwd: all authentication tokens updated successfully [root @ hanfangzhou ~] # testsaslauthd -u chaoyue -p '123' 0: OK " Success " configuration postfix service associated with smtp vim /etc /postfix /main.. .cf smtpd_sasl_auth_enable = yes smtpd_sasl_local_domain = '' smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination broken_sasl_auth_clients = yes smtpd_client_restrictions = permit_sasl_authenticated smtpd_sasl_security_options = noanonymou s save exit service postfix restart chkconfig postfix on verify perl -MMIME::Base64 -e 'print encode_base64(chaoyue);' Y2hhb3l1ZQ== perl -MMIME::Base64 -e 'print encode_base64(123);' MTIz [root@hanfangzhou ~] # telnet mail.hanfangzhou.com 25 Trying 192.168.18.48 ... Connected to mail.hanfangzhou.com (192.168.18.48). Escape character is '^]'. 220 mail.hanfangzhou.com ESMTP Postfix auth login 334 VXNlcm5hbWU6 Y2hhb3l1ZQ == 334 UGFzc3dvcmQ6 MTIz 235 2.0.0 Authentication successful installation dovecot service yum install dovecot -y modify the configuration file vim /etc/dovecot.conf protocols = pop3 pop3s

protocol pop3 {listen = *: 10100 #. } service dovecot restart chkconfig dovecot on install cyrus yum install cyrus-imapd cyrus-imapd-devel -y modify postfix main configuration file vim /etc/postfix/main.cf modify 456 lines to remove the comment character mailbox_transport = lmtp:unix:/var /lib/imap/socket/lmtp service cyrus-imapd restart chkconfig cyrus-imapd on modify the cyrus password and create chaoyue User mailbox [root@hanfangzhou ~]# passwd cyrus Changing password for user cyrus. New UNIX password: BAD PASSWORD: it is WAY too short Retype new UNIX password: passwd: all authentication tokens updated successfully. [root@hanfangzhou ~]# cyradm -u cyrus localhost IMAP Password: localhost.localdomain & gt; cm user.chaoyue localhost.localdomain & gt; cm user.chaoyue.Send localhost.localdomain & gt; cm user.chaoyue.Trash localhost.localdomain & gt; cm user.chaoyue.Drafts mounted webmail squirrelmail yum install Squirrelmail -y Set wenmail /usr/share/squirrelmail/config/conf.pl Restart HTTPD service Same as setting up MAIL server 2 (mail.laohu.com) Test

Copyright © Windows knowledge All Rights Reserved