<div dir="ltr"><div>Hm, looks like I misunderstood initial error <span style="font-family:monospace">sieve-filter(root): Fatal: Unknown user<br></span></div><div><span style="font-family:monospace"><span style="font-family:arial,sans-serif"><span style="font-family:monospace">filter-sieve</span> do not understand <span style="font-family:monospace">-u postmater@domain.tld</span><br>Where </span>(root)<span style="font-family:arial,sans-serif"> is about who runs the command, not who is not found</span><br></span></div><div><br></div><div>Anyway I've tried</div><div><br></div><div><span style="font-family:monospace">#</span> <span style="font-family:monospace"><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">cd /var/vmail/vmail1/domain.tld/t/e/s/test-2022.01.22.05.55.26/sdbox/mailboxes/</span><br></span></div><div><span style="font-family:monospace"><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">#sieve-filter -c /etc/dovecot/dovecot.conf -v /var/vmail/sieve/dovecot.sieve INBOX                      </span><br>sieve-filter(root): Error: stat(/root/Maildir/tmp) failed: Permission denied (euid=2000(vmail) egid=2000(vmail) missing +x perm: /root, dir owned by 0:0 mode=0700)
<br>sieve-filter(root): Fatal: Couldn't open source mailbox 'INBOX': Internal error occurred. Refer to server log for more information. [2022-01-25 14:46:35]<br></span></div><div><span style="font-family:monospace"><br></span></div><div><span style="font-family:monospace"><span style="font-family:monospace"><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">sudo -u vmail sieve-filter -c /etc/dovecot/dovecot.conf -v /var/vmail/sieve/dovecot.sieve INBOX                                                                          </span><br>sieve-filter(vmail): Info: Mailbox created: INBOX</span></span></div><div><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:arial,sans-serif"><br></span></span></span></div><div><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:arial,sans-serif"><span style="font-family:monospace">/home/vmail/Maildir</span> was created after that and  not in the current directory</span><br></span></span></div><div><span style="font-family:monospace"><span style="font-family:monospace"><br></span></span></div><div><span style="font-family:monospace"><span style="font-family:monospace"><font face="arial,sans-serif">I've tried  '-u </font>test', '-u test@domain.tld', '-u test@mail.domain.tld' <span style="font-family:arial,sans-serif">and passed config  </span>'-c <span style="font-family:monospace"><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">/etc/dovecot/dovecot.conf.'<br><span style="font-family:arial,sans-serif">And still got</span><br>Fatal: Unknown user</span></span></span></span></div><div><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)"><br></span></span></span></span></div><div><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)"><span style="font-family:arial,sans-serif">How do sieve-filters understand virtual users?</span><br></span></span></span></span></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">вт, 25 янв. 2022 г. в 18:31, Eric Wood <<a href="mailto:eric@interplas.com">eric@interplas.com</a>>:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
  
    
  
  <div>
    I read the sieve-filter man page so I'll speculate.   Granted, I
    still don't fully understand how sieve and virtual users work as I
    have never set this up.<br>
    <br>
    "postmaster" is an alias of root and "vmail" is probably just a
    directory name.   So, from the root's command prompt, the
    environment variables probably aren't totally set up for
    sieve-filter to understand virtual users.<br>
    <br>
    So, working from the command prompt, you probably have to explicitly
    specify the .sieve path and leave off the -u argument<br>
    <br>
    <span style="font-family:monospace"><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)"># cd
        /location_of_virtual_user_INBOX</span></span><br>
    <span style="font-family:monospace"><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">#
        sieve-filter -v /opt/some_global_rules/sieve/managesieve.sieve
        INBOX
        <br>
        <br>
      </span></span>Would is be great if seive-filter had an argument to
    understand the system's virual user's settings?  Of course.  I don't
    know why the developer haven't included it.<br>
    <br>
    -Eric<br>
    <br>
    <div>On 1/24/2022 7:59 AM, Андрей Куницын
      wrote:<br>
    </div>
    <blockquote type="cite">
      
      <div dir="ltr">
        <div>Hello</div>
        <div>I try to test my sieve script, but found out that it is
          impossible to use a sieve-filter tool with virtual mail users.
          It always uses a real user name instead of passed via -u
          argument.</div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div><span style="font-family:monospace"><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">#
              sieve-filter -v -u <a href="mailto:postmaster@domain.tld" target="_blank">postmaster@domain.tld</a>
              ~/sieve/managesieve.sieve INBOX
            </span><br>
            sieve-filter(root): Fatal: Unknown user<br>
          </span></div>
        <div><br>
        </div>
        <div><span style="font-family:monospace"><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">sudo
              -u vmail sieve-filter -u <a href="mailto:postmaster@domain.tld" target="_blank">postmaster@domain.tld</a>
              ~/sieve/managesieve.sieve INBOX
            </span><br>
            sieve-filter(vmail): Fatal: Unknown user<br>
          </span></div>
        <div><span style="font-family:monospace"><br>
          </span></div>
        <div><span style="font-family:monospace">Also there is the same
            question on serverfault, but without an answer.<br>
          </span></div>
        <div><span style="font-family:monospace"></span></div>
        <div><span style="font-family:monospace"><a href="https://serverfault.com/questions/1055407/how-to-make-sieve-filter-use-virtual-users" target="_blank">https://serverfault.com/questions/1055407/how-to-make-sieve-filter-use-virtual-users</a></span></div>
        <div><br>
        </div>
        <div>My environment is Ubuntu 20.04</div>
        <div><span style="font-family:monospace"><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">dovecot
              --version
            </span><br>
            2.3.7.2 (3c910f64b)<br>
          </span></div>
        <div><br>
          -- <br>
          <div dir="ltr"><span lang="en"><span><span>Sincerely,
                  Andrey Kunitsyn</span></span></span> </div>
        </div>
      </div>
    </blockquote>
    <br>
  </div>

</blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature">С уважением, Куницын Андрей.<br></div>