This is a discussion on my spam filter puts messages back into queue within the alt.comp.mail.qmail forums, part of the Mail Servers and Related category; Hello, I am aware that this problem might already have been reported many times. If somebody can give me a ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hello,
I am aware that this problem might already have been reported many times. If somebody can give me a quick answer I will be grateful. I made a small perl script which checks the header and contents of an incomming message. The .qmail file looks like that: | preline ./.qmail-filter.pl > /dev/null ../Maildir/ My script exits with exitcode 99 if it does not like the message. Otherwise it exits with exitcode 0. The delivery works fine the way that I am not receiving the rejected messages and receiving only messages approved of by the script. The problem is that those rejected messages remain in queue which is clearly visible after issuing of the command "qmail-qread". The fragment of such output looks like that: 24 Sep 2003 08:56:31 GMT #342398 157757 bloody-spammer@bloody-domain.com done local msglog@my-domain.com local my-address@my-domain.com What can I do to force qmail not to put that garbage again on queue? Thank you for any help. Pawel Banys |
|
|||
|
"Pawel Banys" <voland@dmz.com.pl> writes:
> I made a small perl script which checks the header and contents of an > incomming message. The .qmail file looks like that: > > | preline ./.qmail-filter.pl > /dev/null > ./Maildir/ > > My script exits with exitcode 99 if it does not like the message. Otherwise > it exits with exitcode 0. The delivery works fine the way that I am not > receiving the rejected messages and receiving only messages approved of by > the script. The problem is that those rejected messages remain in queue > which is clearly visible after issuing of the command "qmail-qread". What do the qmail-send logs show for one of these deliveries? -- Dave Sill Oak Ridge National Lab, Workstation Support Author, The qmail Handbook <http://web.infoave.net/~dsill> <http://lifewithqmail.org/>: Almost everything you always wanted to know. |
|
|||
|
>
> What do the qmail-send logs show for one of these deliveries? > Sep 24 15:20:27 linux qmail: 1064409627.713766 new msg 342457 Sep 24 15:20:27 linux qmail: 1064409627.713999 info msg 342457: bytes 145009 from <spammer@spam.com> qp 26571 uid 101 Sep 24 15:20:27 linux qmail: 1064409627.809373 starting delivery 10927: msg 342457 to local msglog @my-domain.com Sep 24 15:20:27 linux qmail: 1064409627.809606 status: local 1/10 remote 0/20 Sep 24 15:20:27 linux qmail: 1064409627.809665 starting delivery 10928: msg 342457 to local myaccount @my-domain.com Sep 24 15:20:27 linux qmail: 1064409627.809717 status: local 2/10 remote 0/20 Sep 24 15:20:27 linux qmail: 1064409627.879973 delivery 10927: success: did_0+0+0/ Sep 24 15:20:27 linux qmail: 1064409627.880459 status: local 1/10 remote 0/20 Sep 24 15:20:27 linux qmail: 1064409627.924248 delivery 10928: deferral: preline:_fatal:_unable_to _copy_input:_broken_pipe/ Sep 24 15:20:27 linux qmail: 1064409627.924513 status: local 0/10 remote 0/20 Sep 24 15:20:28 linux pop3d: 1064409628.847294 tcpserver: status: 1/20 I hope I did not miss anything. The preline error is generated because my perl script exits before the input stream of a message is read completely. So that is why there is a broken pipe. Is that perhaps a problem which results in confusing error codes? Best regards, Pawel Banys |
|
|||
|
"Pawel Banys" <voland@dmz.com.pl> writes:
>> What do the qmail-send logs show for one of these deliveries? > > Sep 24 15:20:27 linux qmail: 1064409627.924248 delivery 10928: deferral: > preline:_fatal:_unable_to_copy_input:_broken_pipe/ > > I hope I did not miss anything. The preline error is generated because my > perl script exits before the input stream of a message is read completely. > So that is why there is a broken pipe. Is that perhaps a problem which > results in confusing error codes? Yep, that's the problem. Have your script read through to the end of the message. -- Dave Sill Oak Ridge National Lab, Workstation Support Author, The qmail Handbook <http://web.infoave.net/~dsill> <http://lifewithqmail.org/>: Almost everything you always wanted to know. |
|
|||
|
>
> Yep, that's the problem. Have your script read through to the end of > the message. > I have just rewritten the script to read the whole message and the problem has been solved! Thank you for that logfile inspiration. I have another question: is it possible to rewrite the line: | preline ./.qmail-filter.pl > /dev/null so that the errors from preline will be delt with accordingly not to interfere with exit codes from the script? Second question: does reading of the whole message put significant load on system? Is there a method to stop reading without causing the "broken pipe" error? Best regards, Pawel Banys |
|
|||
|
"Pawel Banys" <voland@dmz.com.pl> writes:
> I have just rewritten the script to read the whole message and the problem > has been solved! Thank you for that logfile inspiration. Great, glad to help. > I have another question: is it possible to rewrite the line: > > | preline ./.qmail-filter.pl > /dev/null > > so that the errors from preline will be delt with accordingly not to > interfere with exit codes from the script? I don't see a way. > Second question: does reading of the whole message put significant load on > system? It should be negligable. > Is there a method to stop reading without causing the "broken pipe" > error? Possibly, but I'm not the one to ask. -- Dave Sill Oak Ridge National Lab, Workstation Support Author, The qmail Handbook <http://web.infoave.net/~dsill> <http://lifewithqmail.org/>: Almost everything you always wanted to know. |