-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Fri, 23 Oct 2015, James wrote:
I'm attempting to use sieve-filter on a local mailbox.
I've defined mail_location as follows: % grep mail_location /etc/dovecot/conf.d/10-mail.conf mail_location = maildir:~/Mail
I have a large number of mailboxes / mail in ~/Mail:
~ % find Mail | wc -l 63158
There are definitely a few messages in INBOX:
~ % find Mail/INBOX/cur | wc -l 5
Actually, plain Maildir in Dovecot uses "Mail/cur" and "Mail/new". So either your mail_location is wrong (maybe it comes from the userdb) or your layout. Perhaps rename that directory "Mail/INBOX" -> "Mail/.testbox"
I must admit, I'm completely new to sieve and have just begun experimenting with it. Based on a super helpful blog post[1], I quick set up the following ~/.sieve:
% cat ~/.sieve require ["fileinto"]; # rule:[TEST] if header :contains "Subject" "Test Email" { fileinto "TEST"; stop; }
As mentioned, there are numerous emails in INBOX. This email is located in ~/Mail/INBOX/cur/<blah> and, for verbosity (and to ensure I'm not making a foolish mistake), I've displayed it here:
From: Test Account test@test.com To: "Me" me@test.com Subject: Test Email Date: Mon, 19 Oct 2015 14:55:06 +0000
This is a test email.
Looking at the sieve filter recipe and email message, it appears that I should have a match, no? sieve-filter appears to disagree:
% sieve-filter -C ~/.sieve INBOX sieve-filter(test_user): Debug: Effective uid=1000, gid=1000, home=/home/test_user sieve-filter(test_user): Debug: Namespace inbox: type=private, prefix=, sep=, inbox=yes, hidden=no, list=yes, subscriptions=yes location=maildir:~/Mail sieve-filter(test_user): Debug: maildir++: root=/home/test_user/Mail, index=, indexpvt=, control=, inbox=/home/test_user/Mail, alt=
Thinking this was because sieve will only filter on new messages, I moved the file from cur to new. No change.
Any thoughts on why this may be happening?
my version of sieve-filter does not output anything, regardless of the settings -v and -D, if and only if it found no message.
I suspect, that mailbox "INBOX" in /home/test_user/Mail does not belong to /home/test_user/Mail/INBOX/{cur,new}, but to /home/test_user/Mail/{cur,new}.
Rename INBOX to .testbox and try with
sieve-filter -C ~/.sieve testbox
Steffen Kaiser -----BEGIN PGP SIGNATURE----- Version: GnuPG v1
iQEVAwUBVinVPnz1H7kL/d9rAQIXaggAiJPHMB06mybOgWYQH3umgsr6HhHxnv5n 5CV6Yb1xZsW9fuPFlua6FWx+KoBlG24+FOCNRnug/YEnmU/1QhJkfBjhB3BIGBKC YkAk2iz52FlXdDIramh10S2u/mT62UT7iuFm2snU2se5A63fABBOWcIahZih5Pc5 fSPZud85Ms4qp567V7PNbhBEqDE+piQOVWlThGkUF7ARgm3d14j2F8HfEsTKrZu5 CzaTbHiRWBkRX2AGYVGGG1LpZ0ebcCFiZt2N8gJ+78x3savF67zZtQrpBteFeVfu juPSYz4ukqGzC8BX4pqBHC8RBiLcjBFuA1ZrKAq8GtA9clF+4eEOSQ== =zc79 -----END PGP SIGNATURE-----