1 (edited by chutkin 2017-07-18 23:46:40)

Topic: Dovecot filters do not work

==== Required information ====
- iRedMail version (check /etc/iredmail-release): 0.9.5-1
- Linux/BSD distribution name and version: OpenBSD 5.9 stable as of July 2
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Web server (Apache or Nginx):Nginx
- Manage mail accounts with iRedAdmin-Pro? NO
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

Hello guys,
I have issue with Dovecot filters.
The filters are created in user (support@mydomain.net) sieve directory but when message arrives, the filter is not applied.
Here is the content of @dovecot.sieve file:

require ["copy","vacation"];
# rule:[Vacation]
if false # true
{
        vacation :days 1 "I'm on vacation.";
}
# rule:[copy_1]
if header :is "from" "mymail@gmail.com"
{
        redirect :copy "mymail@mydomain.net";

The  managesieve.sieve file is the same.

Here is the mail log:
Jul 18 18:36:58 mail postfix/postscreen[23684]: CONNECT from [209.85.217.178]:32916 to [X.X.X.X]:25
Jul 18 18:36:58 mail postfix/postscreen[23684]: PASS OLD [209.85.217.178]:32916
Jul 18 18:36:58 mail postfix/smtpd[27944]: connect from mail-ua0-f178.google.com[209.85.217.178]
Jul 18 18:36:59 mail postfix/smtpd[27944]: Anonymous TLS connection established from mail-ua0-f178.google.com[209.85.217.178]: TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)
Jul 18 18:36:59 mail postfix/smtpd[27944]: 9F6D72CA64: client=mail-ua0-f178.google.com[209.85.217.178]
Jul 18 18:37:00 mail postfix/cleanup[13313]: 9F6D72CA64: message-id=<CAMX1FMpix=YO++cmGQ4cyiP-MwqKAaDrr=f0853byy-cMtXjxw@mail.gmail.com>
Jul 18 18:37:00 mail postfix/qmgr[767]: 9F6D72CA64: from=<mymail@gmail.com>, size=2443, nrcpt=1 (queue active)
Jul 18 18:37:00 mail postfix/smtpd[27944]: disconnect from mail-ua0-f178.google.com[209.85.217.178] ehlo=2 starttls=1 mail=1 rcpt=1 data=1 quit=1 commands=7
Jul 18 18:37:15 mail postfix/smtpd[31921]: connect from localhost[127.0.0.1]
Jul 18 18:37:15 mail postfix/smtpd[31921]: 9F93E2CA6A: client=localhost[127.0.0.1]
Jul 18 18:37:15 mail postfix/cleanup[13313]: 9F93E2CA6A: message-id=<CAMX1FMpix=YO++cmGQ4cyiP-MwqKAaDrr=f0853byy-cMtXjxw@mail.gmail.com>
Jul 18 18:37:15 mail postfix/smtpd[31921]: disconnect from localhost[127.0.0.1] ehlo=1 mail=1 rcpt=1 data=1 quit=1 commands=5
Jul 18 18:37:15 mail postfix/qmgr[767]: 9F93E2CA6A: from=<mymail@gmail.com>, size=2962, nrcpt=1 (queue active)
Jul 18 18:37:15 mail amavis[13456]: (13456-17) Passed CLEAN {RelayedInbound}, [209.85.217.178]:32916 [209.85.217.178] <mymail@gmail.com> -> <support@mydomain.net>, Queue-ID: 9F6D72CA64, Message-ID: <CAMX1FMpix=YO++cmGQ4cyiP-MwqKAaDrr=f0853byy-cMtXjxw@mail.gmail.com>, mail_id: F-X5IXnbBDoJ, Hits: -0.078, size: 2443, queued_as: 9F93E2CA6A, dkim_sd=20161025:gmail.com, 15629 ms, Tests: [DKIM_SIGNED=0.1,DKIM_VALID=-0.1,DKIM_VALID_AU=-0.1,FREEMAIL_FROM=0.001,HTML_MESSAGE=0.001,T_SPF_HELO_TEMPERROR=0.01,T_SPF_TEMPERROR=0.01]
Jul 18 18:37:15 mail postfix/smtp[12987]: 9F6D72CA64: to=<support@mydomain.net>, relay=127.0.0.1[127.0.0.1]:10024, delay=16, delays=0.42/0/0.01/16, dsn=2.0.0, status=sent (250 2.0.0 from MTA(smtp:[127.0.0.1]:10025): 250 2.0.0 Ok: queued as 9F93E2CA6A)
Jul 18 18:37:15 mail postfix/qmgr[767]: 9F6D72CA64: removed
Jul 18 18:37:16 mail postfix/pipe[9870]: 9F93E2CA6A: to=<support@mydomain.net>, relay=dovecot, delay=0.38, delays=0.02/0.06/0/0.29, dsn=2.0.0, status=sent (delivered via dovecot service)
Jul 18 18:37:16 mail postfix/qmgr[767]: 9F93E2CA6A: removed

I will appreciate you help.
Thank you,
Ivo

----

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

2

Re: Dovecot filters do not work

Please turn on debug mode in Dovecot, send a testing email to trigger the sieve filter, then check Dovecot debug log to figure it out. FYI:
http://www.iredmail.org/docs/debug.dovecot.html

3

Re: Dovecot filters do not work

SOLVED
Thanks for reply ZhangHuangbin,
It was the problem in filter "rule construction", not the mail server filtering process.

Thanks for the grate product!

Ivo