Dovecot

找不到由 ManagedSieve 設置的 Roundcube 過濾器

  • April 18, 2019

這是我目前的過濾器:

require ["vacation"];
# rule:[Filter Test]
if allof (exists "from")
{
       vacation :days 365 :addresses "newmail@vietfeir.com" :subject "Mailbox disabled" :from "newmail@vietfeir.com" text:
The mailbox dennis@vietfeir.com is no longer active. Please reply to this message and request the new address.

Thank you.

我觀察到它會工作一次,並且回復會返回給發件人。任何後續電子郵件都不會得到回复。如果我從另一個郵箱發送消息,它會收到回复。什麼可能導致這種行為?

所以,我真正想要的是每次收到消息時都會發送的自動回复。Roundcube 有一個名為“Responses”的配置選項,我認為它會這樣做,但它沒有效果。我已經向 Roundcube 社區發布了關於此的內容。

另一個更新

這令人費解。幾個小時後,我決定修改腳本。現在我再次收到消息“篩:使用者在儲存中沒有活動腳本”,這是最初提示這篇文章的原因。

更新

我最終在 /etc/dovecot/conf.d/90-sieve.conf 中註釋掉了使用者腳本位置。之後,我在 Roundcube 中創建的任何過濾器都可以正常工作。

那麼,該規範的目的是什麼,預設值是什麼


我是 ManagedSieved 的新手。調試日誌說使用者沒有個人腳本。我已將使用者腳本位置指定為:

sieve = /var/mail/vhosts/%d/%u/sieve/*.sieve

這是行不通的。當我使用 Roundcube 創建過濾器時,它位於此處:

/var/mail/vhosts/vietfeir.com/dennis_gray/sieve

文件名是roundcube.sieve

現在如何設置使用者腳本位置指向那裡?我一直無法弄清楚正確的語法。

我有 Roundcube 創建的以下測試腳本。它的名字是roundcube.sieve:

# rule:[Redirect Test]
if allof (header :contains "subject" "redirect")
{
       redirect "dev@vietfeir.com";
}

我已經調試並在日誌中看到了這樣的消息:

Apr 17 10:11:10 lmtp(d0325mgray@vietfeir.com): Debug: 0B58A06ZtlzrbAAAywx1xA: sieve: file storage: Storage path
`/var/mail/vhosts/vietfeir.com/d0325mgray/.dovecot.sieve' not found
Apr 17 10:11:10 lmtp(d0325mgray@vietfeir.com): Debug: 0B58A06ZtlzrbAAAywx1xA: sieve: User has no active script i
n storage `/var/mail/vhosts/vietfeir.com/d0325mgray/sieve'
Apr 17 10:11:10 lmtp(d0325mgray@vietfeir.com): Debug: 0B58A06ZtlzrbAAAywx1xA: sieve: User has no personal script

我創建的 Roundcube 腳本肯定儲存在使用者的路徑中,所以我不知道為什麼它報告它不是。

before.sieve 腳本正在執行,沒有問題。

dovecot -n 的輸出:

# 2.2.33.2 (d6601f4ec): /etc/dovecot/dovecot.conf
# Pigeonhole version 0.4.21 (92477967)
# OS: Linux 4.15.0-47-generic x86_64 Ubuntu 18.04.2 LTS ext4
auth_mechanisms = plain login
log_path = /var/log/dovecot.log
mail_location = maildir:/var/mail/vhosts/%d/%n/
mail_privileged_group = mail
managesieve_notify_capability = mailto
managesieve_sieve_capability = fileinto reject envelope encoded-character vacation subaddress comparator-i;ascii-numeric relational regex imap4flags copy include variables body enotify environment mailbox date index ihave duplicate mime foreverypart extracttext imapflags notify
namespace inbox {
 inbox = yes
 location = 
 mailbox Drafts {
   special_use = \Drafts
 }
 mailbox Junk {
   special_use = \Junk
 }
 mailbox Sent {
   special_use = \Sent
 }
 mailbox "Sent Messages" {
   special_use = \Sent
 }
 mailbox Spam {
   auto = subscribe
   special_use = \Junk
 }
 mailbox Trash {
   special_use = \Trash
 }
 prefix = 
}
passdb {
 args = /etc/dovecot/deny-users
 deny = yes
 driver = passwd-file
}
passdb {
 args = /etc/dovecot/dovecot-sql.conf.ext
 driver = sql
}
plugin {
 sieve_before = /var/mail/before.sieve
 sieve_extensions = +notify +imapflags
 sieve_trace_dir = /var/mail
 sieve_trace_level = matching
}
postmaster_address = dev@vietfeir.com
protocols = imap lmtp sieve
service auth-worker {
 user = vmail
}
service auth {
 unix_listener /var/spool/postfix/private/auth {
   group = postfix
   mode = 0666
   user = postfix
 }
 unix_listener auth-userdb {
   mode = 0600
   user = vmail
 }
 user = dovecot
}
service imap-login {
 inet_listener imap {
   port = 0
 }
 inet_listener imaps {
   port = 993
   ssl = yes
 }
}
service lmtp {
 unix_listener /var/spool/postfix/private/dovecot-lmtp {
   group = postfix
   mode = 0600
   user = postfix
 }
}
service pop3-login {
 inet_listener pop3 {
   port = 0
 }
 inet_listener pop3s {
   port = 995
   ssl = yes
 }
}
ssl = required
ssl_cert = </etc/letsencrypt/live/civicrm.vietfeir.com/fullchain.pem
ssl_client_ca_dir = /etc/ssl/certs
ssl_key =  # hidden, use -P to show it
userdb {
 driver = passwd
}
userdb {
 args = uid=vmail gid=vmail home=/var/mail/vhosts/%d/%n
 driver = static
}
protocol lmtp {
 mail_plugins = " sieve sieve"
}
protocol lda {
 mail_plugins = " sieve"
}

我很滿意我現在了解這些過濾器的工作原理。當我使用 Roundcube 創建一個過濾器時,它會將其放置在

/var/mail/vhosts/[domain]/[user]/sieve/roundtree.sieve

然後它創建一個指向該文件的符號連結

/var/mail/vhosts/[domain]/[user]/.dovecot.sieve

然後,在第一次呼叫過濾器時,它被編譯到同一目錄中的 .dovecot.svbin 中。

我現在可以考慮關閉。

引用自:https://serverfault.com/questions/963403