• <ul id="mayc0"></ul>
    <ul id="mayc0"><center id="mayc0"></center></ul>
    <strike id="mayc0"><input id="mayc0"></input></strike>
    <ul id="mayc0"></ul>
  • 始創于2000年 股票代碼:831685
    咨詢熱線:0371-60135900 注冊有禮 登錄
    • 掛牌上市企業
    • 60秒人工響應
    • 99.99%連通率
    • 7*24h人工
    • 故障100倍補償
    您的位置: 網站首頁 > 幫助中心>文章內容

    構建反病毒反垃圾郵件系統(四)

    發布時間:  2012/8/14 13:48:18
     4、TLS支持

    通過修改/usr/lib/ssl/misc/CA.pll腳本實現,以下修改后CA1.pl和未修改CA.pl之間的對比:

    以下為引用的內容:
    ***CA.pl
    ---CA1.pl
    ***************
    ***59,69****
    }elsif(/^-newcert$/){
    #createacertificate
    !system("$REQ-new-x509-keyoutnewreq.pem-outnewreq.pem$DAYS");
    $RET=$?;
    print"Certificate(andprivatekey)isinnewreq.pem\n"
    }elsif(/^-newreq$/){
    #createacertificaterequest
    !system("$REQ-new-keyoutnewreq.pem-outnewreq.pem$DAYS");
    $RET=$?;
    print"Request(andprivatekey)isinnewreq.pem\n";
    }elsif(/^-newca$/){
    ---59,69----
    }elsif(/^-newcert$/){
    #createacertificate
    !system("$REQ-new-x509-nodes-keyoutnewreq.pem-outnewreq.pem$DAYS");
    $RET=$?;
    print"Certificate(andprivatekey)isinnewreq.pem\n"
    }elsif(/^-newreq$/){
    #createacertificaterequest
    !system("$REQ-new-nodes-keyoutnewreq.pem-outnewreq.pem$DAYS");
    $RET=$?;
    print"Request(andprivatekey)isinnewreq.pem\n";
    }elsif(/^-newca$/){

      
    現在就可以使用修改的CA1.pl來簽發證書:

    以下為引用的內容:
    #cd/usr/local/ssl/misc
    #./CA1.pl-newca
    #./CA1.pl-newreq
    #./CA1.pl-sign
    #cpdemoCA/cacert.pem/etc/postfix/CAcert.pem
    #cpnewcert.pem/etc/postfix/cert.pem
    #cpnewreq.pem/etc/postfix/key.pem


    修改main.cf,添加:

    以下為引用的內容:
    smtpd_tls_cert_file=/etc/postfix/cert.pem
    smtpd_tls_key_file=/etc/postfix/privkey.pem
    smtpd_use_tls=yes
    tls_random_source=dev:/dev/urandom
    tls_daemon_random_source=dev:/dev/urandom

      
    重起postfix后就可以看到250-STARTTLS

    很多郵件客戶端對TLS的支持并不是非常好,建議使用stunnel來實現相應的smtp和pop3加密。

    #apt-getinstallstunnel

    證書:

    以下為引用的內容:
    #opensslreq-new-x509-days365-nodes-config/etc/ssl/openssl.cnf-outstunnel.pem-keyoutstunnel.pem
    #opensslgendh512>>stunnel.pem

      
    服務端:

    以下為引用的內容:
    #stunnel-d60025-r25-snobody-gnogroup
    #stunnel-d60110-r110-snobody-gnogroup

      
    如果使用-npop3等參數就只能用郵件客戶端收信。

    客戶端:

    建一個stunnel.conf文件:

    以下為引用的內容:
    client=yes

    [pop3]
    accept=127.0.0.1:110
    connect=192.168.7.144:60110

    [smtp]
    accept=127.0.0.1:25
    connect=192.168.7.144:60025

      
    然后啟動stunnel.exe,在郵件客戶端的smtp和pop3的服務器都填127.0.0.1就可以了,這樣從你到郵件服務器端的數據傳輸就讓stunnel給你加密了。

    5、測試用戶

    以下為引用的內容:
    #mkdir-p/home/vmail/test.org/san/
    #chown-Rnobody.nogroup/home/vmail
    #chmod-R700/home/vmail

    mysql>usepostfix
    mysql>insertintotransportsetdomain='test.org',destination='
    virtual:';
    mysql>insertintouserssetemail='san@test.org',clear='test',name='',uid='65534',gid='6553-4',
    homedir='home/vmail',maildir='test.org/san/';

      
    然后就可以使用客戶端收發郵件,記得用戶名是email地址。


    本文出自:億恩科技【www.vbseamall.com】

    服務器租用/服務器托管中國五強!虛擬主機域名注冊頂級提供商!15年品質保障!--億恩科技[ENKJ.COM]

  • 您可能在找
  • 億恩北京公司:
  • 經營性ICP/ISP證:京B2-20150015
  • 億恩鄭州公司:
  • 經營性ICP/ISP/IDC證:豫B1.B2-20060070
  • 億恩南昌公司:
  • 經營性ICP/ISP證:贛B2-20080012
  • 服務器/云主機 24小時售后服務電話:0371-60135900
  • 虛擬主機/智能建站 24小時售后服務電話:0371-60135900
  • 專注服務器托管17年
    掃掃關注-微信公眾號
    0371-60135900
    Copyright© 1999-2019 ENKJ All Rights Reserved 億恩科技 版權所有  地址:鄭州市高新區翠竹街1號總部企業基地億恩大廈  法律顧問:河南亞太人律師事務所郝建鋒、杜慧月律師   京公網安備41019702002023號
      0
     
     
     
     

    0371-60135900
    7*24小時客服服務熱線