[Mimedefang] mysql mimedefang

B. Tolka btolka at hsc.wvu.edu
Thu Jul 3 10:04:01 EDT 2003


I wrote a perl script that contains mysql calls to give users the
ability to turn off or on spamassassin.

>From a command line perl script it works fine. However when I copy the
code into Mimedefang filter it complains
with the error

print() on closed filehandle FD

My script is as follows.

$dbh= DBI->connect("DBI:mysql:spamassassin:10.9.2.76","get","get");
$sth = $dbh->prepare(" SELECT username FROM userpref WHERE checkspam =
'0'");
$sth->execute;
$sth->bind_columns(\$username);
##setting the file to null here
open(FDA, "> /etc/mail/spam_disabled_users.txt");
close(FDA);

while( $sth->fetch() )
{
open(FD, ">> /etc/mail/spam_disabled_users.txt");
print FD "$username\n";
}
close(FD);
$sth->finish;
$dbh->disconnect;


Any help is appreciated.


Bryan Tolka



More information about the MIMEDefang mailing list