Steve Wagner
2009-Dec-28 10:55 UTC
[Dovecot] Dovecot-deliver sometimes fails when message set to discard via sieve
Hi, sometimes mails that i discard via sieve gets delivered to my inbox and i can not figure out why. So i hope you can give me a hint. My setup is: I use a self compiled dovecot 1.2.4 with installed sieve and managesieve plugin. Incoming mails a processed by Postfix and the delivered to Procmail. Procmail invokes Spamassassin and discard all mails marked as spam. The other mails are passed to Dovecot deliver this way: :0 w | /opt/dovecot/libexec/dovecot/deliver For moving mails to subdirectorys this works always, but not for mails that are discard via Sieve. Examples are: if header :contains "List-Id" "git.vger.kernel.org" { if header :contains "Subject" "[ANNOUNCE]" { fileinto "Announce"; stop; } if header :contains "Subject" "[ANN]" { fileinto "Announce"; stop; } if header :contains "Subject" "[PATCH" { discard; stop; } fileinto "Lists.Git"; stop; } or if header :contains "Organization" "web.de" { discard; stop; } This often works, but sometimes it fails. Procmail reports then that deliver reported an error (but not which) and delivers them to my inbox. There are also no message in dovecots or dovecot delivers log file. Dose anybody have an idea? Steve
Tobias Lang
2009-Dec-28 11:20 UTC
[Dovecot] Dovecot-deliver sometimes fails when message set to discard via sieve
Am 28.12.2009 um 11:55 schrieb Steve Wagner:> if header :contains "Organization" "web.de" { discard; stop; } > > This often works, but sometimes it fails. Procmail reports then that > deliver reported an error (but not which) and delivers them to my inbox. > There are also no message in dovecots or dovecot delivers log file.This rule will fail, when there is no HeaderEntry called "Organization". You should try "From" instead, this HeaderEntry should always be there to test against. Tobi
Tobias Lang
2009-Dec-28 11:25 UTC
[Dovecot] Dovecot-deliver sometimes fails when message set to discard via sieve
Am 28.12.2009 um 11:55 schrieb Steve Wagner:> if header :contains "Organization" "web.de" { discard; stop; } > > This often works, but sometimes it fails. Procmail reports then that > deliver reported an error (but not which) and delivers them to my inbox. > There are also no message in dovecots or dovecot delivers log file.This rule will fail, when there is no HeaderEntry called "Organization". You should try "From" instead, this HeaderEntry should always be there to test against. Tobi
Steve Wagner
2009-Dec-28 12:02 UTC
[Dovecot] Dovecot-deliver sometimes fails when message set to discard via sieve
Hi Tobi, yes but it is correct. It should only discard messages that have this header. The sieve filter is larger, this are only the parts witch use discard. Steve Am 28.12.2009 12:25, schrieb Tobias Lang:> Am 28.12.2009 um 11:55 schrieb Steve Wagner: > >> if header :contains "Organization" "web.de" { discard; stop; } >> >> This often works, but sometimes it fails. Procmail reports then that >> deliver reported an error (but not which) and delivers them to my inbox. >> There are also no message in dovecots or dovecot delivers log file. > > This rule will fail, when there is no HeaderEntry called "Organization". > You should try "From" instead, this HeaderEntry should always be there > to test against. > > Tobi >
Tobias Lang
2009-Dec-28 12:15 UTC
[Dovecot] Dovecot-deliver sometimes fails when message set to discard via sieve
Am 28.12.2009 um 13:02 schrieb Steve Wagner:> Hi Tobi, yes but it is correct. It should only discard messages that > have this header. The sieve filter is larger, this are only the parts > witch use discard. > > Steve > > Am 28.12.2009 12:25, schrieb Tobias Lang: >> Am 28.12.2009 um 11:55 schrieb Steve Wagner: >> >>> if header :contains "Organization" "web.de" { discard; stop; } >>> >>> This often works, but sometimes it fails. Procmail reports then that >>> deliver reported an error (but not which) and delivers them to my inbox. >>> There are also no message in dovecots or dovecot delivers log file. >> >> This rule will fail, when there is no HeaderEntry called "Organization". >> You should try "From" instead, this HeaderEntry should always be there >> to test against. >> >> TobiHey Steve, as you can not provide some error messages, it is quite hard to help you with your problem. However, I would guess that there is something wrong with your sieve rules - based on the information, that most mails get filtered correctly. Try analyzing the mails causing errors separately with e.g.: fastmail.fm/docs/sieve/sievetest.php Maybe you can isolate the error there. Tobi
Steve Wagner
2009-Dec-28 13:34 UTC
[Dovecot] Dovecot-deliver sometimes fails when message set to discard via sieve
Ok ive tested it. The sieve script works as expected. The only error message i have, come from procmail.log: 24918-Folder: /opt/dovecot/libexec/dovecot/deliver 3720 24919-procmail: Error while writing to "/opt/dovecot/libexec/dovecot/deliver" 24920:From KeineAntwortAdresse at web.de Tue Dec 8 07:19:55 2009 The procmail-deliver error logfile is empty and the normal log file dose not contains that error. Do you have an idea how else i can get the error message? Steve Am 28.12.2009 13:15, schrieb Tobias Lang:> > Am 28.12.2009 um 13:02 schrieb Steve Wagner: > >> Hi Tobi, yes but it is correct. It should only discard messages >> that have this header. The sieve filter is larger, this are only >> the parts witch use discard. >> >> Steve >> >> Am 28.12.2009 12:25, schrieb Tobias Lang: >>> Am 28.12.2009 um 11:55 schrieb Steve Wagner: >>> >>>> if header :contains "Organization" "web.de" { discard; stop; } >>>> >>>> This often works, but sometimes it fails. Procmail reports then >>>> that deliver reported an error (but not which) and delivers >>>> them to my inbox. There are also no message in dovecots or >>>> dovecot delivers log file. >>> >>> This rule will fail, when there is no HeaderEntry called >>> "Organization". You should try "From" instead, this HeaderEntry >>> should always be there to test against. >>> >>> Tobi > > > Hey Steve, > > as you can not provide some error messages, it is quite hard to help > you with your problem. However, I would guess that there is something > wrong with your sieve rules - based on the information, that most > mails get filtered correctly. Try analyzing the mails causing errors > separately with e.g.: > > fastmail.fm/docs/sieve/sievetest.php > > Maybe you can isolate the error there. > > Tobi
Tobias Lang
2009-Dec-29 07:56 UTC
[Dovecot] Dovecot-deliver sometimes fails when message set to discard via sieve
Am 28.12.2009 um 21:51 schrieb Steve Wagner:> Sorry it took some time to get in to this failing situation. > > Procmail log--> > > procmail: [29952] Mon Dec 28 21:36:33 2009 > procmail: Match on "< 256000" > procmail: Locking "spamassassin.lock" > procmail: Executing "/usr/bin/spamc,-U,/var/run/spamd.sock" > procmail: [29952] Mon Dec 28 21:36:35 2009 > procmail: Unlocking "spamassassin.lock" > procmail: No match on "^X-Spam-Level: \*\*\*\*\*\*\*\*\*\*" > procmail: No match on "^X-Spam-Status: YES" > procmail: No match on "^List-Id: .*debian-arm.lists.debian.org" > procmail: No match on "^^rom[ ]" > procmail: Executing "/opt/dovecot/libexec/dovecot/deliver" > procmail: Error while writing to "/opt/dovecot/libexec/dovecot/deliver" > procmail: Assigning "LASTFOLDER=/opt/dovecot/libexec/dovecot/deliver" > procmail: Assigning > "LASTFOLDER=/home/lanwin/Maildir/new/1262032593.29952_2.vs5923" > procmail: Notified comsat: > "lanwin at 0:/home/lanwin/Maildir/new/1262032593.29952_2.vs5923" > From KeineAntwortAdresse at web.de Mon Dec 28 21:36:33 2009 > Subject: discoTEL > =?ISO-8859-1?Q?Tarif=3A_F=FCr_7=2C5_Cent=2FMin=2E_telefonier > Folder: /home/lanwin/Maildir/new/1262032593.29952_2.vs5923 > 41096 > procmail: Unlocking "/home/lanwin/Maildir/.lockmail" > > Dovecot Deliver Log--> > > 2009-12-28 21:36:35 deliver(lanwin): Info: sieve: > msgid=<E1NPMKF-00014k-00 at mxnl04.web.de>: marked message to be discarded > if not explicitly delivered (discard action)Does it always fail, if you try to do a discard, just sometimes? I am using Dovecot 1.2.9 "dovecot-1.2-sieve-0.1.14" and discarding email seems to work fine. The things I can think of are: 1) Wrong privileges for deleting. What user does procmail / deliver run as? 2) Old Bug in Sieve (dovecot.org/list/dovecot/2007-July/024290.html) 3) If it fails just sometimes, what is the difference between discarded and nondiscarded mails. If this does not turn up something, I do not have an idea what is going wrong. Only bugfix I then can you provide with, is not to discard but to move those files to a folder 'SPAM' and delete them by hand. Tobi