Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

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 = ''; my $from = ''; my $to = ''; 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> 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)<<< 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)<<< Hello localhost.lo +caldomain [] 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:<> Net::SMTP=GLOB(0x1acbc24)<<< 250 OK Net::SMTP=GLOB(0x1acbc24)>>> RCPT TO:<> 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: Net::SMTP=GLOB(0x1acbc24)>>> To: 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 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)<<< 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)<<< Hello local +host.localdomain [] 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:<> MIME::Lite::SMTP=GLOB(0x1b05044)<<< 250 OK MIME::Lite::SMTP=GLOB(0x1b05044)>>> RCPT TO:<> MIME::Lite::SMTP=GLOB(0x1b05044)<<< 550-Mail rejected - (localhost.localdomain) MIME::Lite::SMTP=GLOB(0x1b05044)<<< 550 [] is in an RBL, s +ee SMTP RCPT command failed: Mail rejected - (localhost.localdomain) [] is in an RBL, see + at E:\www\alna-dev\cgi-bin\inlook\ 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 ?


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
Replies are listed 'Best First'.
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 = ''; my $from = ''; my $to = ''; 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 ESMTP Postfix +(Deb ian/GNU) MIME::Lite::SMTP=GLOB(0x2086504)>>> EHLO MIME::Lite::SMTP=GLOB(0x2086504)<<< 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:<> MIME::Lite::SMTP=GLOB(0x2086504)<<< 250 2.1.0 Ok MIME::Lite::SMTP=GLOB(0x2086504)>>> RCPT TO:<> MIME::Lite::SMTP=GLOB(0x2086504)<<< 554 5.7.1 <>: +Relay access denied SMTP RCPT command failed: 5.7.1 <>: 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?

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (11)
As of 2015-12-01 17:07 GMT
Find Nodes?
    Voting Booth?

    My keyboard shows this many letters:

    Results (21 votes), past polls