Postfix is the MTA software developed by Wietse Venema under the ibm gpl protocol. Postfix is an attempt by Wietse Venema to provide alternatives to the most widely used sendmail. Let's take a look at the postfix configuration and installation method.
Install Postfix
| The Code is as follows: |
Copy code |
Yum install postfix system-switch-mail |
Set postfix
| The Code is as follows: |
Copy code |
Vi/etc/postfix/main. cf Myhostname = ha.xxx.kh.edu.tw Myorigin = $ myhostname Myorigin = xxx.kh.edu.tw Inet_interfaces = all # Inet_interfaces = local Mydestination = $ myhostname, localhost. $ mydomain, localhost Mynetworks = 163.32.X.0/24,127.0 .0.0/8 Relay_domains = $ mydestination |
Start
| The Code is as follows: |
Copy code |
Vi/etc/rc. d/rc. local /Usr/sbin/postfix start |
Install and set dovecot (Centos6.4)
Install software
| The Code is as follows: |
Copy code |
Yum-y install dovecot Cp/etc/dovecot. conf/etc/dovecot. conf. bak Vi/etc/dovecot. conf Protocols = pop3 Ssl_disable = yes |
Modify the preset dovecot email receiving location
| The Code is as follows: |
Copy code |
Vi/etc/dovecot/conf. d/10-mail.conf Mail_location = mbox :~ /Mail: INBOX =/var/mail/% u Vi/etc/dovecot/conf. d/10-auth.conf Disable_plaintext_auth = no Auth_mechanic ISMs = plain login |
Restart
| The Code is as follows: |
Copy code |
Service dovecot restart Chkconfig dovecot on
|
Set postfix SMTP Verification
| The Code is as follows: |
Copy code |
Vi/etc/postfix/main. cf Smtpd_sasl_auth_enable = yes Smtpd_sasl_security_options = noanonymous Broken_sasl_auth_clients = yes Smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination Chkconfig saslauthd on Service saslauthd restart |
Virus filtering software Amavisd + Clamav Anti-Virus and Spam
Install clamav amavisd-new Software
| The Code is as follows: |
Copy code |
Yum-y install clamav amavisd-new Service clamd start Chkconfig -- level 3, 5 freshclam on Service amavisd start Chkconfig -- level 3, 5 amavisd on |
Specified email server domain
| The Code is as follows: |
Copy code |
Vi/etc/amavisd. conf $ Mydomain = www. bKjia. c0m |
Define a virus filtering service in master. cf.
| The Code is as follows: |
Copy code |
Vi/etc/postfix/master. cf Amavis unix--2 smtp-o smtp_data_done_timeout = 1200 |
Add the following settings
| The Code is as follows: |
Copy code |
127.0.0.1: 10025 inet n--smtpd -O content_filter = -O local_recipient_maps = -O relay_recipient_maps = -O smtpd_restriction_classes = -O smtpd_client_restrictions = -O smtpd_helo_restrictions = -O smtpd_sender_restrictions = -O smtpd_recipient_restrictions = permit_mynetworks, reject -O mynetworks = 127.0.0.0/8 -O strict_rfc821_envelopes = yes -O smtpd_error_sleep_time = 0 -O smtpd_soft_error_limit = 1001 -O smtpd_hard_error_limit = 1000 |
Content_filter parameter settings
Vi/etc/postfix/main. cf
Content_filter = amvis: [127.0.0.1]: 10024
Smtp inet... do not modify the middle column...