Dovecot Sieve 和:用于执行的输出变量

Dovecot Sieve and :output variable for execute

我正在尝试让吹筛过滤器正常工作

require ["fileinto", "imap4flags", "mailbox", "body", "envelope", "vnd.dovecot.pipe", "variables", "vnd.dovecot.execute"];

if envelope :matches "To" "*@*" {
  set "recipient" "[=10=]";
  set "user" "";
  set "recip_domain" "";
}

if envelope :matches "From" "*" {
  set "sender" "[=10=]";
}

#Check if recipient is valid user
if execute :output "valid_user" "user-verification" "${recipient}" {
    if string :matches "${valid_user}" "True" {
      if body :raw :contains ["message/notification"] {
        setflag "\Seen";
        fileinto :create "Notifications";
        stop;
      }
    }
}

其中 user-verification 是一个 extprogram,它调用 API 并根据电子邮件地址验证用户,然后 returns 布尔值(作为控制台的输出)。

当我删除 if string :matches "${valid_user}" "True" 语句时一切正常,其他方式看起来无法识别 valid_user 变量。

当我通过管道将 valid_user 传递给某个脚本只是为了捕获该变量的值时,它会抛出一个错误:

error: specified :args item `True?' is invalid.

为什么在这种情况下要在变量中添加问号?

想法?

在这种情况下,"True" 后跟一个换行符,Sieve 会愉快地读取它并将其包含在变量值中。

要修复它 user-verification 脚本必须在不换行的情况下输出它。