How are user specific Sieve files created?

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 = malmeida@itclinical.com
    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)."
0
задан 29 August 2018 в 14:30
1 ответ

Sieve имеет концепцию активного скрипта sieve. .dovecot.sieve не является каталогом, а должен быть символической ссылкой на активный скрипт sieve.

Другими словами:

  • ~ / sieve может содержать несколько скриптов
  • ~ /. dovecot.sieve должен быть символической ссылкой на один из этих сценариев

. При такой настройке dovecot сможет использовать индивидуальную конфигурацию на основе файлов в домашнем каталоге каждого пользователя.

1
ответ дан 4 December 2019 в 15:59

Теги

Похожие вопросы