OK. Here is the error message. I stepped through the code to get this. My source file is after that. Names have been changed to protect the guilty

This was working perfectly with the older versions of SMTP.pm which did not use Authen:SASL. If you change your mail server, username and password, it should work with the older smtp.pm, but not the newer version.
Net::SMTP::auth(/usr/share/perl/5.8/Net/SMTP.pm:114): 114: die "auth(username, password)" if not length $username; DB<2> n Net::SMTP::auth(/usr/share/perl/5.8/Net/SMTP.pm:115): 115: $sasl = Authen::SASL->new(mechanism=> $mechanisms, 116: callback => { user => $usernam +e, 117: pass => $passwor +d, 118: authname => $username, DB<2> n Net::SMTP::auth(/usr/share/perl/5.8/Net/SMTP.pm:124): 124: my $client = $sasl->client_new('smtp',${*$self}{'net_smtp_host'},0); DB<2> n Net::SMTP::auth(/usr/share/perl/5.8/Net/SMTP.pm:124): 124: my $client = $sasl->client_new('smtp',${*$self}{'net_smtp_host'},0); DB<2> n Unknown callback: 'authname'. (user|auth|language|pass) Authen::SASL::client_new('Authen::SASL=HASH(0x856fa78)', 'smtp' +, 'outgoing.verizon.net', 0) called at /usr/share/perl/5.8/Net/SMTP.pm l +ine 124 Net::SMTP::auth('Net::SMTP=GLOB(0x850980c)', 'nnigam', 'mypassw +ord') called at posturl.pl line 103 Debugged program terminated. Use q to quit or R to restart, use O inhibit_exit to avoid stopping after program termination, h q, h R or h O to get additional info.
My Source file
#!/usr/bin/perl ##################################################################### # File: posturl.pl # # Version: 1.0.0 # # For: Personal # # Language: Perl 5.004_04 # # Author: Neeraj C. Nigam # # Date: May 12, 2003 # # Purpose : # # Revision History: # ##################################################################### use strict; #use ncn::sfunc ; #use ncn::taps ; use Net::SMTP; my($par1,$par2) = (uc($ARGV[0]),$ARGV[1]) ; # Expects a slash at the +end if directory $par1 = $par1 || "AB"; $par2 = $par2 || "XXX"; my ($smtp); my ($mailSrc)="XXX"; my ($sndr)="Bill Gates"; my ($qryStr,$datLen); my (@aMain); my ($nmPar,$nmValue); my ($msgdat)=""; my ($web)=1; if ( $par1 eq "X" ) { $web=0; if ( $par2 ne "" ) { $mailSrc=$par2; } } open (LOG,">>log.txt"); print LOG "New Record\n"; # Reading from Web Site Begin if ( $web ) { $datLen=$ENV{'CONTENT_LENGTH'}; read (STDIN, $qryStr, $datLen); @aMain=split(/&/,$qryStr); print "Content-Type: text/html\n\n"; foreach (@aMain){ ($nmPar,$nmValue)=split(/=/,$_); $nmValue =~ tr/+/ /; $nmValue =~ s/%([\dA-Fa-f][\dA-Fa-f])/ pack ("C", hex($1))/eg; print "$nmPar = $nmValue<br>\n"; if ($msgdat eq ""){ $msgdat=$nmPar . "=" .$nmValue. "\n" ; } else { $msgdat=$msgdat . $nmPar . "=" .$nmValue. "\n" ; } #print "$nmValue<br>\n"; print LOG "$nmPar = $nmValue\n"; if ($nmPar eq "fEMail") { $mailSrc=$nmValue; } } print "<br><br>\n\n"; print $msgdat; # Read from Website End } else { $nmValue="Bill.Gates\@microsoft.com"; $msgdat="Email =" . $nmValue . "\n" ; $nmValue="Bill Gates"; $msgdat=$msgdat . "Name =" . $nmValue . "\n" ; $nmValue="Redmond, Washington"; $msgdat=$msgdat . "Add1 =" . $nmValue . "\n" ; $nmValue=""; $msgdat=$msgdat . "Add2 =" . $nmValue . "\n" ; $nmValue="Redmond"; $msgdat=$msgdat . "City =" . $nmValue . "\n" ; $nmValue="WA"; $msgdat=$msgdat . "State =" . $nmValue . "\n" ; $nmValue="00000-0000"; $msgdat=$msgdat . "Zip =" . $nmValue . "\n" ; $nmValue="000-000-0000"; $msgdat=$msgdat . "Phone =" . $nmValue . "\n" ; $nmValue="Mail"; $msgdat=$msgdat . "Contact by Email\n" ; $nmValue="Your dad asked me to contact you Are you interested"; $msgdat=$msgdat . "Msg =" . $nmValue . "\n" ; print LOG $msgdat; } #$smtp = Net::SMTP->new('smtpout.bellatlantic.net'); #mail host $smtp = Net::SMTP->new('outgoing.verizon.net',Debug=>1); #$smtp = Net::SMTP->new('outgoing.verizon.net'); if ($smtp eq ""){ print "Error connecting to Mail server\n"; print "Your message has not been sent\n"; die; } $smtp->auth('nnigam','password'); if ($mailSrc eq "XXX") { $smtp->mail('nnigam@verizon.net'); } else { $smtp->mail($mailSrc); } $smtp->to('pratibha@pntravels.com'); $smtp->data(); $smtp->datasend("Subject: WebFormData\n"); $smtp->datasend($msgdat); # Try to Add Env Info #my (@env_rep)=split(/,/,$query{'env_report'} || ''); #my ($env); #foreach $env (@env_rep) { # $smtp->datasend("$env: $ENV{$env}\n") or &smtperror; #} for (keys %ENV){ $smtp->datasend("$_: $ENV{$_}\n") or &smtperror; } $smtp->dataend(); $smtp->quit(); print "Your message has been sent\n"; print "<form method='get' action='/index.html'><br>"; print "<input type='submit' value='Press to Return'><br>"; print "</form>"; close(LOG);
--------------------

I recently upgraded by web server to debian 3.1 (Sarge) from degian 3.0. My apache, perl etc were also upgraded with the new install. Now my webserver mail form has stopped functioning pointing to a variable authname. I have located this in smtp.pm version 2.26. I originally had 2.15 I believe.

The new version of smtp.pm also seems to want Authen:SASL which was not being used. I installed Authen:SASL, but the error still persists. Looking at smtp.pm, I see the following section where authname appears to be the same as user. But still keep on getting the error when trying to authenticate to my verizon mail server to send the mail message. Any help would be greatly appreciated. I wrote the script to mail my messages, and can make it available if anyone wants to test it out.
if (ref($username) and UNIVERSAL::isa($username,'Authen::SASL')) { $sasl = $username; $sasl->mechanism($mechanisms); } else { die "auth(username, password)" if not length $username; $sasl = Authen::SASL->new(mechanism=> $mechanisms, callback => { user => $username, pass => $password, authname => $username, }); }

In reply to SMTP Authen Error by nnigam

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.