linux中postfix配置安裝

來源:互聯網
上載者:User

   postfix是Wietse Venema在IBM的GPL協議之下開發的MTA(郵件傳輸代理程式)軟體。postfix是Wietse Venema想要為使用最廣泛的sendmail提供替代品的一個嘗試,下面我們來看看postfix配置安裝方法。

  安裝Postfix

 代碼如下  

yum install postfix system-switch-mail

  設定postfix

 代碼如下  

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

  開機啟動

 代碼如下  

vi /etc/rc.d/rc.local

/usr/sbin/postfix start

  安裝與設定dovecot (Centos6.4)

  安裝軟體

 代碼如下  

yum -y install dovecot
cp /etc/dovecot.conf /etc/dovecot.conf.bak
vi /etc/dovecot.conf

protocols = pop3
ssl_disable = yes

  修改dovecot收信預設位置

 代碼如下  

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_mechanisms = plain login

  重新啟動

 代碼如下  
service dovecot restart
chkconfig dovecot on

  設定postfix SMTP 驗證

 代碼如下  

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 
 

  病毒過濾軟體 Amavisd + Clamav 防毒與垃圾信

  安裝clamav amavisd-new軟體

 代碼如下  

yum -y install clamav amavisd-new

service clamd start

chkconfig --level 3,5 freshclam on

service amavisd start

chkconfig --level 3,5 amavisd on

  指定郵件伺服器網域

 代碼如下  

vi /etc/amavisd/amavisd.conf

$mydomain = www.111cn.net
 

  在 master.cf 中先定義一個病毒過濾服務

 代碼如下  

vi /etc/postfix/master.cf

amavis unix - - - - 2 smtp -o smtp_data_done_timeout=1200

  再加入底下幾行設定

 代碼如下  

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 參數設定

  vi /etc/postfix/main.cf

  content_filter = amavis:[127.0.0.1]:10024

  smtp inet ............中間欄位不用修改............. smtpd

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.