Gary W. Smith wrote: > > Hello, > > I’m working on a perl script that will check some emails. I had a > question though (based on an earlier question). If SA is on a > different box how do I tell the perl code to use a different host and > port? > Erm, if you're using Mail::SpamAssassin, you aren't using spamd, you're loading SA into your process directly.
If you want to make use of spamd, whether local or remote, you'll have to connect using sockets and speak to it using the spamd protocol: http://svn.apache.org/repos/asf/spamassassin/branches/3.1/spamd/PROTOCOL > Given something like the code below how do I specific a non-default > backend? > That code doesn't use *any* backend. > > #!/usr/bin/perl > > use Mail::SpamAssassin; > > my $spamtest = Mail::SpamAssassin->new( { username => 'filter'} ); > > my $mail = $spamtest->parse(<STDIN>); > > my $status = $spamtest->check($mail); > > if ($status->is_spam()) { > > print $status->rewrite_mail(); > > } > > $status->finish(); > > $mail->finish(); > > exit 0; >