Question
- TWiki version: 20010901
- Web server: apache 1.3.19
- Server OS: RH 7.1
- Web browser: Netscape 4.78
- Client OS: RH 7.1
Installed and configured TWiki without any errors being flagged. However, when anyone tries to register they receive the following error messg
Can't call method "mail" on an undefined value at ../lib/TWiki/Net.pm line 172.
Net::SMTP is installed. SMTPMAILHOST is set to localhost
Any thoughts or suggestions ?
--
MikeMoran - 22 Oct 2001
Answer
Some mail servers require a
Hello parameter, see
Codev.MailNotifyBugs
You can use sendmail instead,
NetpmProblem tells you how to disable
Net::SMTP.
--
PeterThoeny - 22 Oct 2001
While both of the cited references provide work arounds to the problem, neither address why getPreferencesValue is returning an undef or a null string
From Net.pm:
my $mailhost = &TWiki::Prefs::getPreferencesValue( "SMTPMAILHOST" ) || "mail";
getPreferencesValue should return the contents of SMTPMAILHOST, which it is not as indicated by the error message.
Is getPreferencesValue making use of some perl magic that became depricated between perl 5.005_03 and perl 5.6.0 ?
From Prefs.pm:
sub getPreferencesValue
{
my ( $theKey, $theWeb ) = @_;
[snip]
if( ( ! $theWeb ) || ( $theWeb eq $defaultWebName ) ) {
# search the default web
for( $x = 0; $x < @prefsKeys; $x++ ) {
if( $prefsKeys[$x] eq $theKey ) {
return $prefsValues[$x];
}
}
} elsif( &TWiki::Store::webExists( $theWeb ) ) {
[snip ]
}
return "";
}
Shouldn't the for loop be finding SMTPMAILHOST in the
TWikiPreferences? and is $x < @prefsKeys some magic, shouldn't it be $x < $#prefskeys ?
Just trying to get up to speed and understand what I'm doing.