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

email exchange

by Sandy (Curate)
on Aug 28, 2015 at 15:48 UTC ( #1140359=perlquestion: print w/replies, xml ) Need Help??

Sandy has asked for the wisdom of the Perl Monks concerning the following question:

Hello all

I am trying to access an exchange server (over the web) via Email::Folder::Exchange

While running the sample code, I run into the following error:

Can't call method "attr" on an undefined value at Email/Folder/Exchange/EWS.pm line 123.

After a little investigation, it comes down to:

my code

use Email::Folder::Exchange::EWS; my $folder = Email::Folder::Exchange::EWS->new('my_server', $user,$p +ass);
Looking at the EWS.pm file, line 123 is:
$self->folder_id( $som->dataof('//FolderId')->attr->{Id} );
I inspected the $som object, and looked at some of the stuff in the code, and I think I can see where there might be an error, (and it is not with my credentials) but I am hesitant to start debugging all of this, when the point is to have a package that just works.

So, the question is: Is there an easy way to access an exchange server, via the web, with a perl program. What would be the best package?

Sandy

UPDATE:

Making a bit of progress... but can't seem to find the right credentials to log in.

Have established that the server is NOT https://exchange.domain.com/owa

as that is for the web-client not the soap client.

Am able to login (via a browser) to https:://exchange.domain.com/EWS/Services.wsdl with my standard username password, but does not work when I am using this from a perl script.

Still stymied.

Replies are listed 'Best First'.
Re: email exchange
by parv (Vicar) on Aug 28, 2015 at 21:07 UTC

    You seem to imply that the module produces error in your code shown while calling Email::Folder::Exchange::EWS->new(). Is that correct?

      Yes, it is the module that gives the error:

      After more and more fussing, (copying code from the module into a test file) I did manage to get an answer from the server.

      User authentication failed.

      But... I can login to what I think is the soap server for the exchange

      exchange.mydomain.com/EWS/Services.wsdl

      with my username

      username@domain

      and password.

      I tried changing the username in the code to

      domain/username

      and it still complained about unauthorized .

      I have been trying all sorts of combinations, and getting nowhere.

      I get the feeling I might be able to get this to work IF I can figure out the correct authentication. But I am stymied.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (3)
As of 2021-12-04 20:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    R or B?



    Results (30 votes). Check out past polls.

    Notices?