<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
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 class="moz-cite-prefix">On 1/24/2022 7:59 AM, Андрей Куницын
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAHN3cYhprh-MS21eixP=rPQOj25NbnSMgDuKQY8gs382kzGy=Q@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<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 class="moz-txt-link-abbreviated" href="mailto:postmaster@domain.tld">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 class="moz-txt-link-abbreviated" href="mailto:postmaster@domain.tld">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"
moz-do-not-send="true" class="moz-txt-link-freetext">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" class="gmail_signature"
data-smartmail="gmail_signature"><span class="gmail-VIiyi"
lang="en"><span class="gmail-JLqJ4b gmail-ChMk0b"><span>Sincerely,
Andrey Kunitsyn</span></span></span> </div>
</div>
</div>
</blockquote>
<br>
</body>
</html>