Postfix to build a pure mail forwarding server 1) install dnsaptitudeinstallbind9dnsutils2) configure dnsa) named. conf. localzone & quot; test.com & quot; {typemaster; file & quot;/etc/bind/test.com & quot ;;... postfix to build a pure mail forwarding server 1) install dns aptitude install bind9 dnsutils 2) configure dns a) named. conf. local zone "test.com" {type master; file "/etc/bind/test.com" ;}; B) dgnc. om $ TTL 604800 @ in soa @ mail203.local. (20130305 604800 86400 2419200 604800) @ in ns 192.168.1.203. MX 0 mail203 mail203 in a 192.168.1.203 mail202 in a 192.168.1.202 3) configure postfix a)/etc/postfix/main. cf mynetworks = 127.0.0.0/8 [: ffff: 127.0.0.0]/104 [:: 1]/128 192.168.1.202 <============== 192.168.1.202 set the client IP address or IP address segment relay_domains = test.com that can send emails through postfix <<== = ================ set which emails sent in the specified way can be forwarded by the postfix, this indicates that postfix can forward the email transport_maps = hash sent from the external network to the domain mailbox test.com: /etc/postfix/transport <======================= set postfix to forward a domain email (such as test.com) to create the/etc/postfix/transport File: test.com relay: [mail202.test.com] <<==================== mail202.test.com indicates the name of the host on which the SMTP server on the internal network forwards the mail to the postfix c) generate the transport database file. db command: postmap/etc/postfix/transport 4) according to the above settings, postfix can receive and forward all emails from the test.com domain, but postfix does not know which recipients are in the test.com domain, this will cause the postfix to accept many invalid test.com domain emails, and eventually fail to forward and backlog, resulting in the postfix crash solution: synchronize all valid mailboxes of the test.com domain to postfix, so that postfix can promptly determine the validity of the domain email received by test.com. a) modify/etc/postfix/main. cf Add: relay_recipient_maps = hash:/etc/postfix/relay_recipients B) create/etc/postfix/relay_recipients # touch/etc/postfix/relay_recipients file content: admin@test.com OK description: admin@test.com: valid email address for the test.com domain. OK: this can be any string. for file format requirements, enter 5) test: a) send an external Email: set according to mynetworks above, postfix can only forward emails from the host where the postfix is located or from the host 192.168.1.202. Now, assume that you are logged on to the host where the postfix is located. in the bold part, you need to manually enter the following content for the test procedure: telnet localhost 25 Trying 192.168.1.202... connected to 192.168.1.202 (192.168.1.202 ). escape character is '^]'. 220 localhost. localdomain ESMTP Postfix helo test.com 250 localhost. localdomain mail from: 250 2.1.0 OK rcpt: 250 2.1.5 OK data 354 End data . Subject: this is a test mail This is test mail content. (note the following ". 250 2.0.0 OK: queued as 88B3B2A68032 quit 221 2.0.0 Bye Connection closed by foreign host. in this way, the email is sent out. you can log on to your inbox to see if you have received the email. If you receive the email, it means everything is normal and it is over. B) send emails in the same way as before. you only need to swap the sender and recipient email addresses shown in mail from with rcpt to. 6) If the test fails, if you cannot normally receive emails or want to view the entire test process during the test, you can view the location of the log information log of the sent or received mails with the postfix: /var/log/mail.info or/var/log/mail. log
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service