Clement PAULET
2013-Mar-18 09:51 UTC
[Dovecot] Dovecot - Sieve script loaded but filtering doesn't works ?
Hello,
I'm trying to install dovecot as LDA, IMAP server and Sieve functions,
all of this with a Postfix, Spamassassin and a MySQL Auth.
When I use a Sieve script, it 's loaded but actions are not respect
with this logs :
Mar 18 10:31:19 localhost dovecot: lda(info at info.xx.com): Debug: sieve:
using sieve path for user's script: /vmail/sieve/info.xx.com/info.sieve
Mar 18 10:31:19 localhost dovecot: lda(info at info.xx.com): Debug: sieve:
opening script /vmail/sieve/info.xx.com/info.sieve
Mar 18 10:31:19 localhost dovecot: lda(info at info.xx.com): Debug: sieve:
script binary /vmail/sieve/info.xx.com/info.svbin successfully loaded
Mar 18 10:31:19 localhost dovecot: lda(info at info.xx.com): Debug: sieve:
binary save: not saving binary /vmail/sieve/info.xx.com/info.svbin,
because it is already stored
Mar 18 10:31:19 localhost dovecot: lda(info at info.xx.com): Debug: sieve:
executing script from /vmail/sieve/info.xx.com/info.svbin
Mar 18 10:31:19 localhost dovecot: lda(info at info.xx.com): sieve:
msgid=<20130318093119.7EAAEC063D at nflda02.xx.lan>: stored mail into
mailbox 'INBOX'
Mar 18 10:31:19 localhost postfix/pipe[25000]: 7EAAEC063D:
to=<info at info.xx.com>, relay=dovecot, delay=0.54,
delays=0.15/0.03/0/0.37, dsn=2.0.0, status=sent (delivered via dovecot
service)
The sieve script just trying to redirect to INBOX.Test folder but
doesn't works..
Bellow my dovecot and postfix configuration :
# 2.0.9: /etc/dovecot/dovecot.conf
# OS: Linux 2.6.32-358.0.1.el6.x86_64 x86_64 CentOS release 6.4 (Final)
ext4
mail_debug = yes
mail_gid = 5000
mail_location = maildir:/vmail/%d/%n:INDEX=/vmail/index/%d/%n
mail_privileged_group = vmail
mail_uid = 5000
mbox_write_locks = fcntl
namespace {
inbox = yes
location prefix separator = .
subscriptions = yes
type = private
}
passdb {
driver = pam
}
passdb {
args = /etc/dovecot/conf.d/dovecot-sql.conf.ext
driver = sql
}
plugin {
sieve = /vmail/sieve/%d/%n.sieve
sieve_dir = /vmail/sieve/%d
}
service auth {
unix_listener auth-userdb {
group = vmail
mode = 0600
user = vmail
}
}
ssl_cert = </etc/pki/dovecot/certs/dovecot.pem
ssl_key = </etc/pki/dovecot/private/dovecot.pem
userdb {
driver = passwd
}
userdb {
args = /etc/dovecot/conf.d/dovecot-sql.conf.ext
driver = sql
}
protocol lmtp {
mail_plugins = sieve
}
protocol lda {
auth_socket_path = /var/run/dovecot/auth-userdb
mail_plugins = sieve
postmaster_address = postmaster at smtp.xx.com
}
# /etc/postfix/master.conf
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
debug_peer_level = 2
html_directory = no
inet_interfaces = all
inet_protocols = all
mail_owner = postfix
mailbox_command = /usr/libexec/dovecot/dovecot-lda -f "$SENDER" -a
"$RECIPIENT"
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
mydestination = $myhostname, localhost.$mydomain, localhost
mydomain = xx.lan
myhostname = nflda02.xx.lan
mynetworks = 192.168.0.0/24, 192.168.3.0/24, 127.0.0.0/8
myorigin = $mydomain
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES
sample_directory = /usr/share/doc/postfix-2.6.6/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
unknown_local_recipient_reject_code = 550
virtual_alias_maps = mysql:/etc/postfix/mysql_virtual_alias_maps.cf
virtual_gid_maps = static:5000
virtual_mailbox_base = /vmail/
virtual_mailbox_domains =
mysql:/etc/postfix/mysql_virtual_mailbox_domains.cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf
virtual_transport = dovecot
virtual_uid_maps = static:5000
Sorry for this easy question, I'm new on LINUX.
Thanks in advance.
--
Cl?ment PAULET
Steffen Kaiser
2013-Mar-18 12:23 UTC
[Dovecot] Dovecot - Sieve script loaded but filtering doesn't works ?
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Mon, 18 Mar 2013, Clement PAULET wrote:> When I use a Sieve script, it 's loaded but actions are not respect with this > logs : > > The sieve script just trying to redirect to INBOX.Test folder but doesn't > works..First of all, how does your script looks like? - -- Steffen Kaiser -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iQEVAwUBUUcHRl3r2wJMiz2NAQKoswf/WczI0q9k0WqWzRPr7lwuBEeiQQlYBDaq Lap8YNnbxDsczxgYZ/i0gDrq7f612A0nKWHBC806DxH4dHNyUwBPYVqFAT7edvk4 ns99f4bNh6GsufC1CY5tY/1DjT5ykEzkTmaV443YH50jQ4iPnDohOMsBBRlhoWN4 8KCLCNafCYXf48QjnAfoLt4TjaxyYb//7otYJN2CqLOGbvWoJwrpNgmuhvST+PNm RQXLG1lpxzt7QMP++fTMXa6A/SwVsglhAUS6xFdAuoOBsx1jPtvA+mot9gqpi02I j2WquMsycviWprYD2FsET903TWU/5+boxg2UBOettsTqhfwABkIcvQ==ygun -----END PGP SIGNATURE-----
Clement PAULET
2013-Mar-18 13:00 UTC
[Dovecot] Dovecot - Sieve script loaded but filtering doesn't works ?
Hello Steffen,
Thanks for your reply,
This is my script (using for my test) :
require "fileinto";
if address "To" "info at info.xx.com"
{
fileinto "Test";
}
Clement
------------------------------
Message: 7
Date: Mon, 18 Mar 2013 13:23:33 +0100 (CET)
From: Steffen Kaiser <skdovecot at smail.inf.fh-brs.de>
To: Dovecot Mailing List <dovecot at dovecot.org>
Subject: Re: [Dovecot] Dovecot - Sieve script loaded but filtering
doesn't works ?
Message-ID:
<alpine.DEB.2.02.1303181322430.3303 at pc-2m63.inf.fh-bonn-rhein-sieg.de>
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Mon, 18 Mar 2013, Clement PAULET wrote:
When I use a Sieve script, it 's loaded but actions are not respect
with this
logs :
The sieve script just trying to redirect to INBOX.Test folder but
doesn't
works..
First of all, how does your script looks like?
- --
Steffen Kaiser
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
iQEVAwUBUUcHRl3r2wJMiz2NAQKoswf/WczI0q9k0WqWzRPr7lwuBEeiQQlYBDaq
Lap8YNnbxDsczxgYZ/i0gDrq7f612A0nKWHBC806DxH4dHNyUwBPYVqFAT7edvk4
ns99f4bNh6GsufC1CY5tY/1DjT5ykEzkTmaV443YH50jQ4iPnDohOMsBBRlhoWN4
8KCLCNafCYXf48QjnAfoLt4TjaxyYb//7otYJN2CqLOGbvWoJwrpNgmuhvST+PNm
RQXLG1lpxzt7QMP++fTMXa6A/SwVsglhAUS6xFdAuoOBsx1jPtvA+mot9gqpi02I
j2WquMsycviWprYD2FsET903TWU/5+boxg2UBOettsTqhfwABkIcvQ==ygun
-----END PGP SIGNATURE-----
Clement PAULET
2013-Mar-19 14:13 UTC
[Dovecot] Dovecot - Sieve script loaded but filtering doesn't works ?
Hello Steffen,
Thanks for your help, your message has reminds me that I forget the
header specification.
This new sieve script works for me :
require ["fileinto"];
if allof (header :contains "To" "abuse at info.xx.com")
{
fileinto "INBOX.Test";
redirect "clement.xx at xx.net";
stop;
}
Thanks,
Clement
-----
Date: Mon, 18 Mar 2013 14:28:17 +0100 (CET)
From: Steffen Kaiser <skdovecot at smail.inf.fh-brs.de>
To: Dovecot Mailing List <dovecot at dovecot.org>
Subject: Re: [Dovecot] Dovecot - Sieve script loaded but filtering
doesn't works ?
Message-ID:
<alpine.DEB.2.02.1303181419590.3303 at pc-2m63.inf.fh-bonn-rhein-sieg.de>
Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Mon, 18 Mar 2013, Clement PAULET wrote:
Dear Clement,
This is my script (using for my test) :
require "fileinto";
if address "To" "info at info.xx.com"
{
fileinto "Test";
}
Works for me in v2.2.
Did you verified that the header "To" really exists in the message and
that "info at info.xx.com" is part of it? The log you've posted
displays
the
envelope information, which is not necessary the same as the header
information.
Also, remove the precompiled Sieve script, in order to ensure that the
pre-compiled one is really one from the script. You could also
decompile
it to make sure, it has been created from your test script. You'll
find
sieve-dump in src/sieve-tools/, if you compile from sources, or maybe
in
/usr/local/bin.
Daniel Parthey
2013-Mar-21 12:30 UTC
[Dovecot] Dovecot - Sieve script loaded but filtering doesn't works ?
Hi Clement, Clement PAULET wrote:> When I use a Sieve script, it is loaded but actions are not respected > Mar 18 10:31:19 localhost dovecot: lda(info at info.xx.com): sieve: msgid=<20130318093119.7EAAEC063D at nflda02.xx.lan>: stored mail into mailbox 'INBOX'If the mailbox "INBOX.Test" does not exist, the message will be delivered to mailbox "INBOX": http://wiki2.dovecot.org/LDA Try to set the global dovecot configuration directive lda_mailbox_autocreate = yes This will always autocreate folders if they do not exist yet. Alternatively you can use fileinto :create "INBOX.Test"; to autocreate the folder in your Sieve script. Regards Daniel -- https://plus.google.com/103021802792276734820