m0thr4 has asked for the wisdom of the Perl Monks concerning the following question:
I've been tearing my hair out over this one. All I'm trying to do is to get perl to do what I can already do by telnetting to my mail server over port 25 and entering in all the details manually.
When I telnet in, I use auth login and then enter the username and password in Base64. This works fine.
Now I want to get perl to do the same, so after much consultation of CPAN and throwing away Mail::Mailer as useless, I wrote the following (sanitised, of course):
#!/usr/bin/perl # # use strict; use Net::SMTP; my $DEBUG = 1; my $smtp; $smtp = Net::SMTP->new('mymailserver.net', Hello => "myotherserver.net +", Debug => 1,); die "Couldn't connect to server" unless $smtp; print "Server connection opened\n"; $smtp->auth('myuser', 'test123'); ...
When I run this, I get the following:
Net::SMTP>>> Net::SMTP(2.31) Net::SMTP>>> Net::Cmd(2.29) Net::SMTP>>> Exporter(5.58) Net::SMTP>>> IO::Socket::INET(1.29) Net::SMTP>>> IO::Socket(1.29) Net::SMTP>>> IO::Handle(1.25) Net::SMTP=GLOB(0xa6fd440)<<< 220 mymailserver.net ESMTP Exim 4.60 Mon, + 20 Jul 2009 15:08:52 +0100 Net::SMTP=GLOB(0xa6fd440)>>> EHLO myotherserver.net Net::SMTP=GLOB(0xa6fd440)<<< 250-mymailserver.net Hello myotherserver. +net [10.1.2.70] Net::SMTP=GLOB(0xa6fd440)<<< 250-SIZE 20971520 Net::SMTP=GLOB(0xa6fd440)<<< 250-PIPELINING Net::SMTP=GLOB(0xa6fd440)<<< 250-AUTH PLAIN LOGIN Net::SMTP=GLOB(0xa6fd440)<<< 250-STARTTLS Net::SMTP=GLOB(0xa6fd440)<<< 250 HELP Server connection opened Net::SMTP=GLOB(0xa6fd440)>>> AUTH PLAIN bXl1c2VybXl1c2VydGVzdDEyMw== Net::SMTP=GLOB(0xa6fd440)<<< 535 Incorrect authentication data ...
The problem seems to be twofold:
Is this a bug in Net::SMTP, or a problem with my mail server, or something else?
|
|---|