验证 sieve 在 dovecot 中是否正常工作

验证 sieve 在 dovecot 中是否正常工作

我已经设置了带有筛子的鸽舍:

protocol lda {
  # Address to use when sending rejection mails.
  #postmaster_address = [email protected]

  # Hostname to use in various parts of sent mails, eg. in Message-Id.
  # Default is the system's real hostname.
  #hostname = 

  log_path = /var/mail/dovecot-deliver.log
  info_log_path = /var/mail/dovecot-deliver.log

  # Support for dynamically loadable plugins. mail_plugins is a space separated
  # list of plugins to load.
  mail_plugins = cmusieve
  mail_plugin_dir = /usr/lib/dovecot/modules/lda

  # If user is over quota, return with temporary failure instead of
  # bouncing the mail.
  #quota_full_tempfail = no

  # Format to use for logging mail deliveries. You can use variables:
  #  %$ - Delivery status message (e.g. "saved to INBOX")
  #  %m - Message-ID
  #  %s - Subject
  #  %f - From address
  #deliver_log_format = msgid=%m: %$

  # Binary to use for sending mails.
  #sendmail_path = /usr/lib/sendmail

  # Subject: header to use for rejection mails. You can use the same variables
  # as for rejection_reason below.
  #rejection_subject = Automatically rejected mail

  # Human readable error message for rejection mails. You can use variables:
  #  %n = CRLF, %r = reason, %s = original subject, %t = recipient
  #rejection_reason = Your message to <%t> was automatically rejected:%n%r

  # UNIX socket path to master authentication server to find users.
  #auth_socket_path = /var/run/dovecot/auth-master
}

我已使用以下命令启用它:

protocols = imap imaps managesieve lda

我已经验证它/usr/lib/dovecot/modules/lda/存在,并且其中有文件:

ls
lib01_acl_plugin.so     lib11_trash_plugin.so    lib20_fts_plugin.so    lib90_cmusieve_plugin.a
lib10_quota_plugin.so       lib20_convert_plugin.so  lib20_mail_log_plugin.so   lib90_cmusieve_plugin.la
lib11_autocreate_plugin.so  lib20_expire_plugin.so   lib21_fts_squat_plugin.so  lib90_cmusieve_plugin.so

我已经调整了后缀,以便通过 LDA 进行传送:

dovecot   unix  -       n       n       -       -       pipe
  flags=DRhu user=:5000:5000 argv=/usr/lib/dovecot/deliver -d ${recipient}

并且我已经设置了该域要使用的传输图dovecot:

我重启了 dovecot,但在日志中没有看到任何有关 cmusieve 的信息。我应该查找什么来修复此问题?

答案1

尝试设置:

mail_debug=yes

并检查在尝试传递邮件时记录的内容。

另外,请确保如果您要记录到 syslog,则需要写入 syslog 套接字(通常是 /dev/log)并检查 deliver 是否具有写入权限。

如果您正在记录 Dovecot 的默认日志文件,则需要授予日志文件足够的写入权限才能进行传送。

如果您发布日志,将更容易帮助找出问题。

相关内容