如何在 dovecot 的 sieve-test 中定義 sieve_global_dir

如何在 dovecot 的 sieve-test 中定義 sieve_global_dir

我創建了一些 sieve (dovecot 實作)過濾器腳本,並想使用 sieve-test 來測試它們。

所有使用全域包含的腳本都會失敗並顯示以下訊息

Error: sieve: include: sieve_global_dir not set for :global script include (wanted script 'bugzilla.sieve')

sieve_global_dir 在 dovecot.conf 中設置,並且包含在由 啟動時起作用deliver

sieve-test如何定義 sieve_global_dir 並由和讀取sievec

先致謝

答案1

根據 wiki 的部分內容並從 dovecot.org 閱讀一些原始碼:

http://wiki.dovecot.org/LDA/Sieve/Dovecot

……你應該能夠做類似的事情:

export SIEVE_DIR=/some/path
export SIEVE_GLOBAL_DIR=/some/other/path
sievec -d -P /some/file.sieve

原始碼很複雜,但如果我正確讀取Pigeonhole sieve 原始程式碼,lib-sieve/plugins/environment/ 程式碼將讀取您定義的任何內容,並且sievec 會在運行時檢查將這兩個值設為環境之外。我無法確認這一點,因為我沒有安裝它來測試,YMMV。

答案2

抱歉,但我認為解決方案不對。

在 dovecot 2.xx 中做

export SIEVE_GLOBAL_DIR=/some/other/path

行不通的。

我已將以下行新增至 dovecot.conf 檔案(在該plugin部分內):

sieve_global_dir=/etc/dovecot/sieve/

每一個想法都有效!

顯然該路徑必須包含一個sieve.global檔案。

謝謝。

相關內容