close

※架設Postfix(SMTP),支援本機以為進行寄信

  1. 修改yast  的郵件設定檔
    vi  /etc/sysconfig/mail

    MAIL CREATE CONFIG = “no”
    image
  2. 設定郵件主機名稱
    postconfig  -e “myhostname = server.gm120.com”          修改收信的Domain
    postconfig  -e  “inet_interfaces=all”                                   
    image
  3. 重新啟動
    service postfix restart
  4. 用telnet 測試
    telnet server.gm120.com

    image

※設定qpopper(POP3)

  1. 安裝軟體
    yast   -i qpopper
  2. 啟動服務
    chkeconfig  qpopper  on
    service  xinetd  restart

     image
  3. 測試
    image

※信件檔案

  • /var/spool/momo                        使用者momo收件信件存放的路徑
  • /home/momo/mbox                    使用者看完信件後存放於個人home folder 的地方
  • mail  -f                                        可以觀看歷史的信件

※設定信件可以Relay 的 ip

  1. 修改mynetworks 設定
    poetconf mynetworks                    設定允許Relay 的網段
    image
  2. 重新啟動
    service postfix restart
  3. 回復設定值
    vi  /etc/postfix/main.cf

    刪除最後一行mynetworks=xxx.xxx.xxx.xxx

※設定透過身份驗證的

  1. 修改主要設定檔
    vi  /etc/postfix/main.cf
    smtp_reciptient_restrications = permit_sasl_autoenticated
    smtpd_sasl_auth_enable = yes
    image
  2. 重新啟動postfix
    service postfix restart
  3. 啟動驗證伺服器
    chkconfig saslauthd on
    servive saslauthd restart

    image
  4. 使用Outlook 測試Relay 信件
    外奇信件必須要設定需要驗證

    image

※設定垃圾信件阻擋

  1. 檢查是否有安裝Procmail
    rpm  -q  procmail
  2. 設定postfix 使用procmail
    vi  /etc/postfix/mail.cf
    mailbox_command = /usr/bin/procmail
    image
  3. 設定郵件過濾規則
    vi  /etc/procmailrc

    LOGFILE = $HOME/procmail.log

    :0  b                                               「:0 」表示起始 「b」表示mail 的body
    *  ^Subject:.* abc .*                           subject 中有含 「abc」字串的即符合條件
    /dev/null                                              將符合條的位件丟到 /dev/null 中
    image 
  4. 檢視log  檔案

    image


 

 

 

 

 

 

 

arrow
arrow
    全站熱搜

    奔騰兔 發表在 痞客邦 留言(0) 人氣()