Re: [Dovecot] Dovecot-deliver sometimes fails when message set to discard via sieve
Does procmail still log the same thing about "error writing to.."? Maybe a slightly different script: #!/bin/sh file=/tmp/deliver.`date +%s`.$$ cd /tmp cat > $file ulimit -c unlimited /opt/dovecot/libexec/dovecot/deliver $* < $file code=$? rm $file if [ $code != 0 ]; then echo 'deliver failed' >> /tmp/deliver.err fi exit $code On Wed, 2010-01-13 at 10:40 +0100, Steve Wagner wrote: > Hi Timo, deliver works with the script and ive got some fails while > using it, but the script dose not wrote anything. > > Any further ideas? > > Steve > > On 29.12.2009 22:19, Timo Sirainen wrote: > > On Mon, 2009-12-28 at 14:34 +0100, Steve Wagner wrote: > >> 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 keineantwortadre...@web.de Tue Dec 8 07:19:55 2009 > > > > This probably means that deliver crashed. Maybe instead of executing > > deliver directly, you could execute deliver.sh that works something > > like: > > > > #!/bin/sh > > > > cd /tmp > > ulimit -c unlimited > > /opt/dovecot/libexec/dovecot/deliver $* > > code=$? > > if [ $code != 0 ]; then > >echo 'deliver failed'>> /tmp/deliver.err > > fi > > exit $code > > > > Then see if deliver wrote a core file to /tmp or to user's home dir (if > > user has one). If you do get a core file, get gdb backtrace: > > > > gdb /opt/dovecot/libexec/dovecot/deliver core > > bt full > signature.asc Description: This is a digitally signed message part
Re: [Dovecot] Dovecot-deliver sometimes fails when message set to discard via sieve
Hi Timo, deliver works with the script and ive got some fails while using it, but the script dose not wrote anything. Any further ideas? Steve On 29.12.2009 22:19, Timo Sirainen wrote: On Mon, 2009-12-28 at 14:34 +0100, Steve Wagner wrote: 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 keineantwortadre...@web.de Tue Dec 8 07:19:55 2009 This probably means that deliver crashed. Maybe instead of executing deliver directly, you could execute deliver.sh that works something like: #!/bin/sh cd /tmp ulimit -c unlimited /opt/dovecot/libexec/dovecot/deliver $* code=$? if [ $code != 0 ]; then echo 'deliver failed'>> /tmp/deliver.err fi exit $code Then see if deliver wrote a core file to /tmp or to user's home dir (if user has one). If you do get a core file, get gdb backtrace: gdb /opt/dovecot/libexec/dovecot/deliver core bt full
Re: [Dovecot] Dovecot-deliver sometimes fails when message set to discard via sieve
Sorry for the late answer, i was quiet busy the time. I now execute the script. I report back when the error occures next time. Steve Am 29.12.2009 22:19, schrieb Timo Sirainen: > On Mon, 2009-12-28 at 14:34 +0100, Steve Wagner wrote: >> 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 keineantwortadre...@web.de Tue Dec 8 07:19:55 2009 > > This probably means that deliver crashed. Maybe instead of executing > deliver directly, you could execute deliver.sh that works something > like: > > #!/bin/sh > > cd /tmp > ulimit -c unlimited > /opt/dovecot/libexec/dovecot/deliver $* > code=$? > if [ $code != 0 ]; then > echo 'deliver failed' >> /tmp/deliver.err > fi > exit $code > > Then see if deliver wrote a core file to /tmp or to user's home dir (if > user has one). If you do get a core file, get gdb backtrace: > > gdb /opt/dovecot/libexec/dovecot/deliver core > bt full
Re: [Dovecot] Dovecot-deliver sometimes fails when message set to discard via sieve
On Mon, 2009-12-28 at 14:34 +0100, Steve Wagner wrote: > 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 keineantwortadre...@web.de Tue Dec 8 07:19:55 2009 This probably means that deliver crashed. Maybe instead of executing deliver directly, you could execute deliver.sh that works something like: #!/bin/sh cd /tmp ulimit -c unlimited /opt/dovecot/libexec/dovecot/deliver $* code=$? if [ $code != 0 ]; then echo 'deliver failed' >> /tmp/deliver.err fi exit $code Then see if deliver wrote a core file to /tmp or to user's home dir (if user has one). If you do get a core file, get gdb backtrace: gdb /opt/dovecot/libexec/dovecot/deliver core bt full signature.asc Description: This is a digitally signed message part
Re: [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
Re: [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: > "lan...@0:/home/lanwin/Maildir/new/1262032593.29952_2.vs5923" > From keineantwortadre...@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=: 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 (http://www.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
Re: [Dovecot] Dovecot-deliver sometimes fails when message set to discard via sieve
Am 28.12.2009 um 15:09 schrieb Steve Wagner: > [snip] > > :0 w > | /opt/dovecot/libexec/dovecot/deliver Looks uncritical to me. Although there is no default rule at the end of .procmailrc, Dovecot deliver and Sieve should reroute everything not catched by a rule to INBOX. Did Procmails "VERBOSE=on" reveal something? Tobi
Re: [Dovecot] Dovecot-deliver sometimes fails when message set to discard via sieve
My procmailrc looks like this. I have a lot of my old mail filerings ruls commented out and this is the rest which is active: * < 256000 | /usr/bin/spamc -U /var/run/spamd.sock :0 * ^X-Spam-Level: \*\*\*\*\*\*\*\*\*\* /dev/null :0w * ^X-Spam-Status: YES |~/.deliver-to-maildir seen .Junk/ :0 * ^List-Id: .*debian-arm.lists.debian.org { :0 fhw |sed -e 's/^Subject:[ ]*/Subject: [Debian-Arm] /' :0 .Lists-Low.Debian/ } :0 e { EXITCODE=75 HOST } # Work around procmail bug: any output on stderr will cause the "F" in "From" # to be dropped. This will re-add it. :0 * ^^rom[ ] { LOG="*** Dropped F off From_ header! Fixing up. " :0 fhw | sed -e '1s/^/F/' } :0 w | /opt/dovecot/libexec/dovecot/deliver Am 28.12.2009 14:57, schrieb Tobias Lang: > Am 28.12.2009 um 14:34 schrieb Steve Wagner: > >> 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 keineantwortadre...@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 > > Try using 'VERBOSE=on' in .procmailrc . Moreover I find it curious that, > procmail > tries to write to dovecot/deliver. This should be a binary file and no > writing should > occur to it. What does your .procmailrc look like? > > Tobi
Re: [Dovecot] Dovecot-deliver sometimes fails when message set to discard via sieve
Am 28.12.2009 um 14:34 schrieb Steve Wagner: > 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 keineantwortadre...@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 Try using 'VERBOSE=on' in .procmailrc . Moreover I find it curious that, procmail tries to write to dovecot/deliver. This should be a binary file and no writing should occur to it. What does your .procmailrc look like? Tobi
Re: [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 keineantwortadre...@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.: > > http://www.fastmail.fm/docs/sieve/sievetest.php > > Maybe you can isolate the error there. > > Tobi
Re: [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. >> >> 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.: http://www.fastmail.fm/docs/sieve/sievetest.php Maybe you can isolate the error there. Tobi
Re: [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 >
Re: [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
[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