1. Sendmail service software packageSendmail-8.13.8-2.el5.i386.rpm: the master package for the sendmail service, which must be installed on the server side. Sendmail-cf-8.13.8-2.el5.i386.rpm: sendmail macro file package sendmail-devel-8.13.8-2.el5.i386.rpm: sendmail server development tools package sendmail-doc-8.13.8-2.el5.i386.rpm: sendmail server instructions documentation m4-1.4.5-3.el5.1.i386.rpm: Macro processing considerations package dovecot-1.0-1.2.rc15.el5.i386.rpm: receive mail package, pay attention to the installation order when installingIi. Sendmail configuration documentsSendmail. cf: the Core configuration file of sendmail, which is located in/etc/mail/sendmail. cfsendmail. mc: sendmail provides a sendmail File template. After editing this file, use the m4 tool to import the result to sendmail. cf completes the configuration of the sendmail core configuration file to reduce the configuration complexity, located in/etc/mail/sendmail. mclocal-host-name: defines the domain name and host alias for the sending and receiving mail server, in/etc/mail/local-host-nameaccess.db: Used to set which hosts the sendmail server forwards mail, in/etc/mail/access. dbaliases. db: used to define the mailbox alias at/etc/mail/aliases. db1_usertable. db: used to set a virtual account in/etc/mail/login usertable. dbIii. Mail function componentsMUA: Mail User proxy Mail User Agent) MTA: Mail Transmission proxy Mail Transfer Agent) MDA: Mail Delivery proxy Mail Delivery Agent)4. General Sendmail server configurationProcedure for building a Sendmail server: 1) configure sendmail. mc file 2) use the m4 tool to send sendmail. import the mc file to sendmail. cf file 3) configure the local-host-names file 4) create a user account 5) restart the service to make the configuration take effectV. Case Analysis and ConfigurationCase topology:650) this. width = 650; "style =" border-bottom: 0px; border-left: 0px; border-top: 0px; border-right: 0px "title =" image "border =" 0 "alt =" image "src =" http://www.bkjia.com/uploads/allimg/131228/033923C61-0.png "height =" 324 "? 561? />Purpose:In the same CIDR Block, the mail server in different regions forwards and communicates with each other.Tutorial steps:1. Set up the DNS environment and System Environment[Root @ zhangc Server] # vim/etc/sysconfig/network Modify host name] 650) this. width = 650; "style =" border-bottom: 0px; border-left: 0px; border-top: 0px; border-right: 0px "title =" image "border =" 0 "alt =" image "src =" http://www.bkjia.com/uploads/allimg/131228/03392363L-1.png "Height =" 84 "? 366? /> [Root @ zhangc Server] # vim/etc/hosts: Change the hosts file to the default value.] 650) this. width = 650; "style =" border-bottom: 0px; border-left: 0px; border-top: 0px; border-right: 0px "title =" image "border =" 0 "alt =" image "src =" http://www.bkjia.com/uploads/allimg/131228/0339232T1-2.png "Height =" 119 "? 460? /> [Root @ zhangc Server] # yum install-y bind-9.3.6-4.P1.el5.i386.rpm bind-chroot-9.3.6-4.P1.el5.i386.rpm caching-nameserver-9.3.6-4.P1.el5.i386.rpm-nogpgcheck install dns Server corresponding 3 software] [root @ zhangc ~] # Cd/var/named/chroot/etc/[root @ zhangc etc] # cp-p named. caching-nameserver.conf named. conf [root @ zhangc etc] # vim named. conflisten-on port 53 {any ;}; allow-query-cache {any ;}; match-clients {any ;}; match-destinations {any ;};: wq [root @ mail etc] # vim named. rfc1912.zones650) this. width = 650; "style =" border-bottom: 0px; border-left: 0px; border-top: 0px; border-right: 0px "title =" image "border =" 0 "alt =" image "src =" http://www.bkjia.com/uploads/allimg/131228/033923E95-3.png "Height =" 110 "? 336? /> [Root @ zhangc etc] # cd .. /var/named/[root @ zhangc named] # cp-p localhost. zone 163.com. zone [root @ zhangc named] # vim 163.com. zone650) this. width = 650; "style =" border-bottom: 0px; border-left: 0px; border-top: 0px; border-right: 0px "title =" image "border =" 0 "alt =" image "src =" http://www.bkjia.com/uploads/allimg/131228/0339233314-4.png "Height =" 239 "? 562? /> [Root @ zhangc named] # service named restartStopping named: [OK] Starting named: [OK] [root @ zhangc named] # chkconfig named on [root @ zhangc named] # chkconfig -- list | grep named edit DNS server pointing to [root @ zhangc named] # vim/etc /resolv. conf650) this. width = 650; "style =" border-bottom: 0px; border-left: 0px; border-top: 0px; border-right: 0px "title =" image "border =" 0 "alt =" image "src =" http://www.bkjia.com/uploads/allimg/131228/03392362N-5.png "Height =" 59 "? 350? /> [Root @ zhangc named] # After the init 6 is restarted, the host name is changed to mail.Ii. install and configure the sendmail service[Root @ mail Server] # rpm-ivh sendmail-cf-8.13.8-2.el5.i386.rpm [root @ mail Server] # cd/etc/mail [root @ mail] # ll [root @ mail] # vim sendmail. mc650) this. width = 650; "style =" border-bottom: 0px; border-left: 0px; border-top: 0px; border-right: 0px "title =" image "border =" 0 "alt =" image "src =" http://www.bkjia.com/uploads/allimg/131228/0339233027-6.png "Height =" 45 "? 458? /> [Root @ mail] # vim access650) this. width = 650; "style =" border-bottom: 0px; border-left: 0px; border-top: 0px; border-right: 0px "title =" image "border =" 0 "alt =" image "src =" http://www.bkjia.com/uploads/allimg/131228/033923N24-7.png "Height =" 137 "? 421? /> [Root @ mail] # vim local-host-names650) this. width = 650; "style =" border-bottom: 0px; border-left: 0px; border-top: 0px; border-right: 0px "title =" image "border =" 0 "alt =" image "src =" http://www.bkjia.com/uploads/allimg/131228/03392334S-8.png "Height =" 104 "? 198? /> [Root @ mail] # service sendmail restartShutting down sm-client: [OK] Shutting down sendmail: [OK] Starting sendmail: [OK] Starting sm-client: [OK]3. Install dovecot on the server to receive emailsBelow do accept Server side: [root @ mail Server] # yum install dovecot-1.0.7-7.el5.i386.rpm [root @ mail Server] # vim/etc/dovecot. conf650) this. width = 650; "style =" border-bottom: 0px; border-left: 0px; border-top: 0px; border-right: 0px "title =" image "border =" 0 "alt =" image "src =" http://www.bkjia.com/uploads/allimg/131228/0339233342-9.png "height =" 49 "? 288? /> [Root @ mail Server] # service dovecot restartStopping Dovecot Imap: [OK] Starting Dovecot Imap: [OK] [root @ mail Server] # chkconfig dovecot on4. Create a test account:[Root @ mail Server] # useradd user1 [root @ mail Server] # passwd user1 [root @ mail Server] # useradd user2 [root @ mail Server] # passwd user25. Test domain name resolution on a remote host650) this. width = 650; "style =" border-bottom: 0px; border-left: 0px; border-top: 0px; border-right: 0px "title =" image "border =" 0 "alt =" image "src =" http://www.bkjia.com/uploads/allimg/131228/0339233U0-10.png "height =" 366 "? 562? /> 650) this. width = 650; "style =" border-bottom: 0px; border-left: 0px; border-top: 0px; border-right: 0px "title =" image "border =" 0 "alt =" image "src =" http://www.bkjia.com/uploads/allimg/131228/033923N91-11.png "height =" 350 "? 562? />6. Build a SINAmail ServerSet up the server according to 163.com. You only need to fill in the following file Host Name Information as sina to [root @ mail ~] # Vim/etc/sysconfig/network modify the host name file] [root @ mail ~] # Change vim/etc/hosts to the default value.] [root @ mail ~] # Cd/var/named/chroot/enter the Directory and configure it.] [root @ mail chroot] # cd etc/[root @ mail etc] # vim named. conf [root @ mail etc] # vim named. rfc1912.zones configuration region documentation] [root @ mail chroot] # cd var/named/[root @ mail named] # cp-p localhost. zone sina.com. zone [root @ mail named] # vim sina.com. zone [root @ mail named] # cd/etc/mail [root @ mail] # vim access [root @ mail] # vim sendmail. mc [root @ mail] # vim local-host-names create test account user5 and set the passwordVII. Build completePerform a test on the sina region 650) this. width = 650; "style =" border-bottom: 0px; border-left: 0px; border-top: 0px; border-right: 0px "title =" image "border =" 0 "alt =" image "src =" http://www.bkjia.com/uploads/allimg/131228/03392330T-12.png "height =" 365 "? 562? /> After the test is completed, both parties test the sender: 650) this. width = 650; "style =" border-bottom: 0px; border-left: 0px; border-top: 0px; border-right: 0px "title =" image "border =" 0 "alt =" image "src =" http://www.bkjia.com/uploads/allimg/131228/0339231524-13.png "height =" 394 "? 553? /> Receiver: 650) this. width = 650; "style =" border-bottom: 0px; border-left: 0px; border-top: 0px; border-right: 0px "title =" image "border =" 0 "alt =" image "src =" http://www.bkjia.com/uploads/allimg/131228/0339233000-14.png "height =" 303 "? 562? />8. Observe server logsSina. comJul 16 19:53:57 mail sendmail [3425]: q6GNru1H003425: from = <user5@sina.com>, size = 423, class = 0, nrcpts = 1, msgid = <002001cd8f49 $ ce36e0e0 $1564a8c0 @ YaphetS>, proto = SMTP, daemon = MTA, relay = [192.168.100.21] Jul 16 19:54:00 mail sendmail [3427]: pushed: to = <user1@163.com>, ctladdr = <user5@sina.com> (502/502), delay = 00:00:03, xdelay = 00:00:03, mailer = esmtp, pri = 120423, relay = mail.163.com. [192.168.100.123], dsn = 2.0.0, stat = Sent (Invalid Message accepted for delivery) 163.com server log: Jul 16 19:54:00 mail sendmail [12707]: q6GNrwbl012707: from = <user5@sina.com>, size = 581, class = 0, nrcpts = 1, msgid = <002001cd8f49 $ ce36e0e0 $1564a8c0 @ YaphetS>, proto = ESMTP, daemon = MTA, relay = [192.168.100.124] Jul 16 19:54:00 mail sendmail [12866]: q6GNrwbl012707: to = <user1@163.com>, delay = 00:00:00, xdelay = 00:00:00, mailer = local, pri = 30749, dsn = 2.0.0, stat = SentJul 16 19:54:17 mail dovecot: pop3-login: Login: user = <user1>, method = PLAIN, rip =: ffff: 192.168.100.20, lip =: ffff: 192.168.100.123Jul 16 19:54:17 mail dovecot: POP3 (user1): Disconnected: Logged out top = 0/0, retr = 1/882, del = 1/1, size = 866 ps: If you have any questions, Q395061796
This article from the "" blog, please be sure to keep this source http://zhangc.blog.51cto.com/5627676/992806