<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <div class="moz-cite-prefix">On 18-11-2021 01:01, Gedalya wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:55d00b4e-ccf8-2185-86d0-0cd91b051af6@gedalya.net">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <style id="bidiui-paragraph-margins" type="text/css">body p { margin-bottom: 0cm; margin-top: 0pt; }</style>
      <p>On 11/18/21 06:43, Kees van Vloten wrote:<br>
      </p>
      <blockquote type="cite"
        cite="mid:d1bd4fd3-a720-6314-905b-5c921fc39ea7@gmail.com">I was
        expecting through imapsieve_mailboxXXX_* but can find a
        combination of parameters are correct. Does anybody have this
        working? and how? </blockquote>
      <p><br>
      </p>
      <p>plugin {</p>
      <p>  sieve_plugins = sieve_imapsieve<br>
      </p>
      <p>  imapsieve_mailbox1_name = Sent<br>
          imapsieve_mailbox1_causes = APPEND COPY<br>
          imapsieve_mailbox1_before = <a class="moz-txt-link-freetext"
          href="file:~/sieve/IMAP-Sent.sieve" moz-do-not-send="true">file:~/sieve/IMAP-Sent.sieve</a><br>
      </p>
      <p>}</p>
      <p><br>
      </p>
      <p>protocol imap {<br>
          mail_plugins = $mail_plugins imap_sieve<br>
        }<br>
        <br>
      </p>
      <p>This works fine. What exactly is your issue?</p>
      <p><br>
      </p>
      <p><br>
      </p>
    </blockquote>
    <p><br>
    </p>
    <p>I use Thunderbird 78.14.0 (on Debian Bullseye) as the mail-client
      to test with. After sending a message the copy is stored in Sent
      but not moved to Sent/example.com.<br>
    </p>
    <p>There is no trace in the logs that it did try to run the
      sieve-script (can I enable specific debug logging for this?)<br>
    </p>
    <p><br>
    </p>
    <p>I ran the script manually with sieve-filter (after removing
      requirements "copy" and "imapsieve") it worked properly and moved
      the messages.</p>
    <p><br>
    </p>
    <p><font face="monospace">vmail@server:~$ ls -l
        /var/lib/dovecot/sieve/imap/sent_mail_per_domain.sieve<br>
        -rw------- 1 vmail vmail 140 Nov 17 21:00
        /var/lib/dovecot/sieve/imap/sent_mail_per_domain.sieve<br>
      </font></p>
    <p><font face="monospace"><br>
      </font></p>
    <p><font face="monospace">vmail@server:~$ cat
        /var/lib/dovecot/sieve/imap/sent_mail_per_domain.sieve<br>
        require ["fileinto", "variables", "mailbox", "copy",
        "imapsieve"];<br>
        <br>
        if header :matches "From" "*@*>?" {<br>
            fileinto :create "Sent~${2}";<br>
        }<br>
      </font><br>
    </p>
    <p>Note that tilde (~) is the defined separator in "namespace
      inbox".<br>
    </p>
    <p><br>
    </p>
    <p><font face="monospace">dovecot -n <br>
        # 2.3.13 (89f716dc2): /etc/dovecot/dovecot.conf<br>
        # Pigeonhole version 0.5.13 (cdd19fe3)<br>
        # OS: Linux 5.10.0-9-amd64 x86_64 Debian 11.1 <br>
        # Hostname: server.example.com<br>
        auth_default_realm = EXAMPLE.COM<br>
        auth_gssapi_hostname = server.example.com<br>
        auth_krb5_keytab = /etc/keytab/dovecot.keytab<br>
        auth_master_user_separator = *<br>
        auth_mechanisms = gssapi gss-spnego plain<br>
        auth_realms = EXAMPLE.COM<br>
        disable_plaintext_auth = no<br>
        first_valid_gid = 986<br>
        first_valid_uid = 990<br>
        imap_client_workarounds = tb-extra-mailbox-sep<br>
        login_greeting = Dovecot ready.<br>
        mail_debug = yes<br>
        mail_gid = 986<br>
        mail_location =
