[Mimedefang] mysql mimedefang

B. Tolka btolka at hsc.wvu.edu
Fri Jul 11 07:51:01 EDT 2003


This code checks mysql and checks whether a user account has filtering
enabled or disabled.




sub should_check_for_spam ($)
{

    my($recip) = @_;
    $recip = lc($recip);
    $recip =~ tr/<>//d;
    $dbh= DBI->connect("DBI:mysql:spamassassin:10.9.2.76","get","get");
    $sth = $dbh->prepare("SELECT checkspam FROM userpref WHERE username
= '$recip' && preference= 'rewrite_subject'");
    $sth->execute;
    $sth->bind_columns(\$checkspam);
    $sth->fetchrow_arrayref;
    if ($checkspam eq 0)
    {
    return 0;
    }
    return 1;
    $sth->finish;
    $dbh->disconnect;

}


Bryan Tolka
Network Engineer
---------------------------------------
Robert C. Byrd Health Sciences Center
Morgantown, WV
304-293-4683
btolka at hsc.wvu.edu



More information about the MIMEDefang mailing list