1 (edited by otto 2025-04-11 21:35:25)

Topic: run sieve-filter out of crontab

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version 1.7.2 PGSQL edition
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

Hi, pretty new to iRedMail, I want to use sieve-filters at a specific time (purpose: after a working day with several conversations I want to automatically move mails of certain people to certain folders. until then I want them in the inbox).
Now, I created a simple sieve-rule and try to execute it as user vmail. Unfortunately my system tells me:
Error: auth-master: userdb lookup(otto@blablubb.org): Auth USER lookup failed
when calling
sieve-filter -e -W -u otto /root/sieve_rules/silvia INBOX

Does anyone know how to execute sieve-rules from a shell? Which user must it be running?
And yes, I know that I could write a small python script for this, but why re-invent the wheel?
Best regards and thanks in advance,
Otto

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: run sieve-filter out of crontab

sieve-filter -e -W -u otto /root/sieve_rules/silvia INBOX

did you try otto@blablubb.org instead? i guess dovecot cant resolve otto in the userdb

Try:
doveadm user otto

If it returns no result, dovecot cannot resolve the username

3

Re: run sieve-filter out of crontab

Cthulhu wrote:
sieve-filter -e -W -u otto /root/sieve_rules/silvia INBOX

did you try otto@blablubb.org instead? i guess dovecot cant resolve otto in the userdb

Try:
doveadm user otto

If it returns no result, dovecot cannot resolve the username

Hi and thanks for your answer!
User otto does not exist, otto@blablubb.org exists, but anyway I am getting a Auth USER lookup failed when running this sieve-filter as root:
root@iredmail:~# doveadm user otto

userdb lookup: user otto doesn't exist
field   value
root@iredmail:~# doveadm user otto@blablubb.org
field   value
uid     2000
gid     2000
home    /var/vmail/vmail1/blablubb.org/o/t/t/otto-2025.03.28.23.34.23/
mail    maildir:~/Maildir
master_user     otto@blablubb.org
quota_rule      *:bytes=0
root@iredmail:~# sieve-filter -e -W -u otto@blablubb.org /tmp/silvia INBOX
sieve-filter(otto@blablubb.org)<204293><>: Error: auth-master: userdb lookup(otto@blablubb.org): Auth USER lookup failed
sieve-filter(root): Fatal: Internal error occurred. Refer to server log for more information.

4

Re: run sieve-filter out of crontab

You can try to avoid the auth-master problem by running it trough doveadm directly:

doveadm sieve execute -u otto@blablubb.org /tmp/silvia INBOX

In this case, doveadm acts as proxy and as already tested,

doveadm user otto@blablubb.org

has no resolve issues

5

Re: run sieve-filter out of crontab

unfortunately doveadm does not know sieve, I am getting usage info:
usage: doveadm [-Dv] [-f <formatter>] sieve <command> [<args>]
  activate     [-u <user>|-A] [-S <socket_path>] <scriptname>
  deactivate   [-u <user>|-A] [-S <socket_path>]
  delete       [-u <user>|-A] [-S <socket_path>] [-a] <scriptname> [...]
  get          [-u <user>|-A] [-S <socket_path>] <scriptname>
  list         [-u <user>|-A] [-S <socket_path>]
  put          [-u <user>|-A] [-S <socket_path>] [-a] <scriptname>
  rename       [-u <user>|-A] [-S <socket_path>] <oldname> <newname>

I also tried several different combinations I could imagine, but no clue :-(

6

Re: run sieve-filter out of crontab

no more ideas? :-(