Dovecot and Sieve are working, but Sieve not delivery mail

Hello everyone.

This subject is similar to the topic below, however the topic below was not able to solve my problem.

Problem: The sieve / dovecot filters are not being applied. The email is delivered, but is not moved to the FOLDER1 folder when the subject contains x23

Can anyone help?

Filters

`cat /home/user1/.dovecot.sieve`

require ["fileinto"];
# rule:[test x23]
if allof (header :contains "subject" "x23")
{
        fileinto "FOLDER1";
}

Dovecot works normally

telnet 127.0.0.1 4190

Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
"IMPLEMENTATION" "Dovecot (Ubuntu) Pigeonhole"
"SIEVE" "fileinto reject envelope encoded-character vacation subaddress comparator-i;ascii-numeric relational regex imap4flags copy include variables body enotify environment mailbox date ihave"
"NOTIFY" "mailto"
"SASL" "PLAIN LOGIN"
"STARTTLS"
"VERSION" "1.0"
OK "Dovecot ready."

I have the following dovecot configuration

/etc/dovecot/dovecot.conf

# Enable installed protocols
!include_try /usr/share/dovecot/protocols.d/*.protocol
instance_name = dovecot
# Greeting message for clients.
login_greeting = Dovecot ready.
!include conf.d/*.conf
!include_try local.conf

/etc/dovecot/conf.d/15-lda.conf

protocol lda {
  # Space separated list of plugins to load (default is global mail_plugins).
  mail_plugins = $mail_plugins sieve
}

/etc/dovecot/conf.d/20-lmtp.conf

protocol lmtp {
  # Space separated list of plugins to load (default is global mail_plugins).
  #mail_plugins = $mail_plugins
  mail_plugins = $mail_plugins sieve
}

/etc/dovecot/conf.d/90-sieve.conf

plugin {
  sieve = ~/.dovecot.sieve
  sieve_default = /var/lib/dovecot/sieve/default.sieve
  sieve_global_dir = /var/lib/dovecot/sieve/
  sieve_global_path = /var/lib/dovecot/sieve/default.sieve
}

And in procmailrc I have:

/etc/procmailrc

DELIVER=/usr/lib/dovecot/deliver
LOGFILE=/var/log/procmail.log
TRAP=/etc/webmin/virtual-server/procmail-logger.pl
:0wi
VIRTUALMIN=|/etc/webmin/virtual-server/lookup-domain.pl $LOGNAME
EXITCODE=$?
:0
* ?/usr/bin/test "$EXITCODE" = "73"
/dev/null
EXITCODE=0
:0
* ?/usr/bin/test "$VIRTUALMIN" != ""
{
INCLUDERC=/etc/webmin/virtual-server/procmail/$VIRTUALMIN
}
DEFAULT=$HOME/Maildir/
ORGMAIL=$HOME/Maildir/
DROPPRIVS=yes
:0 w
| $DELIVER
:0
$DEFAULT

In postfix mailbox_command

/etc/postfix/main.cf

mailbox_command = /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME

Server log when I send an email with subject x23

tailf /var/log/mail.log

Sep 23 16:11:13 mailserver postfix/smtpd[14822]: connect from XXXXXXXXXXXXXX[YY.XX.AA.341]
Sep 23 16:11:13 mailserver postfix/smtpd[14822]: Anonymous TLS connection established from XXXXXXXXXXXXXX[YY.XX.AA.341]: TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)
Sep 23 16:11:13 mailserver policyd-spf[16602]: None; identity=helo; client-ip=YY.XX.AA.341; helo=XXXXXXXXXXXXXX; envelope-from=from@domain_send.com; receiver=receiver@domain_receiver.com
Sep 23 16:11:13 mailserver policyd-spf[16602]: Pass; identity=mailfrom; client-ip=YY.XX.AA.341; helo=XXXXXXXXXXXXXX; envelope-from=from@domain_send.com; receiver=receiver@domain_receiver.com
Sep 23 16:11:13 mailserver postgrey[2322]: action=pass, reason=triplet found, client_name=XXXXXXXXXXXXXX, client_address=YY.XX.AA.341, sender=from@domain_send.com, recipient=receiver@domain_receiver.com
Sep 23 16:11:13 mailserver postgrey[2322]: cleaning up old logs...
Sep 23 16:11:13 mailserver postfix/smtpd[14822]: 818C180A2F: client=XXXXXXXXXXXXXX[YY.XX.AA.341]
Sep 23 16:11:13 mailserver postfix/cleanup[11829]: 818C180A2F: replace: header Message-ID: <5c58fd6232920fa283f88c5c48ad5e20@AAAAAA.com> from XXXXXXXXXXXXXX[YY.XX.AA.341]; from=<from@domain_send.com> to=<receiver@domain_receiver.com> proto=ESMTP helo=<XXXXXXXXXXXXXX>: Message-ID: <5c58fd6232920fa283f88c5c48ad5e20@ZZZZZ.com>
Sep 23 16:11:13 mailserver postfix/cleanup[11829]: 818C180A2F: message-id=<5c58fd6232920fa283f88c5c48ad5e20@ZZZZZ.com>
Sep 23 16:11:13 mailserver opendkim[3867]: 818C180A2F: s=mail d=AAAAAA.com SSL
Sep 23 16:11:13 mailserver postfix/qmgr[11747]: 818C180A2F: from=<from@domain_send.com>, size=2055, nrcpt=1 (queue active)
Sep 23 16:11:13 mailserver postfix/smtpd[14822]: disconnect from XXXXXXXXXXXXXX[YY.XX.AA.341]
Sep 23 16:11:14 mailserver postfix/pickup[11746]: 1506081436: uid=1001 from=<from@domain_send.com>
Sep 23 16:11:14 mailserver postfix/cleanup[11829]: 1506081436: replace: header Message-ID: <5c58fd6232920fa283f88c5c48ad5e20@ZZZZZ.com> from local; from=<from@domain_send.com> to=<ZZZZZ@mailserver>: Message-ID: <5c58fd6232920fa283f88c5c48ad5e20@ZZZZZ.com>
Sep 23 16:11:14 mailserver postfix/cleanup[11829]: 1506081436: message-id=<5c58fd6232920fa283f88c5c48ad5e20@ZZZZZ.com>
Sep 23 16:11:14 mailserver opendkim[3867]: 1506081436: s=mail d=AAAAAA.com SSL
Sep 23 16:11:14 mailserver postfix/pipe[16604]: 818C180A2F: to=<ZZZZZ@mailserver>, orig_to=<receiver@domain_receiver.com>, relay=spamassassin, delay=0.95, delays=0.72/0/0/0.23, dsn=2.0.0, status=sent (delivered via spamassassin service)
Sep 23 16:11:14 mailserver postfix/qmgr[11747]: 818C180A2F: removed
Sep 23 16:11:14 mailserver postfix/qmgr[11747]: 1506081436: from=<from@domain_send.com>, size=2557, nrcpt=1 (queue active)

Can anyone help?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.