Gossamer Forum
Home : Products : Links 2.0 : Installation -- Unix :

Sudden error with Mailer.pm or Perl 5.006

Quote Reply
Sudden error with Mailer.pm or Perl 5.006
For over a year I used a link-submission system on my webpages (called MegaLinks - you can find them at http://www.stonepages.com/megalinks/) which worked like a charm.
But recently I'm having some serious problems with e-mail sending through cgi - and please note that I didn't change the configuration file nor any other file that could have started the error.
Anyway, when someone tries to add a link, after clicking on the "submit" button this message appears:

CGI ERROR
==========================================
Error Message : fatal error: admin/Mailer.pm did not return a true value at add.cgi line 161.

Script Location : add.cgi
Perl Version : 5.006001

I have checked the files and they all seem fine. In particular, line 161 of the add.cgi reads:

require "admin/Mailer.pm";
my $mailer = new Mailer ( { smtp => $db_smtp_server,
sendmail => $db_mail_path,
from => $from,
subject => $subject,
to => $to,
msg => $msg,
log => $db_mailer_log
} ) or return;
$mailer->send or return;

There is definitely something wrong with the sending of e-mail messages through the Mailer.pm. Maybe it's something related to the Perl 5.006 upgrade of my hosting provider? Does anybody know how can I resume the normal operation on my system?

Any help would be most appreciated!

Diego Meozzi
Administrator
Stone Pages
http://www.stonepages.com/
Quote Reply
Re: [Nightjar] Sudden error with Mailer.pm or Perl 5.006 In reply to
please post the last couple of lines from Mailer.pm.

Philip
------------------
Limecat is not pleased.
Quote Reply
Re: [fuzzy logic] Sudden error with Mailer.pm or Perl 5.006 In reply to
Please note I didn't change/alter Mailer.pm in any way: it's still as it was when I first installed it. Anyway, inside that file there is a routine called "Package":
Code:
package Mailer;
# ===============================================================
use strict;
use Socket;
use FileHandle;
use vars qw($VERSION $error $CRLF @ISA @EXPORT); # Globals.
@ISA = (); # Not inhereited.
@EXPORT = qw();
$Mailer::VERSION = '1.0';
$CRLF = "\015\012";
and 9 other subroutines called:
Code:
sub new
sub error
sub initialize
sub send
sub send_smtp
sub send_sendmail
sub set_options
sub clean_email
sub log_msg
Which one do you need? And I still believe the problem should lie somewhere else... Anyway, thanks for helping!

Diego
Quote Reply
Re: [Nightjar] Sudden error with Mailer.pm or Perl 5.006 In reply to
no, I literally want to the the last couple of lines. if a module does not end with a true statement such as:

Code:
1;

than a "use" or "require" will fail.

Philip
------------------
Limecat is not pleased.
Quote Reply
Re: [fuzzy logic] Sudden error with Mailer.pm or Perl 5.006 In reply to
These are the last lines of Mailer.pm:
Code:
$msg
--------------------
Mode: $mode
SMTP: $smtp
Sendmail: $send
Remote Host: $ip
Remote Ref: $ref
Program: $app

~;
close LOG;
return 1;
}

1;
Quote Reply
Re: [Nightjar] Sudden error with Mailer.pm or Perl 5.006 In reply to
hm... try changing "admin/Mailer.pm" to the full path to Mailer.pm

Philip
------------------
Limecat is not pleased.
Quote Reply
Re: [fuzzy logic] Sudden error with Mailer.pm or Perl 5.006 In reply to
Things are getting weirder...
Changed the path to full URL (and checked it does exist at that address), but now I've got this:
Code:
CGI ERROR
==========================================
Error Message : fatal error: Can't locate http://www.stonepages.com/megalinks/cgi-bin/admin/Mailer.pm in @INC (@INC contains: /usr/lib/perl5/5.6.1/i386-linux /usr/lib/perl5/5.6.1 /usr/lib/perl5/site_perl/5.6.1/i386-linux /usr/lib/perl5/site_perl/5.6.1 /usr/lib/perl5/site_perl/5.6.0/i386-linux /usr/lib/perl5/site_perl/5.6.0 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.6.1/i386-linux /usr/lib/perl5/vendor_perl/5.6.1 /usr/lib/perl5/vendor_perl .) at add.cgi line 161.
I'm still convinced there is something wrong with the new Perl 5.006 that the previous version handled in a better way... But I cannot go back!
Quote Reply
Re: [Nightjar] Sudden error with Mailer.pm or Perl 5.006 In reply to
You need to use absolute server path, not the URL where the Mailer.pm is located:

Example:

/serverpath/youraccount/cgi-bin/admin/Mailer.pm
========================================
Buh Bye!

Cheers,
Me
Quote Reply
Re: [Stealth] Sudden error with Mailer.pm or Perl 5.006 In reply to
Yes, that was a stupid mistake of mine... Anyway, now I've corrected the server path, and this is the result:
Code:
Error Message : fatal error: /home/virtual/stonepages.com/var/www/html/megalinks/cgi-bin/admin/Mailer.pm did not return a true value at add.cgi line 161.

Script Location : add.cgi
Perl Version : 5.006001
Unsure ... And what is driving me crazy is that every other cgi-driven function (search, random selection of a link, rebuilding) works perfectly. It's just the e-mail handling that simply stopped working! Frown

Last edited by:

Nightjar: Oct 11, 2003, 11:26 AM
Quote Reply
Re: [Nightjar] Sudden error with Mailer.pm or Perl 5.006 In reply to
OK, I finally solved that problem just replacing the Mailer.pm file with a fresh copy. Now everything is OK, so probably that file was corrupted.

Diego