Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Unable to do NTLM auth on mail sending script using Mail::Sender

by barun2u (Initiate)
on Oct 18, 2012 at 14:36 UTC ( #999747=perlquestion: print w/ replies, xml ) Need Help??
barun2u has asked for the wisdom of the Perl Monks concerning the following question:

Hi, I'm trying to write a script to send email, and I'm using the Mail::Sender package for it. I'm using my company's exchange server to send it, which uses NTLM authentication. I'm not able to login. What am i missing?
use Mail::Sender; use Authen::NTLM; open my $DEBUG, ">file.txt" or die "Can't open the debug file: $!\n"; my $sender = new Mail::Sender{ smtp => 'mail.company.com', #disguised on_errors=>'die', from => 'sender@domain.com', to =>'recipient@domain.com', subject => 'this is a test', auth =>'NTLM', authid => 'user', authpwd => 'password', authdomain=>'domain', debug => $DEBUG, debug_level=>'4' } or die "$Mail::Sender::Error\n"; $sender->Open(); $sender->SendLineEnc("Hi,\n wasaaaaaaaa!\n"); $sender->Close();
The error I get: Authentication unsuccessful Here's the complete log file -
>> 220 025-SN1MMR1-003 Authenticated Client Access Receive Connector << EHLO C9118DEF1EFEBC4.xxx.xxxxxxx.com >> 250-025-SN1MMR1-003.025d.xxx.xxx.net Hello [123.123.123.123] <disgu +ised> >> 250-SIZE 73400320 >> 250-PIPELINING >> 250-DSN >> 250-ENHANCEDSTATUSCODES >> 250-STARTTLS >> 250-AUTH NTLM >> 250-8BITMIME >> 250-BINARYMIME >> 250 CHUNKING << AUTH NTLM >> 334 NTLM supported << TlRMTVNTUAABAAAAB7IAAAcABwAgAAAABAAEACcAAABCWEMwNTU3QU1FUg== >> 334 TlRMTVNTUAACAAAACAAIADgAAAAFgoECwB/WyydSiQ8AAAAAAAAAANAA0ABAAAA +ABgGxHQAAAA8wADIANQBEAAIACAAwADIANQBEAAEAHgAwADIANQAtAFMATgAxAE0ATQBS +ADEALQAwADAAMwAEACIAMAAyADUAZAAuAG0AZwBkAC4AbQBzAGYAdAAuAG4AZQB0AAMAQ +gAwADIANQAtAFMATgAxA0ATQBSADEALQAwADAAMwAuADAAMgA1AGQALgBtAGcAZAAuAG0 +AcwBmAHQALgBuAGUAdAAFACIAMAAyADUAZAAuAG0AZwBkAC4AbQBzAGYAdAAuAG4AZQB0 +AAcACAAxkEKdoKzNAQAAAAA= << TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAgACABwAAAADgAOAHgAAAAOAA4AhgAA +AAAAAABUAAAABYKBAmXjRHO4f7Up8gDJRi6go2ftbklSQhvUifVDfd1R0yIz1YrYKXls9 +nDGT9l6iw1J/zAAMgA1AEQAQgBYAEMAMAA1ADUANwBCAFgAQwAwADUANQA3AA== >> 535 5.7.3 Authentication unsuccessful << quit
What am I doing wrong? The login and password are correct, and I can succesfully use this script to send mail through an outside smtp server ( for e.g. comcast, by using LOGIN protocol , though). Any help will be appreciated. Thanks!

Comment on Unable to do NTLM auth on mail sending script using Mail::Sender
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (5)
As of 2015-08-01 03:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (285 votes), past polls