Dovecot

沒有子地址:信封測試中的詳細資訊部分

  • January 8, 2018

我嘗試按子地址過濾郵件:篩選腳本中的詳細資訊部分。

目標是在這個簡單的測試案例中使用正則表達式模式:

if envelope :detail :regex "to" ["^test$"]{                                                                                                             
 fileinto "Social";
 stop;
}
if envelope :detail ["to"] ["test"]{
 fileinto "Social";
 stop;
}

兩個腳本都不起作用。

如果我在我的 dovecot 配置中啟用跟踪,我可以看到,地址 sieve 嘗試從中提取詳細資訊不再包含詳細資訊部分,而“to”標頭用於同一腳本中的標頭測試做。

12: header test
12:   starting `:regex' match with `i;ascii-casemap' comparator:
12:   extracting `to' headers from message
12:   matching value `"user+test@domain.net" <user+test@domain.net>'
12:     with regex `.*blogs' [id=0] => 0
12:   finishing match with result: not matched
12: jump if result is false
12:   jumping to line 18
18: envelope test
18:   starting `:regex' match with `i;ascii-casemap' comparator:
18:   getting `to' part from message envelope
18:   extracting `detail' part from address `user@domain.net'
18:   finishing match with result: not matched
18: jump if result is false
18:   jumping to line 22
22: envelope test
22:   starting `:is' match with `i;ascii-casemap' comparator:
22:   getting `to' part from message envelope
22:   extracting `detail' part from address `user@domain.net'
22:   finishing match with result: not matched
22: jump if result is false
22:   jumping to line 32

那麼,dovecot 削減信封細節部分的原因可能是什麼?

好吧,與伺服器故障相關的問題建議終於讓我走上了正軌。

正如此解決方案中所建議的,問題不是鴿舍或篩子,而是後綴。所以我在我的 postfix master.cf 中更改了以下行,不僅送出使用者和域,還送出原始收件人地址。

# old
dovecot   unix  -       n       n       -       -       pipe
 flags=DRhu user=vmail:vmail argv=/usr/lib/dovecot/deliver -f ${sender} -d ${user}@${nexthop}
# new
dovecot   unix  -       n       n       -       -       pipe
 flags=DRhu user=vmail:vmail argv=/usr/lib/dovecot/deliver -f ${sender} -d ${user}@${nexthop} -a ${original_recipient}

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