my spam filter puts messages back into queue

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 ...


Go Back   Usenet Forums > Mail Servers and Related > alt.comp.mail.qmail

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 09-24-2003
Pawel Banys
 
Posts: n/a
Default my spam filter puts messages back into queue

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



Reply With Quote
  #2 (permalink)  
Old 09-24-2003
Dave Sill
 
Posts: n/a
Default Re: my spam filter puts messages back into queue

"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.
Reply With Quote
  #3 (permalink)  
Old 09-24-2003
Pawel Banys
 
Posts: n/a
Default Re: my spam filter puts messages back into queue

>
> 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



Reply With Quote
  #4 (permalink)  
Old 09-24-2003
Dave Sill
 
Posts: n/a
Default Re: my spam filter puts messages back into queue

"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.
Reply With Quote
  #5 (permalink)  
Old 09-24-2003
Pawel Banys
 
Posts: n/a
Default Re: my spam filter puts messages back into queue

>
> 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



Reply With Quote
  #6 (permalink)  
Old 09-24-2003
Dave Sill
 
Posts: n/a
Default Re: my spam filter puts messages back into queue

"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.
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 08:35 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0