大网数据广告活动
服务器运维问答

How are user specific Sieve files created?

· 52CE 我爱测

My Dovecot's protocol_lda is as follows: protocol lda { log_path = /var/log/mail/dovecot-deliver.log auth_socket_path = /var/run/dovecot/auth-master postmaster_address = [email omitted] mail_plugins = sieve mail_plugin_dir = /usr…

问题原文

原帖链接 · mmalmeida · CC BY-SA 4.0

My Dovecot's protocol_lda is as follows:

protocol lda {
    log_path = /var/log/mail/dovecot-deliver.log
    auth_socket_path = /var/run/dovecot/auth-master
    postmaster_address = [email omitted]
    mail_plugins = sieve
    mail_plugin_dir = /usr/lib/dovecot/modules/lda
    global_script_path = /etc/sieve/globalsieverc
    sieve_before = /etc/sieve/sieve_before
    sieve = file:~/sieve;active=~/.dovecot.sieve

}

I touched the /home/someuser/.dovecot.sieve to create the file, created the directory ~/sieve, and created /home/someuser/someuser.sieve with the contents:

require ["fileinto"];

if address :domain :is "From" "gmail.com" {
  fileinto "XXX";
  stop;
}

However, mail comming from a gmail account is being filed in INBOX instead of XXX.

EDIT: In a nutshell, the use case I am interested is:

As an admin of a postfix configuration with one Mailbox per linux system user

I want one sieve rules file per user (in their home directory) in addition to the default global rules

So that each user's rules are separated (easier to read) and each use can configure his own rules

Edit 2018-08-29: It ended up working by having:

  • a symlink ~/.dovecot.sieve pointing to /home/malmeida/sieve/name.sieve
  • The script in ~/sieve/name.sieve
  • Note that if the script has a different name, dovecot will log (e.g. if file is called active_sieve) " Warning: sieve: file storage: Active Sieve script symlink /home/user/.dovecot.sieve is broken: Invalid scriptname (points to /home/user/sieve/active_sieve)."

已采纳解答

原帖链接 · cmouse · CC BY-SA 3.0

Sieve has a concept of active sieve script. The .dovecot.sieve is not a directory, but should be symbolic link to the active sieve script.

In other words:

  • ~/sieve may contain several scripts
  • ~/.dovecot.sieve should be a symlink to one of these scripts

With this setup, dovecot will be able to use the per-user configuration based on the files within each user's home directory.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2018-04-18)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0 / CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。