On 2026-01-26 03:41, Stephan Bosch wrote:
Hi,

I cannot reproduce any of this so far:

Maybe try again with  log_debug=category=imap or category=sieve

And provide all config (`dovecot -n`) and the Sieve scripts involved.

Regards,

Stephan

Hi,

thanks for your reply. I changed log_debug and am waiting for the next Panic.

Config and sieve scripts below.

# doveconf -n
# 2.4.2-2+debian13 (0962ed2104): /etc/dovecot/dovecot.conf
# Pigeonhole version 2.4.2-2+debian13 (767418c3)
# OS: Linux 6.12.0-sec-svcs.kvm x86_64 Debian 13.3 ext4
# Hostname: uschi.sec-svcs.eu
dovecot_config_version = 2.4.2
acl_driver = vfile
auth_mechanisms = plain
default_vsz_limit = 2048M
deliver_log_format = msgid=%{msgid}, size=%{size}, from=%{from}, subject=%{subject}, envelope from=%{from_envelope}, envelope to=%{to_envelope}, delivery time=%{delivery_time}ms, lmtp session time=%{session_time}ms, status=%{message}, storage_id=%{storage_id}
dovecot_storage_version = 2.4.2
first_valid_gid = 5000
first_valid_uid = 5000
fts_autoindex = yes
fts_autoindex_max_recent_msgs = 999
fts_search_add_missing = yes
imap_client_workarounds {
  tb-extra-mailbox-sep = yes
  tb-lsub-flags = yes
}
imap_logout_format = in=%{input} out=%{output} appended=%{appended} deleted=%{deleted} expunged=%{expunged} autoexpunged=%{autoexpunged} trashed=%{trashed} hdr_count=%{fetch_hdr_count} hdr_bytes=%{fetch_hdr_bytes} body_count=%{fetch_body_count} body_bytes=%{fetch_body_bytes}
last_valid_gid = 5000
last_valid_uid = 5000
lda_mailbox_autocreate = yes
lda_mailbox_autosubscribe = yes
lmtp_user_concurrency_limit = unlimited
log_debug = category=imap or category=sieve
mail_access_groups = vmail
mail_always_cache_fields = date.save
mail_attachment_detection_options = add-flags "content-type=!application/signature"
mail_driver = maildir
mail_gid = vmail
mail_path = /srv/mail/%{user | lower}/Maildir
mail_plugins {
  notify = yes
  mail_log = yes
  fts = yes
  fts_solr = yes
  virtual = yes
  acl = yes
  quota = yes
  quota_clone = yes
}
mail_server_admin = mailto:[email protected]
mail_server_comment = sec-svcs.eu mail hosting
mail_uid = vmail
postmaster_address = [email protected]
protocols = imap pop3 lmtp sieve
quota_status_nouser = DUNNO
quota_status_overquota = 552 5.2.2 Mailbox is full
quota_status_success = DUNNO
sieve_extensions {
  fileinto = yes
  reject = yes
  envelope = yes
  encoded-character = yes
  vacation = yes
  subaddress = yes
  comparator-i;ascii-numeric = yes
  relational = yes
  regex = yes
  imap4flags = yes
  copy = yes
  include = yes
  body = yes
  variables = yes
  enotify = yes
  environment = yes
  mailbox = yes
  date = yes
  index = yes
  ihave = yes
  duplicate = yes
  mime = yes
  foreverypart = yes
  extracttext = yes
  vnd.dovecot.debug = yes
  editheader = yes
}
sieve_global_extensions {
  vnd.dovecot.pipe = yes
  vnd.dovecot.environment = yes
}
sieve_pipe_bin_dir = /srv/sieve/imapsieve
sieve_plugins {
  sieve_imapsieve = yes
  sieve_extprograms = yes
}
sql_driver = mysql
ssl = required
syslog_facility = local5
verbose_proctitle = yes
mysql 10.1.1.50 {
  dbname = mailadmin
  password = # hidden, use -P to show it
  user = mailuser
}
passdb sql {
  default_password_scheme = SHA512-CRYPT
query = SELECT username AS user, password AS password, homedir AS userdb_home, maildir AS userdb_mail_path, CONCAT('*:bytes=', quota) AS userdb_quota_storage_size, uid AS userdb_uid, gid AS userdb_gid FROM mailbox WHERE username = '%{user | lower}' AND active = '1' AND ( access_restriction = 'ALL' OR LOCATE( '%{protocol | upper}', access_restriction ) > 0 )
}
userdb sql {
  iterate_query = SELECT username AS user FROM mailbox
query = SELECT homedir AS home, maildir AS mail_path, CONCAT('*:bytes=', quota) AS quota_storage_size, uid, gid FROM mailbox WHERE username = '%{user | lower}'
}
namespace inbox {
  inbox = yes
  separator = /
  subscriptions = yes
  type = private
  quota_storage_grace = 100M
  mailbox Drafts {
    auto = subscribe
    special_use = "\\Drafts"
  }
  mailbox Spam {
    auto = subscribe
    autoexpunge = 15d
    special_use = "\\Junk"
  }
  mailbox Trash {
    auto = subscribe
    special_use = "\\Trash"
    quota_storage_extra = 1024M
  }
  mailbox Sent {
    auto = subscribe
    special_use = "\\Sent"
    quota_storage_extra = 1024M
  }
  mailbox Archives {
    auto = subscribe
    special_use = "\\Archive"
  }
  mailbox virtual/All {
    special_use = "\\All"
  }
}
namespace virtual {
  mail_path = /srv/mail/%{user | lower}/virtual
  hidden = no
  inbox = no
  list = children
  prefix = virtual/
  separator = /
  subscriptions = yes
  type = private
}
namespace others {
  mail_driver = maildir
  mail_index_private_path = ~/Maildir/shared/%{owner_user}
  mail_path = %{owner_home}/Maildir
  list = children
  prefix = shared/$user/
  separator = /
  subscriptions = no
  type = shared
}
protocol !indexer-worker {
  mail_vsize_bg_after_count = 0
}
maildir {
  copy_with_hardlinks = yes
}
service imap-login {
  process_min_avail = 4
  restart_request_count = unlimited
  inet_listener imap {
    port = 143
  }
  inet_listener imaps {
    port = 993
    ssl = yes
  }
}
service pop3-login {
  inet_listener pop3 {
    port = 110
  }
  inet_listener pop3s {
    port = 995
    ssl = yes
  }
}
service submission-login {
  inet_listener submission {
  }
  inet_listener submissions {
  }
}
service lmtp {
  unix_listener /var/spool/postfix/private/dovecot-lmtp {
    group = postfix
    mode = 0666
    user = postfix
  }
}
service imap {
}
service pop3 {
}
service submission {
}
service auth {
  unix_listener auth-userdb {
  }
  unix_listener /var/spool/postfix/private/auth {
    group = postfix
    mode = 0666
    user = postfix
  }
  inet_listener karl_auth {
    port = 12987
    listen = 10.1.1.10
  }
}
service auth-worker {
  user = doveauth
}
service dict {
  unix_listener dict {
    group = vmail
    mode = 0660
  }
}
service quota-status {
  client_limit = 1
  executable = quota-status -p postfix
  inet_listener quota-pf {
    port = 11134
  }
}
ssl_server {
  alt_cert_file = /srv/le/imap.sec-svcs.eu_domain_ca_chain.ec.crt
  alt_key_file = /srv/le/imap.sec-svcs.eu.ec.key
  cert_file = /srv/le/imap.sec-svcs.eu_domain_ca_chain.crt
  dh_file = /etc/dovecot/dh.pem
  key_file = /srv/le/imap.sec-svcs.eu.key
}
protocol lda {
  mail_plugins {
    sieve = yes
    quota = yes
    fts = yes
    fts_solr = yes
  }
}
protocol imap {
  mail_plugins {
    imap_sieve = yes
    imap_acl = yes
    imap_filter_sieve = yes
  }
}
protocol lmtp {
  mail_plugins {
    sieve = yes
    quota = yes
    fts = yes
    fts_solr = yes
  }
}
service managesieve-login {
  inet_listener sieve {
    port = 4190
  }
}
service managesieve {
}
dict_server {
  dict quota {
    driver = sql
    sql_driver = mysql
    mysql 10.1.1.50 {
      dbname = mailserver
      password = # hidden, use -P to show it
      user = mailadmin
    }
    dict_map priv/quota/storage {
      sql_table = quota
      username_field = username
      dict_map_value_field bytes {
        type = uint
      }
    }
    dict_map priv/quota/messages {
      sql_table = quota
      username_field = username
      dict_map_value_field messages {
        type = uint
      }
    }
  }
  dict acl {
    driver = sql
    sql_driver = mysql
    mysql 10.1.1.50 {
      dbname = mailserver
      password = # hidden, use -P to show it
      user = mailadmin
    }
    dict_map "shared/shared-boxes/user/$to/$from" {
      sql_table = user_shares
      dict_map_value_field dummy {
      }
      dict_map_key_field from_user {
        value = $from
      }
      dict_map_key_field to_user {
        value = $to
      }
    }
    dict_map "shared/shared-boxes/anyone/$from" {
      sql_table = anyone_shares
      dict_map_value_field dummy {
      }
      dict_map_key_field from_user {
        value = $from
      }
    }
  }
}
acl_sharing_map {
  dict proxy {
    name = acl
  }
}
quota "User quota" {
  driver = count
  storage_size = 20480M
  quota_warning warn-95 {
    quota_storage_percentage = 95
    execute quota-warning {
      args = 95 %{user}
    }
  }
  quota_warning warn-80 {
    quota_storage_percentage = 80
    execute quota-warning {
      args = 80 %{user}
    }
  }
}
service quota-warning {
  executable = script /usr/local/bin/quota-warning.sh
  user = dovecot
  unix_listener quota-warning {
    user = dovecot
  }
}
quota_clone {
  dict proxy {
    name = quota
  }
}
sieve_script personal {
  active_path = /srv/sieve/%{user | lower}/.dovecot.sieve
  driver = file
  path = /srv/sieve/%{user | lower}
}
mailbox Spam {
  sieve_script report-spam {
    cause = copy append
    path = /srv/sieve/imapsieve/report-spam.sieve
    type = before
  }
}
imapsieve_from Spam {
  sieve_script report-ham {
    cause = copy append
    path = /srv/sieve/imapsieve/report-ham.sieve
    type = before
  }
}
sieve_script before {
  path = /srv/sieve/before
  type = before
}


These two are for rspamd and work for my user when using roundcube and thunderbird on android..
* report-spam.sieve:
require ["vnd.dovecot.pipe", "copy", "imapsieve", "environment", "variables"];

if environment :matches "imap.user" "*" {
  set "username" "${1}";
}

pipe :copy "learn-spam.sh" [ "${username}" ];


* report-ham.sieve:
require ["vnd.dovecot.pipe", "copy", "imapsieve", "environment", "variables"];

if environment :matches "imap.mailbox" "*" {
  set "mailbox" "${1}";
}

if string "${mailbox}" "Trash" {
  stop;
}

if environment :matches "imap.user" "*" {
  set "username" "${1}";
}

pipe :copy "learn-ham.sh";


* I disabled this one during the time I posted the initial message. For completeness:
#mailbox Trash {
#  sieve_script flag-seen {
#    type = before
#    cause = copy append
#    path = /srv/sieve/imapsieve/setflag-seen.sieve
#  }
#}

* setflag-seen.sieve:
# set flag "\\seen"
require ["imap4flags"];
setflag "\\seen";

--
 Christian Kivalo
_______________________________________________
dovecot mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to