You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Rajesh Akkineni <ra...@vimukti.com> on 2005/03/24 06:35:09 UTC
MAIL::Cclient callbacks not working in mod_perl
Hi all,
This is my configuration
------------------------
RedHat ES3
httpd-2.0.46
perl-5.8.0-89.10
This is what i want to do
---------------------------
I want to deploy my website written for HTML::Mason under mod_perl which
uses "MAIL:Cclient"
It worked successfully in Fedora 2.
This is what i did
-------------------
Tried to install HTML::Mason form latest package from www.masonhq.com
It asked for so many perl modules. and i installed them using
perl -MCPAN -e shell.
But one module i was not able to install is Apache::Request
Then i downloaded libapreq2-2.04-dev
It said that it doesn't support mod_perl <1.99
So i was forced to download install mod_perl-2.0.0-RC4
But mod_perl complained that it doesn't support apache httpd-2.0.46
So i installed httpd-2.0.47-10.i386.rpm which is part of Fedora 1
At last everything went fine with installation.
Then started my actual problem. To make it short see the bellow 3 piece's
of code.
CODE 1= Written for HTML::Mason Callback function was never called.
CODE 2= Written for cgi-bin Callback function was called and program
worked
CODE 3= Written for Apache::ASP Callback function was never called.
-------------------CODE 1---------------------------
<%perl>
use Mail::Cclient qw(set_callback);
print "Setting callback <br>";
set_callback( 'login' => sub {
print "IN LOGIN CALLBACK <BR>";
return("cyrus", "cyrus");}
);
my $cclient = Mail::Cclient->new('{localhost/IMAP/notls}user');
print "CCLIENT = $cclient <br>";
</%perl>
------------------CODE 2 --------------------------
#!/usr/bin/perl
use Mail::Cclient qw(set_callback);
print "Content-type: text/html\n\n";
print "Setting callback <br>";
set_callback(
'login' => sub {
print "In Login call back <br>";
return("cyrus","cyrus");
}
);
my $cclient = Mail::Cclient->new('{localhost/IMAP/notls}user');
print "CCLIENT = $cclient <br>";
------------------CODE 3 ---------------------------
<%
use CGI qw(:standard);
use Mail::Cclient qw(set_callback);
print header();
print "Setting callback <br>";
set_callback(
'login' => sub {
print "In Login call back <br>";
return("cyrus", "cyrus");
}
);
my $cclient = Mail::Cclient->new('{localhost/IMAP/notls}user');
print "CCLIENT = $cclient <br>";
%>
-------------------------------------------------------
What else i tried?
1.Try: I thought the problem may be in mod_perl version so i tried by
installing
previous version which worked for me in Fedora 2
mod_perl-2.0.0-RC2-XMas.tar.gz
Result: No change. call back is never called
2.Try: Disabled Mason obj file output.
Result: No change. call back is never called
3.Try: Upgraded perl to 5.8.6
Result: No Change. call back is never called
4.Try: Upgraded httpd to 2.0.53
Result: No Change.
5.Try: Recompiled Mod_perl for static linking with apache.
Result: No change.
6.Try: Installed Apache:ASP to test if the problem is with "HTML::Mason"
or with "mod_perl".
Result: No change. That means it is the problem with mod_perl (i asume)
7.Try: Changed the program in such a way that i passed an already defined
function reference to 'login' callback.
Result: No change.
What i want to know?
-----------------------
Why the program is not working in mod_perl when it works perfectly with
cgi-bin?
I heard that Acmemail works in mod_perl also with Mail::Cclient.
But i am not sure about it. Can any one help me how to solve this problem.
It already took more than 3 days till now.
Is there some thing very stupid i am doing?
Please help me...
Rajesh Akkineni