• <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>
  • Postfix電子郵局的配置步驟

    發表于:2007-06-13來源:作者:點擊數: 標簽:
    環境: RedHat Linux+Postfix+Cyrus-sasl+Dovecot+Stunnel 在安裝Linux時,如果選擇全部安裝的話,Postfix與Dovecot以及Stunnel將會自動給予安裝上去,查看是否已安裝,可以執行如下命令: rpm –qa | grep postfix或dovecot或stunnel 如果沒有的話,請直接

    環境:RedHat Linux+Postfix+Cyrus-sasl+Dovecot+Stunnel

    在安裝Linux時,如果選擇全部安裝的話,Postfix與Dovecot以及Stunnel將會自動給予安裝上去,查看是否已安裝,可以執行如下命令:

    rpm –qa | grep postfix或dovecot或stunnel

    如果沒有的話,請直接在光盤里找出來,并給予安裝。這里以RPM包安裝為列,安裝命令如下:

    rpm –ivh postfix-*.rpm  或

    rpm –ivh cyrus-sasl-*.rpm 或

    rpm –ivh dovecot-*.rpm 或

    rpm-ivh stunnel-*.rpm
    這里的*代表的是相關的版本號。

    在確認這些安裝包已安裝到系統里后,現在開始配置Mail服務。

    首先,請停止系統內自帶的Mail服務-Sendmail,執行如下命令:
    /etc/init.d/sendmail stop      //先停止sendmail進程

    chkconfig sendmail off       //再把自啟動服務去掉


    一:配置Cyrus-sasl

    確定已安裝完Cyrus-sasl后,啟動該服務:
    /etc/init.d/saslauthd start     //啟動Cyrus-sasl服務。

    chkconfig saslauthd on      //把Cyrus-sasl設置為開機自啟動。
    測試一下是否成功:
    testsaslauthd –u 系統用戶名 –p ‘對應的密碼’或

    /usr/sbin/testsaslauthd –u 系統用戶名 –p ‘對應的密碼’



    如果提示:

    0: OK "Suclearcase/" target="_blank" >ccess."

    則說明已安裝成功!

    注:Cyrus-sasl的功能就是實現密碼驗證機制。

    二:配置SMTP

    現在,開始配置Postfix,Postfix的功能就是實現SMTP服務,也即信件發送服務。Postfix的主要配置文檔是/etc/postfix/main.cf,如果沒看到mail.cf文檔則請執行:
    cp /etc/postfix/main.cf.default /etc/postfix/main.cf
    然后修改main.cf的相關內容。具體內容如下:
    alias_database = hash:/etc/aliases

    alias_maps = hash:/etc/aliases

    command_directory = /usr/sbin

    config_directory = /etc/postfix

    daemon_directory = /usr/libexec/postfix

    debug_peer_level = 2

    header_checks = regexp:/etc/postfix/header_checks

    html_directory = no

    mailbox_size_limit = 102400000

    mailq_path = /usr/bin/mailq.postfix

    manpage_directory = /usr/share/man

    mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain

    mydomain = 域名

    myhostname = mail.域名

    mynetworks = 192.168.1.0/24, 127.0.0.0/8, 192.168.1.100/32

    myorigin = $mydomain

    newaliases_path = /usr/bin/newaliases.postfix

    readme_directory = /usr/share/doc/postfix-1.1.11/README_FILES

    relay_domains = nanoconcept.net

    sample_directory = /usr/share/doc/postfix-1.1.11/samples

    sendmail_path = /usr/sbin/sendmail.postfix

    setgid_group = postdrop

    smtpd_sasl_auth_enable = yes

    smtpd_sasl_local_domain= ''

    smtpd_recipient_restrictions =

    permit_sasl_authenticated

    permit_auth_destination

    permit_mynetworks

    check_relay_domain

    reject_rbl_client yahoo.com.tw

    reject_rbl_client cbl.anti-spam.org.cn

    reject_rbl_client cdl.anti-spam.org.cn

    reject_rbl_client cblplus.anti-spam.org.cn

    reject_non_fqdn_sender

    reject_non_fqdn_recipient

    reject_unknown_sender_domain

    reject_unknown_recipient_domain

    reject

    broken_sasl_auth_clients = yes

    smtpd_client_restrictions = permit_sasl_authenticated

    smtpd_recipient_restrictions = permit_sasl_authenticated

    smtpd_sasl_security_options=noanonymous

    unknown_local_recipient_reject_code = 550



    Postfix配置文件默認情況下,沒有啟用SMTP認證機制,所以,需要修改postfix的主配置main.cf文件,也即上面以smtpd開頭的,這些就是實現SMTP功能的配置內容!

    現在可以啟動postfix服務:
    /etc/init.d/postfix start       //啟動postfix服務

    chkconfig postfix on//設置postfix開機自啟動。


    可以通過netstat –ntl進行查看SMTP的端口(25)是否起來。

    然后就可以進行測試是否能發信,如果不行的話,請查看一下:

    /usr/lib/sasl2下是否存在著smtpd.conf與Sendmail.conf兩個文件,其內容為:


    [root@xtmail sasl2]# cat Sendmail.conf

    pwcheck_method:saslauthd

    與:

    [root@xtmail sasl2]# cat smtpd.conf

    pwcheck_method: saslauthd


    但有時候,Postfix無法自動找到saslauthd的路徑,所以需要在smtpd.conf里添加一條:


    saslauthd_path:/var/run/saslauthd/mux


    三:配置POP3

    Dovecot的功能就是實現收信功能,即POP3功能。在安裝Dovecot的RPM包后,Dovecot的配置文件是在/etc/下的dovecot.conf

    為了能讓Dovecot正常使用,需要修改一下dovecot.conf的些配置。具體如下:


    protocols = pop3

    pop3_listen = [::]

    login = imap

    login = pop3

    mbox_locks = fcntl

    auth = default

    auth_mechanisms = plain

    auth_userdb = passwd

    auth_user = root


    完后,請運行以下命令:
    /etc/init.d/dovecot start           //啟動Dovecot服務

    chkconfig dovecot on            //設置開機自啟動
    四:端口加密

    現在就把一臺具有SMTP與POP3功能的郵局配置完畢。當然了,這臺只具備簡單的SMTP與POP3功能的郵局,現在要對其進行端口加密。也就是提到的 Stunnel。Stunnel的配置文件是在/etc/stunnel/stunnel.conf,里面已有SMTP與POP3的進行端口加密。一般只要直接啟動起來就可以了。具體形式如下:

    /etc/init.d/stunnel      //啟動stunnel

    如果是用tar.gz進行編譯的話,有時在啟動stunnel時,需要帶上stunnel.conf的絕對路徑!

    五:檢查端口是否正常開啟

    現在一套完整的Postfix郵局已配置完畢,可以投入正常使用??梢酝ㄟ^ netstat –ntl進行查看到25、110、465、995這幾個端口的存在。其中25端口加密后就是465,110加密后就是995,110端口只是一個與客戶端連接的,可以禁止掉。25端口不可以屏蔽掉,因為Mail服務器之間在互相傳輸時,還是使用25端口的。

    (責任編輯:少青箏 68476636-8003)



    原文轉自:http://www.kjueaiud.com

    ...
    老湿亚洲永久精品ww47香蕉图片_日韩欧美中文字幕北美法律_国产AV永久无码天堂影院_久久婷婷综合色丁香五月

  • <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>