[ale] fetchmail --antispam

Joe Steele joe at madewell.com
Wed Jan 5 18:52:54 EST 2005


On Tuesday, January 04, 2005 11:20 PM, David S. Jackson wrote:
> I'm trying to tell fetchmail to treat any pop3 message with error 451
> as a spam message and to flush it, despite what the error says.
> Fetchmail wants to save all mail until it knows it's bad.  I'm
> telling it to override its default behavior because I know error 451
> (sender address doesn't resolve) is a spam error.  So I start
> fetchmail thusly:
>
> fetchmail --antispam 451
>
> However, the log tells me this:
>
>  *** snip ***
>  reading message dsj%dsj.net at pop.dsj.net:28 of 28 (5284 octets)
>  fetchmail: SMTP error: 451 4.1.8 Domain of sender address
>  rainer at augsburg.net does not resolve
>  ..... not flushed
>
> Why doesn't fetchmail believe me?  Why doesn't this message get
> flushed as I asked it to be?  All help welcome.  TIA!

There's a bug in the current fetchmail (6.2.5) that might be the 
cause of your problem.  The antispam feature should properly match 
responses to the "MAIL FROM" SMTP command.  And although it's 
supposed to also match responses to the "RCPT TO" SMTP command, the 
bug prevents any matches.

However, there is a question of whether this bug is the root of your 
problem.  Your sendmail is complaining about a sender address, and 
such a complaint would normally be raised in response to a "MAIL 
FROM" command (where the fetchmail bug doesn't apply).  On the other 
hand, there is a sendmail config option FEATURE(`delay_checks') 
which, when combined with the fetchmail bug, WOULD cause your 
problem.

You might try the following patch (which fixes the bug) and see if it 
solves your problem.

--Joe

--- fetchmail-6.2.5/sink.c	Wed Jan  5 17:39:00 2005
+++ fetchmail-6.2.5-new/sink.c	Wed Jan  5 17:41:08 2005
@@ -594,9 +594,18 @@
  * no PS_TRANSIENT, atleast one PS_SUCCESS: send the bounce mail, delete the mail;
  * no PS_TRANSIENT, no PS_SUCCESS: do not send the bounce mail, delete the mail */
 {
+    struct idlist *walk;
+    int found = 0;
     int smtperr = atoi(smtp_response);
+    for( walk = ctl->antispam; walk; walk = walk->next )
+        if ( walk->val.status.num == smtperr ) 
+	{ 
+		found=1;
+		break;
+	}
 
-    if (str_find(&ctl->antispam, smtperr))
+    /* if (str_find(&ctl->antispam, smtperr)) */
+    if ( found )
     {
 	if (run.spambounce)
 	 return(PS_SUCCESS);





More information about the Ale mailing list