[Mimedefang] Embedded Perl & External Perl Modules
Chris Masters
rotis23 at yahoo.com
Wed May 5 12:41:56 EDT 2004
--- "David F. Skoll" <dfs at roaringpenguin.com> wrote:
> On Wed, 5 May 2004, Chris Masters wrote:
>
> > Hmmm. I initialise all connection handles in a
> > getConnection function that checks the connection
> and
> > opens one if necessary (because there never used
> to be
> > a filter_initialize function and it's very
> resilient).
>
> > Any other reasons?
>
> We've noticed a problem with error reporting and the
> embedded interpreter,
> but haven't been able to track it down. Try
> wrapping your use
> statements in a BEGIN { eval { use XXX; } or die
> ("Error with use: $@"); }
>
Thanks David. Already doing that - the error is based
around the connection error:
Can't locate object method "new" via package
"Net::LDAP::Bind" at
/usr/lib/perl5/site_perl/5.8.0/Net/LDAP.pm line 227.
Hmmmm. This is the same error if it cannot connect. I
can recreate and test further if required.
Cheers, Chris
code:
eval
{
md_syslog('info',"Connecting to LDAP Directory");
$ldap = Net::LDAP->new($LDAPServer,timeout =>
$LDAPTimeout);
$mesg = $ldap->bind($LDAP_user, password =>
$LDAP_passwd);
if ($mesg->code)
{
use Net::LDAP::Util qw(ldap_error_text);
$error = ldap_error_text($mesg->code);
md_syslog('err',"LDAP Connect Error: $error");
undef $ldap;
}
};
if($@ || !defined($ldap))
{
action_tempfail("LDAP Connect Error(Queuing
mail)");
md_syslog('err',"LDAP Error: $@");
undef $ldap;
}
__________________________________
Do you Yahoo!?
Win a $20,000 Career Makeover at Yahoo! HotJobs
http://hotjobs.sweepstakes.yahoo.com/careermakeover
More information about the MIMEDefang
mailing list