Sieve not filtering
Hi,
I have copied accross a known-good sieve file from a working server and its not filtering. Everything just gets chucked into INBOX.
doveconf-n at the bottom of this mail
Feb 17 16:05:20 server postfix/smtpd[51562]: 7FA5E12CBBC: client=unknown[192.168.167.57] Feb 17 16:05:23 server postfix/cleanup[51565]: 7FA5E12CBBC: message-id=<> Feb 17 16:05:23 server postfix/qmgr[45471]: 7FA5E12CBBC: from=sender@example.com, size=182, nrcpt=1 (queue active) Feb 17 16:05:23 server dovecot: lmtp(51467): Connect from local Feb 17 16:05:23 server dovecot: auth-worker(51568): passwd(recipient@example.com): unknown user Feb 17 16:05:23 server dovecot: lmtp(51467, recipient@example.com): 1JK2B0Mfp1gLyQAAHLpRfg: sieve: msgid=unspecified: stored mail into mailbox 'INBOX' Feb 17 16:05:23 server dovecot: lmtp(51467): Disconnect from local: Successful quit Feb 17 16:05:23 server postfix/lmtp[51566]: 7FA5E12CBBC: to=recipient+something@example.com, orig_to=recipient+something@example.com, relay=server.example.com[private/dovecot-lmtp], delay=4.9, delays=4.9/0.01/0/0.05, dsn=2.0.0, status=sent (250 2.0.0 bp+nanog@example.com 1JK2B0Mfp1gLyQAAHLpRfg Saved) Feb 17 16:05:23 server postfix/qmgr[45471]: 7FA5E12CBBC: removed
This is the syntax I'm using in my sieve file: require ["fileinto","envelope"]; if anyof (address :is :all "to" ["recipient+something@example.com”,”mailing_list@example.com”], header :contains ["Cc", "Delivered-To"] ["recipient+something@example.com”,”mailing_list@example.com”]) { fileinto “THIS_FOLDER”; stop; }
# 2.2.10: /etc/dovecot/dovecot.conf
# OS: Linux 3.10.0-514.6.1.el7.x86_64 x86_64 CentOS Linux release
7.3.1611 (Core)
auth_mechanisms = plain login
auth_verbose = yes
auth_verbose_passwords = sha1
first_valid_uid = 1000
mail_location = maildir:~/Maildir
managesieve_notify_capability = mailto
managesieve_sieve_capability = fileinto reject envelope
encoded-character vacation subaddress comparator-i;ascii-numeric
relational regex imap4flags copy include variables body environment
mailbox date ihave enotify
mbox_write_locks = fcntl
namespace inbox {
inbox = yes
location =
mailbox Drafts {
special_use = \Drafts
}
mailbox Junk {
special_use = \Junk
}
mailbox Sent {
special_use = \Sent
}
mailbox "Sent Messages" {
special_use = \Sent
}
mailbox Trash {
special_use = \Trash
}
prefix =
}
passdb {
driver = pam
}
passdb {
driver = pam
}
passdb {
args = scheme=CRYPT username_format=%u /etc/dovecot/users
driver = passwd-file
}
plugin {
sieve = ~/.dovecot.sieve
}
protocols = imap lmtp
service auth {
unix_listener /var/spool/postfix/private/dovecot-auth {
group = postfix
mode = 0660
user = postfix
}
unix_listener auth-userdb {
group = its_virtmail
mode = 0660
user = its_virtmail
}
}
service imap-login {
process_min_avail = 3
}
service lmtp {
process_min_avail = 5
unix_listener /var/spool/postfix/private/dovecot-lmtp {
group = postfix
mode = 0600
user = postfix
}
user = its_virtmail
}
service managesieve-login {
inet_listener sieve {
port = 4190
}
inet_listener sieves {
address =
port = 5190
ssl = yes
}
}
ssl = required
ssl_cert =
On 17 February 2017, at 08:24, Ben ben+dovecot@list-subs.com wrote:
Hi,
I have copied accross a known-good sieve file from a working server and its not filtering. Everything just gets chucked into INBOX.
What I did when encountering a similar issue was to take one of the messages from INBOX that should have been moved elsewhere and use sieve-test on it:
sieve-test -Tlevel=matching <sieve source file> <message file>
That generates a lot of output as it goes through every line of the sieve file and shows the actual values that are used for the tests. However, it pointed out my problem quite clearly.
What I did when encountering a similar issue was to take one of the messages from INBOX that should have been moved elsewhere and use sieve-test on it:
sieve-test -Tlevel=matching <sieve source file> <message file>
That generates a lot of output as it goes through every line of the sieve file and shows the actual values that are used for the tests. However, it pointed out my problem quite clearly.
Thank you for this.
Actually, after many hours of head-bashing, I discovered the problem.
sieve doesn't work when you're just using telnet port 25 !
I was doing : ehlo test mail from:sender@example.com rcpt to:recip@example.com data Subject: hello world Hello World ! .
With the above, sieve was simply sending everything to INBOX
When I changed my methodology : ehlo test mail from:sender@example.com rcpt to:recip@example.com data From:sender@example.com To:recip@example.com Subject: hello world Hello World ! .
It worked as expected.
On 2017-02-18, Ben ben+dovecot@list-subs.com wrote:
What I did when encountering a similar issue was to take one of the messages from INBOX that should have been moved elsewhere and use sieve-test on it:
sieve-test -Tlevel=matching <sieve source file> <message file>
That generates a lot of output as it goes through every line of the sieve file and shows the actual values that are used for the tests. However, it pointed out my problem quite clearly.
Thank you for this.
Actually, after many hours of head-bashing, I discovered the problem.
sieve doesn't work when you're just using telnet port 25 !
I was doing : ehlo test mail from:sender@example.com rcpt to:recip@example.com data Subject: hello world Hello World ! .
With the above, sieve was simply sending everything to INBOX
When I changed my methodology : ehlo test mail from:sender@example.com rcpt to:recip@example.com data From:sender@example.com To:recip@example.com Subject: hello world Hello World ! .
It worked as expected.
The first one works as expected too; your rule used "address" so it is correct that it didn't look at the envelope address. You want e.g.
envelope "to" "foo@example.org"
Thank you for this.
Actually, after many hours of head-bashing, I discovered the problem.
sieve doesn't work when you're just using telnet port 25 !
I was doing : ehlo test mail from:sender@example.com rcpt to:recip@example.com data Subject: hello world Hello World ! .
With the above, sieve was simply sending everything to INBOX
When I changed my methodology : ehlo test mail from:sender@example.com rcpt to:recip@example.com data From:sender@example.com To:recip@example.com Subject: hello world Hello World ! .
It worked as expected.
The first one works as expected too; your rule used "address" so it is correct that it didn't look at the envelope address. You want e.g.
envelope "to" "foo@example.org" Will take a look. Thanks !
Am 18.02.2017 um 17:44 schrieb Ben:
[ ... ]
Actually, after many hours of head-bashing, I discovered the problem.
sieve doesn't work when you're just using telnet port 25 !
I was doing : ehlo test mail from:sender@example.com rcpt to:recip@example.com data Subject: hello world Hello World ! .
With the above, sieve was simply sending everything to INBOX
When I changed my methodology : ehlo test mail from:sender@example.com rcpt to:recip@example.com data From:sender@example.com To:recip@example.com Subject: hello world Hello World ! .
It worked as expected.
Just for the record: please don't use that invalid syntax.
Alexander
participants (5)
-
Alexander Dalloz
-
Ben
-
Ben
-
Doug Hardie
-
Stuart Henderson