Roundcube Community Forum

News and Announcements => General Discussion => Topic started by: marciano on April 06, 2023, 07:09:54 AM

Title: Filters do not respond
Post by: marciano on April 06, 2023, 07:09:54 AM
AlmaLinux9
Filters are not available by default so I first  edited config.inc.php and included managesieve
$config['plugins'] = ['managesieve', 'acl', 'additional_message_headers', ...

Server install
dnf install dovecot-pigeonhole

At /etc/dovecot/conf.d/20-managesieve.conf  I uncommented Protocols
# Uncomment to enable managesieve protocol:
protocols = $protocols sieve

and added
service managesieve-login {
  inet_listener sieve {
port = 4190
  }
  service_count      = 1
  process_min_avail = 1
}

Appled changes.
At csf conf firewall I opened the port 4190 and restart.

Now I am able to create filters but they don't work: mails that have to be stored at New Folder are sent to Inbox
Thanks in advance for help

Title: Re: Filters do not respond
Post by: JohnDoh on April 06, 2023, 12:01:04 PM
Enabling a managesieve server is only half the job, that lets you manage the rules. You also need to setup the Sieve plugin in your delivery process to apply the rules. See https://doc.dovecot.org/configuration_manual/sieve/pigeonhole_sieve_interpreter/
Title: Re: Filters do not respond
Post by: marciano on April 06, 2023, 03:03:27 PM
Thanks for your reply.
At 20-lmtp.conf and 15-lda.conf I added
mail_plugins = $mail_plugins sieve
and at 90-sieve.conf I have the default setting
plugin {
    sieve = file:~/sieve;active=~/.dovecot.sieve
}

Dovecot protocols are LMTP, POP3, IMAP, sieve and submission.
I still cannot get the filter work.
What am I missing?
Thank you
Title: Re: Filters do not respond
Post by: Dmitry42 on April 07, 2023, 12:02:15 AM
/etc/dovecot/conf.d/20-managesieve.conf

Quote# Uncomment to enable managesieve protocol:
protocols = $protocols sieve

# Service definitions

service managesieve-login {
  inet_listener sieve {
    port = 4190
  }
Title: Re: Filters do not respond
Post by: Dmitry42 on April 07, 2023, 12:04:17 AM
/etc/dovecot/conf.d/90-sieve.conf

I have no changes - all string commented by # sign
#  sieve = file:~/sieve;active=~/.dovecot.sieve
Title: Re: Filters do not respond
Post by: Dmitry42 on April 07, 2023, 12:08:09 AM
QuoteAt 20-lmtp.conf and 15-lda.conf I added

One time is enough.

All .conf files merge to one big configuration, so double string not needed
Title: Re: Filters do not respond
Post by: marciano on April 07, 2023, 10:30:43 AM
Hi Dmitry,
No way to get the filter make its job.
I created a new folder TEST and created a filter
Scope 'matching any of the following rules'
'From'
'Contains', STRING,
'Move messages to' TEST

Receiving mails from [email protected] they go to Inbox, not delivered to folder TEST
Title: Re: Filters do not respond
Post by: Dmitry42 on April 07, 2023, 10:23:13 PM
may be this mini instruction can help you check all your settinngs

https://www.dmosk.ru/miniinstruktions.php?mini=roundcube-managesieve

if you need translate from Russian - just tell me
Title: Re: Filters do not respond
Post by: marciano on April 08, 2023, 12:38:02 PM
Hi Dmitry.
Using Chrome I can translate webpages. For now it is good. It also translates commands!! ;)  :D

I had installed dovecot-pigeonhole package. It contains Sieve and Managesieve

That page recommends dovecot-sieve and  dovecot-managesieved which I don't have in my repositories, Managesieve daemon?

In my case in /etc/dovecot/conf.d/10-mail.conf it is mail_location = maildir:~/Maildir

I use LMTP protocol instead of LDA. Anyway, as said before mail_plugins is set in lmtp conf.
Same as protocols and port listener at managesieve.conf

/etc/dovecot/conf.d/90-sieve.conf
has
sieve = file:~/sieve;active=~/.dovecot.sieve
but none of those vars are in commented lines:
sieve_global_path,  sieve_dir,  sieve_global_dir
Are they needed?

In Roundcube config I added
$config['managesieve_host'] = 'localhost';
as suggested in that webpage. Is it really needed?

Anyway filter isn't working.

I enabled use of procmail for end users and I got a filter/recipe work correctly. Then I disabled it again not to confuse the things.

In maillog I see
QuoteApr  8 13:12:21 host postfix/local[201960]: AEDAC8A10C5: to=..., orig_to=..., relay=local, delay=5.4, delays=0.25/0/0/5.2, dsn=2.0.0, status=sent (delivered to command: /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME)
Procmail log:
QuoteFrom STRING@...  Sat Apr  8 13:12:15 2023
Subject: test 1
  Folder: /Path-to/Maildir/new/1680970341.202237_0.host....
Time:1680970341 From:STRING@... To:me@ User:me Size:2261 Dest:/Path-to/Maildir/new/1680970341.202237_0.host... Mode:None
(Inbox)
Title: Re: Filters do not respond
Post by: Dmitry42 on April 09, 2023, 10:41:00 PM
QuoteThat page recommends dovecot-sieve and  dovecot-managesieved which I don't have in my repositories, Managesieve daemon?
Yes, its service who work with rules. Its work on 4190 port

Quote/etc/dovecot/conf.d/90-sieve.conf has
sieve = file:~/sieve;active=~/.dovecot.sieve
but none of those vars are in commented lines:
sieve_global_path,  sieve_dir,  sieve_global_dir
Are they needed?

As I understand its places where filter rules can be stored. For my it's enabled too. In my conf /mailboxes/ - folder with mailboxes.
sieve_dir = /mailboxes/.sieve/%n/
sieve = /mailboxes/.sieve/%n/dovecot.sieve
sieve_global_dir = /mailboxes/.sieve/global/
sieve_global_path = /mailboxes/.sieve/default.sieve

QuoteIn Roundcube config I added
$config['managesieve_host'] = 'localhost';
as suggested in that webpage. Is it really needed?
I think yes. I use:
$config['managesieve_host'] = 'localhost';
$config['plugins'] = ['managesieve',.......]


may be some problem with users right to mailbox folders?
I have not idea (
Title: Re: Filters do not respond
Post by: marciano on April 11, 2023, 10:14:19 AM
QuoteQuote

    That page recommends dovecot-sieve and  dovecot-managesieved which I don't have in my repositories, Managesieve daemon?

Yes, its service who work with rules. Its work on 4190 port
Must I have it running?
I don't see it in modern install instructions.
QuoteAs I understand its places where filter rules can be stored. For my it's enabled too. In my conf /mailboxes/ - folder with mailboxes.
sieve_dir = /mailboxes/.sieve/%n/
sieve = /mailboxes/.sieve/%n/dovecot.sieve
sieve_global_dir = /mailboxes/.sieve/global/
sieve_global_path = /mailboxes/.sieve/default.sieve
I don't have .sieve directories.
They are:
/path-to-users-home/.dovecot.sieve file containing Rules
and
/path-to-users-home/sieve/managesieve.sieve
same file as dovecot.sieve
Quotemay be some problem with users right to mailbox folders?
I have not idea (
I didn't change file/dir rights by myself. They were untouched from installation

Thanks
Title: Re: Filters do not respond
Post by: Dmitry42 on April 12, 2023, 12:31:13 PM
I don't know what I can do additional for you.

I think you must read more instructions or tutorials about install sieve to your configuration..
Title: Re: Filters do not respond
Post by: marciano on April 12, 2023, 05:42:06 PM
I've read this page https://www.linuxbabe.com/redhat/install-roundcube-webmail-centos-8-rhel-8-apache-nginx
AlmaLinux 9 is near Centos 8.
There are several steps I don't they are really needed comparing to other tutorials.
I gave up.
I'll be using on demand procmailrc recipes that work good. I only have few users.
Thank you all.
Title: Re: Filters do not respond
Post by: Stig04 on November 02, 2024, 02:17:28 PM
hello,

I have same problem, I finally managed to connect filter to server, so dont get any errors or warnings.

But filters dont do anything, I have installed roundcube on domain level on server, one roundcube intallation for each domain.
ex, www.domain.com, roundcube is installed on www.webmail.domain.com

I am not sure if I have set up directory correct or if anything else.

Any help would be very much appreciated.

thanks