CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate:
Unable to do NTLM auth on mail sending script using Mail::Sender

 



barun2u
New User

Oct 17, 2012, 1:30 PM

Post #1 of 1 (1561 views)
Unable to do NTLM auth on mail sending script using Mail::Sender Can't Post

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?

Code -

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] <disguised>
>> 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/WyydSiQ8AAAAAAAAAANAA0ABAAAAABgGxHQAAAA8wADIANQBEAAIACAAwADIANQBEAAEAHgAwADIANQAtAFMATgAxAE0ATQBSADEALQAwADAAMwAEACIAMAAyADUAZAAuAG0AZwBkAC4AbQBzAGYAdAAuAG4AZQB0AAMAQgAwADIANQAtAFMATgAxA0ATQBSADEALQAwADAAMwAuADAAMgA1AGQALgBtAGcAZAAuAG0AcwBmAHQALgBuAGUAdAAFACIAMAAyADUAZAAuAG0AZwBkAC4AbQBzAGYAdAAuAG4AZQB0AAcACAAxkEKdoKzNAQAAAAA=
<< TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAgACABwAAAADgAOAHgAAAAOAA4AhgAAAAAAAABUAAAABYKBAmXjRHO4f7Up8gDJRi6go2ftbklSQhvUifVDfd1R0yIz1YrYKXls9nDGT9l6iw1J/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!

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives