Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Autentication problem with MIME::Lite

by lepetitalbert (Monsignor)
on Apr 21, 2008 at 08:58 UTC ( #681884=perlquestion: print w/ replies, xml ) Need Help??
lepetitalbert has asked for the wisdom of the Perl Monks concerning the following question:

Hello Dear Monks

My emails are sent with Net::SMTP but rejected using MIME::Lite.

test code :

use strict; use warnings; use Net::SMTP; use MIME::Lite; my $smtp_server = 'mail.example.ch'; my $from = 'inlook@example.ch'; my $to = 'andre@example.ch'; my $pass = 'example'; my $smtp = Net::SMTP->new( "$smtp_server" , Timeout => 10 , Debug => 4 + ) or die $!; $smtp->auth ( $from , $pass ) or die "Could not authenticate $!"; $smtp->mail($from); $smtp->to($to); $smtp->data(); $smtp->datasend("From: $from\n"); $smtp->datasend("To: $to\n"); $smtp->datasend("Subject: test\n\n"); $smtp->datasend("test"); $smtp->dataend(); $smtp->quit; ### Create a new multipart message: my $msg = MIME::Lite->new( From => $from , To => $to , Subject => 'test', Data => "test" ); $msg->send( 'smtp' , $smtp_server , AuthUser=> $from , AuthPass=> $pas +s , Debug=>4 );

output :

E:\www\alna-dev\cgi-bin\inlook>test.pl Net::SMTP>>> Net::SMTP(2.30) Net::SMTP>>> Net::Cmd(2.27) Net::SMTP>>> Exporter(5.60) Net::SMTP>>> IO::Socket::INET(1.31) Net::SMTP>>> IO::Socket(1.30) Net::SMTP>>> IO::Handle(1.27) Net::SMTP=GLOB(0x1acbc24)<<< 220-server8.example.ch ESMTP Exim 4.68 #1 + Mon, 21 Apr 2008 10:14:47 +0200 Net::SMTP=GLOB(0x1acbc24)<<< 220-We do not authorize the use of this s +ystem to transport unsolicited, Net::SMTP=GLOB(0x1acbc24)<<< 220 and/or bulk e-mail. Net::SMTP=GLOB(0x1acbc24)>>> EHLO localhost.localdomain Net::SMTP=GLOB(0x1acbc24)<<< 250-server8.example.ch Hello localhost.lo +caldomain [62.202.94.69] Net::SMTP=GLOB(0x1acbc24)<<< 250-SIZE 52428800 Net::SMTP=GLOB(0x1acbc24)<<< 250-PIPELINING Net::SMTP=GLOB(0x1acbc24)<<< 250-AUTH PLAIN LOGIN Net::SMTP=GLOB(0x1acbc24)<<< 250 HELP Net::SMTP=GLOB(0x1acbc24)>>> AUTH PLAIN <replaced> <-------------- Net::SMTP=GLOB(0x1acbc24)<<< 235 Authentication succeeded <------- Net::SMTP=GLOB(0x1acbc24)>>> MAIL FROM:<inlook@example.ch> Net::SMTP=GLOB(0x1acbc24)<<< 250 OK Net::SMTP=GLOB(0x1acbc24)>>> RCPT TO:<andre@example.ch> Net::SMTP=GLOB(0x1acbc24)<<< 250 Accepted Net::SMTP=GLOB(0x1acbc24)>>> DATA Net::SMTP=GLOB(0x1acbc24)<<< 354 Enter message, ending with "." on a l +ine by itself Net::SMTP=GLOB(0x1acbc24)>>> From: inlook@example.ch Net::SMTP=GLOB(0x1acbc24)>>> To: andre@example.ch Net::SMTP=GLOB(0x1acbc24)>>> Subject: test Net::SMTP=GLOB(0x1acbc24)>>> test Net::SMTP=GLOB(0x1acbc24)>>> . Net::SMTP=GLOB(0x1acbc24)<<< 250 OK id=1JnrAl-00066w-Q2 Net::SMTP=GLOB(0x1acbc24)>>> QUIT Net::SMTP=GLOB(0x1acbc24)<<< 221 server8.example.ch closing connection MIME::Lite::SMTP>>> MIME::Lite::SMTP MIME::Lite::SMTP>>> Net::SMTP(2.30) MIME::Lite::SMTP>>> Net::Cmd(2.27) MIME::Lite::SMTP>>> Exporter(5.60) MIME::Lite::SMTP>>> IO::Socket::INET(1.31) MIME::Lite::SMTP>>> IO::Socket(1.30) MIME::Lite::SMTP>>> IO::Handle(1.27) MIME::Lite::SMTP=GLOB(0x1b05044)<<< 220-server8.example.ch ESMTP Exim +4.68 #1 Mon, 21 Apr 2008 10:14:50 +0200 MIME::Lite::SMTP=GLOB(0x1b05044)<<< 220-We do not authorize the use of + this system to transport unsolicited, MIME::Lite::SMTP=GLOB(0x1b05044)<<< 220 and/or bulk e-mail. MIME::Lite::SMTP=GLOB(0x1b05044)>>> EHLO localhost.localdomain MIME::Lite::SMTP=GLOB(0x1b05044)<<< 250-server8.example.ch Hello local +host.localdomain [62.202.94.69] MIME::Lite::SMTP=GLOB(0x1b05044)<<< 250-SIZE 52428800 MIME::Lite::SMTP=GLOB(0x1b05044)<<< 250-PIPELINING MIME::Lite::SMTP=GLOB(0x1b05044)<<< 250-AUTH PLAIN LOGIN MIME::Lite::SMTP=GLOB(0x1b05044)<<< 250 HELP MIME::Lite::SMTP=GLOB(0x1b05044)>>> MAIL FROM:<inlook@example.ch> MIME::Lite::SMTP=GLOB(0x1b05044)<<< 250 OK MIME::Lite::SMTP=GLOB(0x1b05044)>>> RCPT TO:<andre@example.ch> MIME::Lite::SMTP=GLOB(0x1b05044)<<< 550-Mail rejected - 69.94.202.62.c +ust.bluewin.ch (localhost.localdomain) MIME::Lite::SMTP=GLOB(0x1b05044)<<< 550 [62.202.94.69] is in an RBL, s +ee http://www.spamhaus.org/query/bl?ip=62.202.94.69 SMTP RCPT command failed: Mail rejected - 69.94.202.62.cust.bluewin.ch (localhost.localdomain) [62.202.94.69] is in an RBL, see http://www.spamhaus.org/query/bl?ip=6 +2.202.94.69 at E:\www\alna-dev\cgi-bin\inlook\test.pl line 47 E:\www\alna-dev\cgi-bin\inlook>

It seems the authentication (<--) is not sent when using Lite. Right ?

I'm on XP, perl 5.8.8

I read in the docs about libnet.cfg which I don't have, but as I specify $smtp_server do I really need it ?

Thanks.

Have a nice day.

"There is only one good, namely knowledge, and only one evil, namely ignorance." Socrates

Comment on Autentication problem with MIME::Lite
Select or Download Code
Re: Autentication problem with MIME::Lite
by Anonymous Monk on Apr 21, 2008 at 10:15 UTC
    Try upgrade, MIME-Lite-3.021
Re: Autentication problem with MIME::Lite
by tachyon-II (Chaplain) on Apr 21, 2008 at 12:11 UTC

    It works fine with the latest version of MIME::Lite (3.021)

      Hi Monks

      Yes it does :)

      Thank you Anonymous Monk ! and tachyon-II.

      have a nice day.

      "There is only one good, namely knowledge, and only one evil, namely ignorance." Socrates
        Hello There, I am new to PerlMonks so hello to everyone, I would like to ask your help with a auth problem which looks similar to this threat, So running the example above
        use MIME::Lite; my $smtp_server = 'mail.seerver.cz'; my $from = 'user@seerver.cz'; my $to = 'somewhere@outside.cz'; my $pass = 'p4ssword'; my $msg = MIME::Lite->new( From => $from , To => $to , Subject => 'test', Data => "test" ); $msg->send( 'smtp' , $smtp_server , AuthUser=> $from , AuthPass=> $pas +s , Debug=>4 ); print map {s!/!::!g; s/.pm$//; sprintf "%-20s %s\n", $_, ${"${_}::VERS +ION"} } sort keys %INC;
        I get this
        MIME::Lite::SMTP>>> MIME::Lite::SMTP MIME::Lite::SMTP>>> Net::SMTP(2.29) MIME::Lite::SMTP>>> Net::Cmd(2.26) MIME::Lite::SMTP>>> Exporter(5.58) MIME::Lite::SMTP>>> IO::Socket::INET(1.29) MIME::Lite::SMTP>>> IO::Socket(1.29) MIME::Lite::SMTP>>> IO::Handle(1.25) MIME::Lite::SMTP=GLOB(0x2086504)<<< 220 mail.seerver.cz ESMTP Postfix +(Deb ian/GNU) MIME::Lite::SMTP=GLOB(0x2086504)>>> EHLO mail.seerver.cz MIME::Lite::SMTP=GLOB(0x2086504)<<< 250-mail.seerver.cz MIME::Lite::SMTP=GLOB(0x2086504)<<< 250-PIPELINING MIME::Lite::SMTP=GLOB(0x2086504)<<< 250-SIZE 20971520 MIME::Lite::SMTP=GLOB(0x2086504)<<< 250-VRFY MIME::Lite::SMTP=GLOB(0x2086504)<<< 250-ETRN MIME::Lite::SMTP=GLOB(0x2086504)<<< 250-STARTTLS MIME::Lite::SMTP=GLOB(0x2086504)<<< 250-AUTH PLAIN LOGIN MIME::Lite::SMTP=GLOB(0x2086504)<<< 250-AUTH=PLAIN LOGIN MIME::Lite::SMTP=GLOB(0x2086504)<<< 250-ENHANCEDSTATUSCODES MIME::Lite::SMTP=GLOB(0x2086504)<<< 250-8BITMIME MIME::Lite::SMTP=GLOB(0x2086504)<<< 250 DSN MIME::Lite::SMTP=GLOB(0x2086504)>>> MAIL FROM:<user@seerver.cz> MIME::Lite::SMTP=GLOB(0x2086504)<<< 250 2.1.0 Ok MIME::Lite::SMTP=GLOB(0x2086504)>>> RCPT TO:<somewhere@outside.cz> MIME::Lite::SMTP=GLOB(0x2086504)<<< 554 5.7.1 <somewhere@outside.cz>: +Relay access denied SMTP RCPT command failed: 5.7.1 <pistoled@seznam.cz>: Relay access denied
        as shown above no authentication process happens at all, any ideas? this is what i get with the last command
        C:::Perl::site::lib::sitecustomize.p Carp 1.04 Exporter 5.58 Exporter::Heavy 5.58 Fcntl 1.05 File::Basename 2.74 File::Spec 3.12 File::Spec::Unix 1.5 File::Spec::Win32 1.6 FileHandle 2.01 IO 1.22 IO::File 1.13_01 IO::Handle 1.25 IO::Seekable 1.1 MIME::Base64 3.07 MIME::Lite 3.01 MIME::QuotedPrint 3.07 Mail::Address 1.77 SelectSaver 1.01 Symbol 1.06 XSLoader 0.06 re 0.05 strict 1.03 vars 1.01 warnings 1.05 warnings::register 1.01
        Thank for any tips in advance, Greets from CZ, Nikolas

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://681884]
Approved by McDarren
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (11)
As of 2014-07-29 10:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (214 votes), past polls