[Mimedefang] perl problem

Mack roaringpenguin.com at bass-speaker.com
Thu Nov 10 07:56:13 EST 2005

    my $newrecip =$recip;
    $newrecip =~ s/'/''/gi;
$sth1 = $dbh->prepare("SELECT value FROM userpref WHERE username =
'$recip' && preference='whitelist_from'");

that will fix it, (replacing the ' with '') be carefull of \' as well if you are using mysql


-----Original Message-----
From: mimedefang-bounces at lists.roaringpenguin.com
[mailto:mimedefang-bounces at lists.roaringpenguin.com]On Behalf Of B.
Sent: Thursday 10 November 2005 12:44
To: mimedefang at lists.roaringpenguin.com
Subject: [Mimedefang] perl problem

I my milter I have a mysql call below.   

$sth1 = $dbh->prepare("SELECT value FROM userpref WHERE username =
'$recip' && preference='whitelist_from'");

My slave is always getting killed because of an aprostophe in an email
address.   It fails at '$recip'.   

Is there another way to code the above line??


Bryan Tolka
Visit http://www.mimedefang.org and http://www.roaringpenguin.com
MIMEDefang mailing list
MIMEDefang at lists.roaringpenguin.com

This Email Has Been Anti-Virus Scanned

More information about the MIMEDefang mailing list