maildir:%h/%d/%n/store:LAYOUT=fs:FULLDIRNAME=0_FolderContent:UTF-8:INDEX=%h/%d/%n/index:CONTROL=%h/%d/%n/control:VOLATILEDIR=%h/%d/%n/volatile<br>
        mail_plugins = zlib notify push_notification listescape acl fts
        fts_xapian<br>
        mail_shared_explicit_inbox = yes<br>
        mail_uid = 990<br>
        managesieve_notify_capability = mailto<br>
        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 vacation-seconds spamtest imapflags notify imapsieve
        vnd.dovecot.imapsieve<br>
        namespace inbox {<br>
          inbox = yes<br>
          list = yes<br>
          location = <br>
          mailbox Drafts {<br>
            auto = subscribe<br>
            special_use = \Drafts<br>
          }<br>
          mailbox Inbox {<br>
            auto = subscribe<br>
          }<br>
          mailbox Junk {<br>
            auto = subscribe<br>
            special_use = \Junk<br>
          }<br>
          mailbox Sent {<br>
            auto = subscribe<br>
            special_use = \Sent<br>
          }<br>
          mailbox Trash {<br>
            auto = subscribe<br>
            special_use = \Trash<br>
          }<br>
          prefix = <br>
          separator = ~<br>
          subscriptions = yes<br>
          type = private<br>
        }<br>
        passdb {<br>
          args = username_format=%u /etc/dovecot/master-users<br>
          driver = passwd-file<br>
          master = yes<br>
        }<br>
        passdb {<br>
          args = /etc/dovecot/ldap_user_to_principal.conf.ext<br>
          driver = ldap<br>
          pass = yes<br>
        }<br>
        passdb {<br>
          driver = pam<br>
        }<br>
        plugin {<br>
          acl = vfile:/var/lib/dovecot/global-acls:cache_secs=1<br>
          acl_shared_dict = <a class="moz-txt-link-freetext" href="file:/var/lib/dovecot/shared-mailboxes">file:/var/lib/dovecot/shared-mailboxes</a><br>
          autocreate = Trash<br>
          autocreate2 = Drafts<br>
          autocreate3 = Sent<br>
          autosubscribe = Trash<br>
          autosubscribe2 = Drafts<br>
          autosubscribe3 = Sent<br>
          fts = xapian<br>
          fts_autoindex = yes<br>
          fts_autoindex_exclude = \Trash<br>
          fts_decoder = decode2text<br>
          fts_enforced = yes<br>
          fts_xapian = partial=3 full=20<br>
          imapsieve_mailbox1_before =
        <a class="moz-txt-link-freetext" href="file:/var/lib/dovecot/sieve/imap/learn-spam.sieve">file:/var/lib/dovecot/sieve/imap/learn-spam.sieve</a><br>
          imapsieve_mailbox1_causes = COPY<br>
          imapsieve_mailbox1_name = Junk<br>
          imapsieve_mailbox2_before =
        <a class="moz-txt-link-freetext" href="file:/var/lib/dovecot/sieve/imap/learn-ham.sieve">file:/var/lib/dovecot/sieve/imap/learn-ham.sieve</a><br>
          imapsieve_mailbox2_causes = COPY<br>
          imapsieve_mailbox2_from = Junk<br>
          imapsieve_mailbox2_name = *<br>
          imapsieve_mailbox3_before =
        <a class="moz-txt-link-freetext" href="file:/var/lib/dovecot/sieve/imap/sent_mail_per_domain.sieve">file:/var/lib/dovecot/sieve/imap/sent_mail_per_domain.sieve</a><br>
          imapsieve_mailbox3_causes = APPEND COPY<br>
          imapsieve_mailbox3_name = Sent<br>
          listescape_char = \<br>
          sieve =
        <a class="moz-txt-link-freetext" href="file:%h/%d/%n/sieve/sieve;active=%h/%d/%n/sieve/active.sieve">file:%h/%d/%n/sieve/sieve;active=%h/%d/%n/sieve/active.sieve</a><br>
          sieve_after = /var/lib/dovecot/sieve/after<br>
          sieve_before = /var/lib/dovecot/sieve/before<br>
          sieve_default = /var/lib/dovecot/sieve/default.sieve<br>
          sieve_extensions = +vacation-seconds +reject +notify
        +imapflags +spamtest<br>
          sieve_global = /var/lib/dovecot/sieve/global_include<br>
          sieve_global_extensions = +vnd.dovecot.pipe<br>
          sieve_pipe_bin_dir = /var/lib/dovecot/sieve/bin<br>
          sieve_plugins = sieve_imapsieve sieve_extprograms<br>
          sieve_vacation_default_period = 1d<br>
          sieve_vacation_max_period = 1d<br>
          sieve_vacation_min_period = 10s<br>
          sieve_vacation_use_original_recipient = yes<br>
        }<br>
        postmaster_address = <a class="moz-txt-link-abbreviated" href="mailto:sysadmin@example.com">sysadmin@example.com</a><br>
        protocols = " imap lmtp sieve submission"<br>
        service auth {<br>
          unix_listener /var/spool/postfix/private/auth {<br>
            group = postfix<br>
            mode = 0660<br>
            user = postfix<br>
          }<br>
        }<br>
        service decode2text {<br>
          executable = script /usr/local/sbin/decode2text.sh<br>
          unix_listener decode2text {<br>
            mode = 0666<br>
          }<br>
          user = dovecot<br>
        }<br>
        service imap-login {<br>
          inet_listener imap {<br>
            port = 0<br>
          }<br>
          inet_listener imaps {<br>
            port = 993<br>
            ssl = yes<br>
          }<br>
          process_min_avail = 1<br>
        }<br>
        service imap-postlogin {<br>
          executable = script-login -d rawlog<br>
        }<br>
        service imap {<br>
          executable = imap<br>
        }<br>
        service indexer-worker {<br>
          vsz_limit = 2 G<br>
        }<br>
        service lmtp {<br>
          unix_listener /var/spool/postfix/private/dovecot-lmtp {<br>
            group = postfix<br>
            mode = 0600<br>
            user = postfix<br>
          }<br>
        }<br>
        service submission-login {<br>
          inet_listener submission {<br>
            port = 465<br>
            ssl = yes<br>
          }<br>
        }<br>
        ssl = required<br>
        ssl_cert = </etc/dovecot/private/dovecot.pem<br>
        ssl_cipher_list = EECDH+AESGCM:EDH+AESGCM<br>
        ssl_client_ca_dir = /etc/ssl/certs<br>
        ssl_curve_list = X25519:secp521r1:secp384r1:prime256v1<br>
        ssl_dh = # hidden, use -P to show it<br>
        ssl_key = # hidden, use -P to show it<br>
        ssl_min_protocol = TLSv1.2<br>
        submission_client_workarounds = whitespace-before-path<br>
        submission_relay_host = server.example.com<br>
        submission_relay_password = # hidden, use -P to show it<br>
        submission_relay_ssl = smtps<br>
        submission_relay_user = dovecot@server<br>
        userdb {<br>
          args = /etc/dovecot/ldap_list_users.conf.ext<br>
          driver = ldap<br>
          result_success = continue<br>
        }<br>
        userdb {<br>
          args = /etc/dovecot/ldap_user_domain.conf.ext<br>
          driver = ldap<br>
          result_success = continue<br>
        }<br>
        userdb {<br>
          args = uid=vmail gid=vmail home=/srv/mail/vmail
        allow_all_users=yes<br>
          driver = static<br>
        }<br>
        protocol lmtp {<br>
          mail_plugins = zlib notify push_notification listescape acl
        fts fts_xapian sieve<br>
        }<br>
        protocol lda {<br>
          mail_plugins = zlib notify push_notification listescape acl
        fts fts_xapian sieve<br>
        }<br>
        protocol imap {<br>
          mail_max_userip_connections = 50<br>
          mail_plugins = zlib notify push_notification listescape acl
        fts fts_xapian imap_acl imap_sieve<br>
        }<br>
      </font><br>
    </p>
  </body>
</html>