You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by "Oscar H." <hc...@gmail.com> on 2008/02/27 03:33:33 UTC

Bug or by design behaviour with Perl interface.

Hello,

   I´m using Perl interface of SA in a shared hosting environment. Do not
use the std SA filtering from hosting company, what we do is to create a
filter in cPanel an pipe to a Perl Script to do Spam check. The script work
as expected, but have a problem when using this 2 functions:

    $spam_assassin->add_all_addresses_to_whitelist ( $sa_message ) 
    $spam_assassin->add_all_addresses_to_blacklist ( $sa_message )

  These functions perform a print for each added/removed address like :

  SpamAssassin auto-whitelist: adding address to whitelist: aa@aa.com
  SpamAssassin auto-whitelist: adding address to whitelist: bb@bb.com

  This print command is done by AWL plugin regardless debug option is set or
not:
    (lines are 456 to 459)
    if ($whitelist->add_known_good_address($args->{address})) {
      print "SpamAssassin auto-whitelist: adding address to whitelist: " .
$args->{address} . "\n";
      $status = 1;
    }

  The 'problem' is that this print command make massages fail on delivery.
My guess is that any output to STDOUT while filtering a mail message is
interpreted by MTA (Exim in my case) as a failure:

This message was created automatically by mail delivery software.

A message that you sent could not be delivered to one or more of its
recipients. This is a permanent error. The following address(es) failed:

  pipe to |/usr/bin/perl /home/.../safilter.pl
    generated by filter@mydomain.com

The following text was generated during the delivery attempt:

------ pipe to |/usr/bin/perl /home/.../safilter.pl
       generated by filter@mydomain.com ------
SpamAssassin auto-whitelist: adding address to whitelist: aa@aa.com
SpamAssassin auto-whitelist: adding address to whitelist: bb@bb.com
------ This is a copy of the message, including all the headers. ------
. . . 

  I must say that everything else work fine, this Delivery Failure lets say
is "extra". The script finds and delivers to the user his/her original
message back and SA is retrained per message.

  If I comment the line with "$spam_assassin->add_all_addresses_to_whitelist
( $sa_message )" there is no delivery failure message; but obviuosly no
messages to whitelist.

  At this time I'm using this delivery failure as a 'confirmation' that the
process was done, but is something I do not expect or want.

  This delivery error is similar to the one received when you send via SMTP
with debug flag set to1. The text generated is all the connection process
and delivery error is expected; in my case, the text is from the AWL plugin
print command and the delivery error is not expected.

  Don't know if this print command should be done only if debug flag in SA
is set, or by design the print command is done.

  Unfortunately in shared hosting there is no way to modify the line that
prints added/removed addresses.

  Somebody have noticed this also o know how to add remove addresses ? Don't
want to use the user_prefs for this.

  Should I have to place this issue as a bug or request ?

  TIA, Oscar.
  
  
-- 
View this message in context: http://www.nabble.com/Bug-or-by-design-behaviour-with-Perl-interface.-tp15704747p15704747.html
Sent from the SpamAssassin - Users mailing list archive at Nabble.com.


Re: Bug or by design behaviour with Perl interface.

Posted by "Daryl C. W. O'Shea" <sp...@dostech.ca>.
On 26/02/2008 9:33 PM, Oscar H. wrote:
>   This print command is done by AWL plugin regardless debug option is set or
> not:
>     (lines are 456 to 459)
>     if ($whitelist->add_known_good_address($args->{address})) {
>       print "SpamAssassin auto-whitelist: adding address to whitelist: " .
> $args->{address} . "\n";
>       $status = 1;
>     }

>   Should I have to place this issue as a bug or request ?

Yes, please open a bug at http://issues.apache.org/SpamAssassin/

Daryl