[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:","get","get");
$sth = $dbh->prepare(" SELECT username FROM userpref WHERE checkspam =
##setting the file to null here
open(FDA, "> /etc/mail/spam_disabled_users.txt");

while( $sth->fetch() )
open(FD, ">> /etc/mail/spam_disabled_users.txt");
print FD "$username\n";

Any help is appreciated.

Bryan Tolka

More information about the MIMEDefang mailing list