sieve not updating headers?

Daniel J. Luke dluke at geeklair.net
Sun Jun 13 18:10:18 EEST 2021


On Jun 12, 2021, at 5:16 AM, Stephan Bosch <stephan at rename-it.nl> wrote:
>> I can see that my sieve_before script successfully sends the message off to spamc/spamd - however the message ends up in my mailbox with only the pre-existing X-Spam headers (I had expected them to be replaced or to see duplicates). I thought I'd try to just strip them from incoming mail so I used deleteheader, I got a trace saying it matches and deletes the headers, then sends the mail off to spamc/spamd - but the message that ends up in my mailbox has the headers that were presumably deleted.
> 
> I cannot reproduce this with master. Keep and implicit keep act the same. My filter program successfully changes the message and the deleteheader commands properly drop the indicated headers.
> 
> What version is this? What is your configuration (output from `dovecot -n`)

My before script sends to spamc or does deleteheader (as noted) but user script does:

# rule:[mailman lists with mailboxes]
if allof( header :matches "List-Id" "*<*.*",
    mailboxexists "${2}" )
{
    fileinto "${2}";
    stop;
}

# rule:[discard duplicates]
if duplicate
{
    discard;
}

keep;


I don't see header problems in mail that ends up ina fileinto'd mailbox, just my INBOX - I suspect it's interaction with the 'duplicate' implementation (which the RFC says operates on the original un-modified message).

dovecot -n output below -

# 2.3.14 (cee3cbc0d): /usr/local/etc/dovecot/dovecot.conf
# Pigeonhole version 0.5.14 (1b5c82b2)
# OS: Darwin 20.5.0 x86_64  
# Hostname: vroomfondel.geeklair.net
auth_username_format = %Ln
auth_verbose = yes
default_internal_group = mail
default_internal_user = _dovecot
default_login_user = _dovenull
first_valid_gid = 500
first_valid_uid = 501
last_valid_gid = 599
last_valid_uid = 599
login_greeting = geeklair.net mail ready.
mail_location = mbox:~/Mail/:INBOX=~/.mbox:INDEX=~/.dovecot-indexes
mail_plugins = fts fts_lucene zlib
managesieve_notify_capability = mailto
managesieve_sieve_capability = fileinto reject envelope encoded-character vacation subaddress comparator-i;ascii-numeric relational regex imap4flags copy include variables body enotify environment mailbox date index ihave duplicate mime foreverypart extracttext
namespace {
  inbox = yes
  location = 
  mailbox Drafts {
    auto = no
    special_use = \Drafts
  }
  mailbox Sent {
    auto = subscribe
    special_use = \Sent
  }
  mailbox Trash {
    auto = no
    special_use = \Trash
  }
  mailbox spam {
    auto = create
    special_use = \Junk
  }
  prefix = 
  separator = /
}
namespace archive {
  inbox = no
  list = no
  location = mbox:~/MailArchive/
  prefix = "#Archive/"
  separator = /
}
passdb {
  args = dovecot
  driver = pam
}
plugin {
  fts = lucene
  fts_autoindex = yes
  fts_autoindex_exclude = "#Archive/*"
  fts_lucene = whitespace_chars=@.
  recipient_delimiter = +
  sieve = file:~/.sieve;active=~/.dovecot.sieve
  sieve_before = /usr/local/etc/dovecot/sieve/before.sieve
  sieve_default = /usr/local/etc/dovecot/sieve/default.sieve
  sieve_default_name = file_spam
  sieve_filter_bin_dir = /usr/local/lib/dovecot/sieve-filter
  sieve_filter_exec_timeout = 720s
  sieve_global_extensions = +vnd.dovecot.filter +editheader
  sieve_plugins = sieve_extprograms
}
protocols = imap pop3 lmtp sieve
service auth {
  unix_listener /usr/local/var/spool/postfix/private/auth {
    group = _postfix
    mode = 0660
    user = _postfix
  }
  user = root
}
service imap-login {
  inet_listener imaps {
    port = 993
    ssl = yes
  }
  process_min_avail = 1
  service_count = 0
}
service imap {
  vsz_limit = 512 M
}
service lmtp {
  unix_listener /usr/local/var/spool/postfix/private/dovecot-lmtp {
    group = postfix
    mode = 0600
    user = postfix
  }
}
service managesieve-login {
  inet_listener sieve {
    port = 4190
  }
  process_min_avail = 0
  service_count = 0
  vsz_limit = 64 M
}
service managesieve {
  process_limit = 12
}
service pop3-login {
  inet_listener pop3 {
    port = 0
  }
  inet_listener pop3s {
    port = 995
    ssl = yes
  }
  process_min_avail = 1
  service_count = 0
}
service pop3 {
  vsz_limit = 512 M
}
ssl_cert = </opt/local/etc/letsencrypt/live/geeklair.net/fullchain.pem
ssl_cipher_list = ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA
ssl_dh = # hidden, use -P to show it
ssl_key = # hidden, use -P to show it
ssl_prefer_server_ciphers = yes
syslog_facility = local1
userdb {
  driver = passwd
}
verbose_proctitle = yes
version_ignore = yes
protocol imap {
  mail_max_userip_connections = 32
  mail_plugins = fts fts_lucene zlib imap_zlib
}
protocol pop3 {
  pop3_uidl_format = %08Xu%08Xv
}
protocol lda {
  mail_plugins = fts fts_lucene zlib sieve
  postmaster_address = postmaster at geeklair.net
}
protocol lmtp {
  mail_plugins = fts fts_lucene zlib sieve
  postmaster_address = postmaster at geeklair.net
}

-- 
Daniel J. Luke



More information about the dovecot mailing list