LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   Exchange Server 2010 connection from Perl? (http://www.linuxquestions.org/questions/programming-9/exchange-server-2010-connection-from-perl-913853/)

lifeforce4 11-16-2011 10:13 AM

Exchange Server 2010 connection from Perl?
 
So I had a simple IMAP script that worked until the Exchange server upgraded to 2010. Now I've been having a hard time trying to just authenticate to the server again. I wanted to know if anyone has been able to access Exchange 2010 from linux using a perl script, or other languages?

Thanks,
LF4

Code:

print "\nLogging in as : $username\n\n" if ($debug);
my $imap = Mail::IMAPClient->new(
    Server  => $server,
    User    => $username,
    Password => $password,
    Port    => 993,
    Ssl      => 1,
    Debug    => 1
) or die "Cannot connect through IMAPClient: $@";

The following is the debug output.
Code:

Logging in as : ACCOUNT

Started at Wed Nov 16 09:05:50 2011
Using Mail::IMAPClient version 3.29 on perl 5.008008
Connecting via IO::Socket::SSL to mail.server.domain:993 Timeout 600
Connected to mail.server.domain
Read:  * OK The Microsoft Exchange IMAP4 service is ready - 'w1185'
Sending: 1 LOGIN "ACCOUNT" PASSWORD
Sent 35 bytes
Read:  1 NO LOGIN failed.
ERROR: 1 NO LOGIN failed. at /usr/lib/perl5/site_perl/5.8.8/Mail/IMAPClient.pm line 1236
        Mail::IMAPClient::_get_response('Mail::IMAPClient=HASH(0x17d0e440)', 1, 'undef') called at /usr/lib/perl5/site_perl/5.8.8/Mail/IMAPClient.pm line 1183
        Mail::IMAPClient::_imap_command_do('Mail::IMAPClient=HASH(0x17d0e440)', 'LOGIN "ACCOUNT" PASSWORD') called at /usr/lib/perl5/site_perl/5.8.8/Mail/IMAPClient.pm line 1086
        Mail::IMAPClient::_imap_command('Mail::IMAPClient=HASH(0x17d0e440)', 'LOGIN "ACCOUNT" PASSWORD') called at /usr/lib/perl5/site_perl/5.8.8/Mail/IMAPClient.pm line 459
        Mail::IMAPClient::login('Mail::IMAPClient=HASH(0x17d0e440)') called at /usr/lib/perl5/site_perl/5.8.8/Mail/IMAPClient.pm line 395
        Mail::IMAPClient::Socket('Mail::IMAPClient=HASH(0x17d0e440)', 'IO::Socket::SSL=GLOB(0x1841f700)') called at /usr/lib/perl5/site_perl/5.8.8/Mail/IMAPClient.pm line 351
        Mail::IMAPClient::connect('Mail::IMAPClient=HASH(0x17d0e440)') called at /usr/lib/perl5/site_perl/5.8.8/Mail/IMAPClient.pm line 307
        Mail::IMAPClient::new('Mail::IMAPClient', 'Server', 'mail.server.domain', 'User', 'ACCOUNT', 'Password', 'PASSWORD', 'Port', 993, ...) called at ./status_page_msg.pl line 63
ERROR: 1 NO LOGIN failed. at /usr/lib/perl5/site_perl/5.8.8/Mail/IMAPClient.pm line 1131
        Mail::IMAPClient::_imap_command('Mail::IMAPClient=HASH(0x17d0e440)', 'LOGIN "ACCOUNT" PASSWORD') called at /usr/lib/perl5/site_perl/5.8.8/Mail/IMAPClient.pm line 459
        Mail::IMAPClient::login('Mail::IMAPClient=HASH(0x17d0e440)') called at /usr/lib/perl5/site_perl/5.8.8/Mail/IMAPClient.pm line 395
        Mail::IMAPClient::Socket('Mail::IMAPClient=HASH(0x17d0e440)', 'IO::Socket::SSL=GLOB(0x1841f700)') called at /usr/lib/perl5/site_perl/5.8.8/Mail/IMAPClient.pm line 351
        Mail::IMAPClient::connect('Mail::IMAPClient=HASH(0x17d0e440)') called at /usr/lib/perl5/site_perl/5.8.8/Mail/IMAPClient.pm line 307
        Mail::IMAPClient::new('Mail::IMAPClient', 'Server', 'mail.server.domain', 'User', 'ACCOUNT', 'Password', 'PASSWORD', 'Port', 993, ...) called at ./status_page_msg.pl line 63
Cannot connect through IMAPClient: 1 NO LOGIN failed. at ./status_page_msg.pl line 63.


TB0ne 11-16-2011 10:28 AM

Quote:

Originally Posted by lifeforce4 (Post 4525615)
So I had a simple IMAP script that worked until the Exchange server upgraded to 2010. Now I've been having a hard time trying to just authenticate to the server again. I wanted to know if anyone has been able to access Exchange 2010 from linux using a perl script, or other languages?

Does the Exchange server have all the service packs/updates loaded?? Since it WAS working and it's not since the upgrade, chances are either Microsoft introduced a new 'feature' (usually disabling an industry-standard protocol, in favor of their own 'standard'), or it has bugs.

I'd first try to use a GUI based mail client on Linux, and 'scan' the Exchange server, to see what methods of authentication it's presenting as options. Plain-text SSL should be present at the very least.


All times are GMT -5. The time now is 09:09 PM.