Re: [Dovecot] strange sieve situation

2010-05-31 Thread Timo Sirainen
On la, 2010-05-29 at 11:47 -0400, Andy Dills wrote:

 That's the order they appeared in my logfile. I'm assuming they were all 
 sent to deliver at the same time, they all thought they needed to make the 
 directory, the one with msgid 
 20100529070110.17a781b5...@mail-out02.xecu.net was able to make the 
 directory and get delivered, whereas the other two freaked out because 
 they couldn't make the directory they thought needed to be made, and just 
 sent the mail to the inbox.

Yeah. Fixed for v2.0 and attached a fix to Pigeonhole.

diff -r b877a1db00a5 src/lib-sieve/sieve-actions.c
--- a/src/lib-sieve/sieve-actions.c	Sun May 30 09:39:19 2010 +0200
+++ b/src/lib-sieve/sieve-actions.c	Mon May 31 16:47:17 2010 +0100
@@ -402,8 +402,10 @@
 	/* Try creating it. */
 	if ( mailbox_create(box, NULL, FALSE)  0 ) {
 		(void)mail_storage_get_last_error(*storage, error);
-		mailbox_free(box);
-		return NULL;
+		if (error != MAIL_ERROR_EXISTS) {
+			mailbox_free(box);
+			return NULL;
+		}
 	}
 
 	/* Subscribe to it if required */


[Dovecot] strange sieve situation

2010-05-29 Thread Andy Dills

Hi there, I've been working on rolling out the deliver service so we can 
implement sieve. Dovecot 1.2.11, Postfix 2.6.6, FreeBSD 8, installed by 
ports. Clustered environment, NFS backend.

Everything is working great for the most part, I'm using it to sort a copy 
of my personal email on a test server. However, I noticed two emails were 
not properly sorted.

I had added a rule (using Ingo, nice little piece of software) to redirect 
the nightly FreeBSD security output emails into a folder servers. 

However, nothing had triggered that rule, and the Maildir/.servers 
directory had not yet been created.

Then, three of the security outputs came in at one time:

May 29 03:01:48 mg8 dovecot: deliver(andyt...@xecu.net): sieve: 
msgid=20100529070108.f2f0b7f...@mail-out04.xecu.net: failed to store 
into mailbox 'servers': Mailbox already exists

May 29 03:01:48 mg8 dovecot: deliver(andyt...@xecu.net): sieve: 
msgid=20100529070109.d8f5e159...@mail-out01.xecu.net: failed to store 
into mailbox 'servers': Mailbox already exists

May 29 03:01:48 mg8 dovecot: deliver(andyt...@xecu.net): sieve: 
msgid=20100529070109.d8f5e159...@mail-out01.xecu.net: stored mail into 
mailbox 'INBOX'

May 29 03:01:48 mg8 dovecot: deliver(andyt...@xecu.net): sieve: execution 
of script /mail/var/mail2/xecunet/andytest.xecu.net//.dovecot.sieve 
failed, but implicit keep was successful

May 29 03:01:48 mg8 dovecot: deliver(andyt...@xecu.net): sieve: 
msgid=20100529070110.17a781b5...@mail-out02.xecu.net: stored mail into 
mailbox 'servers'

May 29 03:01:48 mg8 dovecot: deliver(andyt...@xecu.net): sieve: 
msgid=20100529070108.f2f0b7f...@mail-out04.xecu.net: stored mail into 
mailbox 'INBOX'

May 29 03:01:48 mg8 dovecot: deliver(andyt...@xecu.net): sieve: execution 
of script /mail/var/mail2/xecunet/andytest.xecu.net//.dovecot.sieve 
failed, but implicit keep was successful


That's the order they appeared in my logfile. I'm assuming they were all 
sent to deliver at the same time, they all thought they needed to make the 
directory, the one with msgid 
20100529070110.17a781b5...@mail-out02.xecu.net was able to make the 
directory and get delivered, whereas the other two freaked out because 
they couldn't make the directory they thought needed to be made, and just 
sent the mail to the inbox.

That's a reasonable approach, although I wonder if deliver/sieve could be 
(or perhaps has been in 2.0) adjusted to more intelligently handle that 
edge case.



Also, I'm wondering about dovecot_destination_recipient_limit = 1. I 
have that set in my main.cf, but I'm not 100% positive it's taking effect.

# grep dovecot /usr/local/etc/postfix/main.cf
dovecot_destination_recipient_limit = 1
virtual_transport = dovecot

# grep dovecot /usr/local/etc/postfix/master.cf 
dovecot   unix  -   n   n   -   -   pipe
  flags=DRhu user=mailman argv=/usr/local/libexec/dovecot/deliver -f ${sender} 
-d ${recipient}

# postconf | grep dovecot
smtpd_sasl_type = dovecot
virtual_transport = dovecot

# postconf | grep destination_recipient_limit
default_destination_recipient_limit = 50
lmtp_destination_recipient_limit = $default_destination_recipient_limit
local_destination_recipient_limit = 1
relay_destination_recipient_limit = $default_destination_recipient_limit
smtp_destination_recipient_limit = $default_destination_recipient_limit
virtual_destination_recipient_limit = $default_destination_recipient_limit

Is dovecot_destination_recipient_limit being converted into local_ ?

Thanks,
Andy

---
Andy Dills
Xecunet, Inc.
www.xecu.net
301-682-9972
---