1

Topic: sieve-filter re-filter messages in the INBOX

==== Required information ====
- iRedMail version (check /etc/iredmail-release): 0.8.7
- Linux/BSD distribution name and version: Ubuntu 14.04 LTS trusty
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Web server (Apache or Nginx): Apache
- Manage mail accounts with iRedAdmin-Pro? No
- Related log if you're reporting an issue:
====

I've created a new filter, and would like to send all the INBOX messages through the new filter so I don't have to move all the messages manually.

I followed this:
https://mebsd.com/configure-freebsd-ser … email.html

First thing I cannot find out, what is dovecot-pigeonhole version?  $dovecot --version ==> 2.2.9

But I proceed anyway with:

$sieve-filter -v -C -u alexxxx
/var/vmail/vmail1/fqdn.domain.name/a/l/e/alexxxx2014.05.14.16.59.29/sieve/managesieve.sieve 'INBOX'

sieve-filter(pcxxxx): Error: userdb lookup: connect(/var/run/dovecot/auth-userdb) failed: Permission denied (euid=1000(pcxxxx) egid=1000(pcxxxx) missing +r perm: /var/run/dovecot/auth-userdb, we're not in group 2000(vmail), dir owned by 0:0 mode=0755)
sieve-filter(pcxxxx): Fatal: Internal error occurred. Refer to server log for more information.

1. pcxxxx (using xxxx to obscure sensitive account name) is the account I am logged in with
2. alexxxx is the email account I want to refilter
3. Which server log should I refer to?
    * Log files:
        - /var/log/dovecot.log              <-----I used this one
        - /var/log/dovecot-sieve.log
        - /var/log/dovecot-lmtp.log

Looking at auth-userdb
srw-rw---- 1 vmail   vmail      0 Sep  7 09:26 auth-userdb
chmod to
srw-rw-rw- 1 vmail   vmail      0 Sep  7 09:26 auth-userdb

Running the same sieve-filter command gives:
sieve-filter(pcxxxx): Error: user alert: Auth USER lookup failed
sieve-filter(pcxxxx): Fatal: Internal error occurred. Refer to server log for more information.

Follow this for verbose mode http://www.iredmail.org/docs/debug.dovecot.html and restart dovecot

# Logging. Reference: http://wiki2.dovecot.org/Logging
log_path = /var/log/dovecot.log
mail_debug = yes
auth_verbose = yes
auth_debug = yes
auth_debug_passwords = no
# Possible values: no, plain, sha1.
auth_verbose_passwords = no

Running the sieve-filter command again shows this in the /var/log/dovecot.log

Sep 08 11:26:13 auth-worker(11530): Warning: mysql: Query failed, retrying: Unknown column 'mailbox.enablesieve-filter' in 'where clause'

Added column to vmail.mailbox with tinyint value of 1

This is the final try with -u alexxxx

pcxxxx@xx:~$ sieve-filter -v -C -u alert /var/vmail/vmail1/fqdn.domain.name/a/l/e/alexxxx-2014.05.14.16.59.29/sieve/managesieve.sieve 'INBOX'
sieve-filter(pcxxxx): Debug: Loading modules from directory: /usr/lib/dovecot/modules
sieve-filter(pcxxxx): Debug: Module loaded: /usr/lib/dovecot/modules/lib10_quota_plugin.so
sieve-filter(pcxxxx): Debug: auth input:
sieve-filter(pcxxxx): Fatal: Unknown user

log file:
Sep 08 11:39:29 auth-worker(11659): Info: sql(alexxxx): unknown user

I note that the accounts in the mailbox.username contain fqdn, so I try:

This is final try  with -u alexxxx@fqdn.domain.name

pcxxxx@pcn:~$ sieve-filter -v -C -u alexxxx@fqdn.domain.name/var/vmail/vmail1/fqdn.domain.name/a/l/e/alexxxx-2014.05.14.16.59.29/sieve/managesieve.sieve 'INBOX'
sieve-filter(pcxxxx): Debug: Loading modules from directory: /usr/lib/dovecot/modules
sieve-filter(pcxxxx): Debug: Module loaded: /usr/lib/dovecot/modules/lib10_quota_plugin.so
sieve-filter(pcxxxx): Error: user alert@fqdn.domain.name: Auth USER lookup failed
sieve-filter(pcxxxx): Debug: auth input:
sieve-filter(pcxxxx): Fatal: Internal error occurred. Refer to server log for more information.

log file:
Sep 08 11:43:49 auth: Error: userdb(alexxxxx@fqdn.domain.name): client doesn't have lookup permissions for this user: userdb reply doesn't contain uid (to bypass this check, set: service auth { unix_listener /var/run/dovecot/auth-userdb { mode=0777 } })


I hope I'm on the completely wrong track and there is a much more simple approach that you can share.  I'm still looking into setting mode=0777.  Thanks for your support.

----

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

2

Re: sieve-filter re-filter messages in the INBOX

Please use the full email address as username for '-u' flag.

3

Re: sieve-filter re-filter messages in the INBOX

I have already tried (see original post): -u alexxxx@fqdn.domain.name, still with error.
So modified /etc/dovecot/dovecot.conf and changed mode=0777 as the error log said.
Still did not work until I did a sudo su and ran as root.  Did not work just to sudo sieve-filter.

The case is solved.  However, if there was a better approach, please let me know.  Thanks!