Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- Pete Phillips
April 28, 2005, 4:34 am
rate this thread
I am running apache2 in a chroot jail, with modperl
Apache/2.0.52 (Unix) mod_chroot/0.3 mod_perl/1.999.22 Perl/v5.8.0
I can't get Net::SMTP to set up a connection to my mailserver -
$smtp = Net::SMTP->new('mailhost.domain');
print STDOUT $smtp->domain,"\n";
just gives me :
[error] Can't call method "domain" without a package
or object reference at /perl/www-feedback.cgi line 100.\n
Ruuning the same code as a stand alone perl script works OK.
I have etc/hosts and resolve.conf in the chroot jail, as well as
Any ideas, or do you require further information ?
Re: Net::SMTP in a chroot jail - can't initialise the connection
-----BEGIN PGP SIGNED MESSAGE-----
On 2005-04-27, J. Gleixner scribbled these
I thought that $@ was only for eval()?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (FreeBSD)
-----END PGP SIGNATURE-----
I abhor a system designed for the "user", if that word is a coded
pejorative meaning "stupid and unsophisticated". -- Ken Thompson
If you ask the wrong questions, you get answers like "42" and "God".
Unix is user friendly. However, it isn't idiot friendly.
Re: Net::SMTP in a chroot jail - can't initialise the connection[Problem solved]
J. Gleixner wrote:
> The new() failed.
> Always do your own error checking!
> use Net::SMTP;
> use strict;
> use warnings;
> my $smtp = Net::SMTP->new('mailhost')
> or die "Net::SMTP new() failed: $@";
Having made this addition, the error message in my apache log was:
Net::SMTP new() failed: Net::SMTP: Bad protocol 'tcp' at
/perl/www-feedback.cgi line 108.\n
Found a solution at:
Basically my chroot jail had /etc/protocols missing. Adding that to
/chroot/etc fixed my problem.
- » converting games.pl(cgi.pm) => games.pl (html::template)
- — Previous thread in » PERL Discussions