next up previous contents
Next: Password Plugin Up: Roundcube Webmail Previous: 啟動 Plugins   Contents

Managesieve Plugin

  1. 確認 devocot 的 lda 協定啟動,加入 sieve 語法。
    [root@mail ~]# vim /etc/dovecot/conf.d/15-lda.conf
    [root@mail ~]# grep '^protocol lda' -A5  /etc/dovecot/conf.d/15-lda.conf | grep -v \#
    protocol lda {
      mail_plugins = $mail_plugins sieve
    }
    
  2. 確認 postfix 將郵件傳送到 dovecot。
    [root@mail ~]# vim /etc/postfix/main.cf
    [root@mail ~]# grep ^mailbox_command /etc/postfix/main.cf
    mailbox_command = /usr/libexec/dovecot/deliver
    
  3. 安裝 sieve 套件。
    [root@mail ~]# yum install dovecot-pigeonhole
    
  4. 設定 sieve。
    [root@mail ~]# vim /etc/dovecot/conf.d/90-plugin.conf 
    [root@mail ~]# grep ^plugin -A8 /etc/dovecot/conf.d/90-plugin.conf 
    plugin {
      #setting_name = value
      sieve=~/.dovecot.sieve
      sieve_dir = ~/sieve
      sieve_global_dir = /home/sieve
      sieve_max_script_size = 1M
    }
    
  5. dovecot 協定加入 sieve。
    [root@mail ~]# grep ^protocol /etc/dovecot/dovecot.conf 
    protocols = imap pop3 lmtp sieve
    
  6. managesieve-login 服務的 port 4190。
    [root@mail ~]# vim /etc/dovecot/conf.d/20-managesieve.conf 
    [root@mail ~]# grep managesieve-login -A4 /etc/dovecot/conf.d/20-managesieve.conf 
    service managesieve-login {
      inet_listener sieve {
        port = 4190
      }
    
  7. 重新啟動 dovecot。
    [root@mail ~]# /etc/init.d/dovecot restart
    
  8. 出現以下訊息
    Unable to connect to managesieve on localhost:4190
    
  9. 使用自訂 selinux 政策的方法找到 selinux 管制項目,將其開啟後正常。
    [root@mail plugins]# getsebool -a | grep httpd_can_network_connect
    httpd_can_network_connect --> off
    httpd_can_network_connect_cobbler --> off
    httpd_can_network_connect_db --> off
    [root@mail plugins]# setsebool -P httpd_can_network_connect on
    
  10. 轉信不成功,查 log 如下,再查前後訊息得知要轉入的目錄檔案過大,修正後正常。
    Jun  3 09:11:39 localhost dovecot: lda(dywang): Error: sieve: execution of script \
    ~/.dovecot.sieve failed, but implicit keep was successful \
    (user logfile ~/.dovecot.sieve.log may reveal additional details)
    



De-Yu Wang 2018-09-25