# Connecting to Exchange

**URL:** <https://www.ruby-forum.com/t/connecting-to-exchange/174967>\
**Category:** Ruby\
**Created:** [September 4, 2009, 10:02pm UTC](https://www.ruby-forum.com/t/connecting-to-exchange/174967 "2009-09-04T22:02:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![trevoke](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ee7513/32.png) [@trevoke](https://www.ruby-forum.com/u/trevoke)\
**Post date:** [September 4, 2009, 10:02pm UTC](https://www.ruby-forum.com/t/connecting-to-exchange/174967/1 "2009-09-04T22:02:30Z")

</div>

Imap fails for me, Pop fails for me. I’m guessing it’s because of  
enabled security protocols.

Is there a good way out there in Rubyland to make IMAP/POP work with  
enabled security?  
Or should I try win32ole and MAPI ? Can win32ole be used under Linux?  
I’m looking at the few MAPI posts that were done in this forum in the  
past and playing with that for now, hoping to get something to work.  
What’s the MAPI username supposed to be? The Active Directory username?

Any other solutions to connect to an exchange server? All I need to do  
is check/get/parse mail.

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![trevoke](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ee7513/32.png) [@trevoke](https://www.ruby-forum.com/u/trevoke)\
**Post date:** [September 4, 2009, 10:10pm UTC](https://www.ruby-forum.com/t/connecting-to-exchange/174967/2 "2009-09-04T22:10:34Z")

</div>

You’ll have to ask whoever administers Exchange to enable either IMAP  
or POP on the account. Otherwise, you probably want to try to connect  
via Webmail - which means a different set of ruby code if I am not  
mistaken (likely net/http and/or uri).

On Fri, Sep 4, 2009 at 4:02 PM, Aldric G.[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Any other solutions to connect to an exchange server? All I need to do  
> is check/get/parse mail.
> 
> ## Thanks in advance.
> 
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

–  
Rilindo F.  
AOL Instant Messenger: rilindo  
Google Talk: removed\_email\_address@domain.invalid  
Web S.: [http://www.monzell.com](http://www.monzell.com)  
Primary: removed\_email\_address@domain.invalid  
Secondary: removed\_email\_address@domain.invalid  
"Rich bachelors should be heavily taxed. It is not fair that some men  
should be happier than others. – Oscar Wilde

---

<div class="post-metadata">

**Author:** ![trevoke](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ee7513/32.png) [@trevoke](https://www.ruby-forum.com/u/trevoke)\
**Post date:** [September 4, 2009, 10:24pm UTC](https://www.ruby-forum.com/t/connecting-to-exchange/174967/3 "2009-09-04T22:24:02Z")

</div>

On Fri, Sep 4, 2009 at 4:02 PM, Aldric G.[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Imap fails for me, Pop fails for me. I’m guessing it’s because of  
> enabled security protocols.
> 
> Is there a good way out there in Rubyland to make IMAP/POP work with  
> enabled security?

Not likely without knowing more detail on why it is failing (have any  
specific error codes from the client and server?) and if you can  
successfully connect via IMAP from other programs.

> Any other solutions to connect to an exchange server? All I need to  
> do is check/get/parse mail.

Depending on the version of Exchange and server configuration you may  
be able to use the webdav or soap interfaces. I don’t know of any  
pre-rolled ruby libraries for those. Or, use one of the web scraping  
libraries on OWA.

---

<div class="post-metadata">

**Author:** ![trevoke](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ee7513/32.png) [@trevoke](https://www.ruby-forum.com/u/trevoke)\
**Post date:** [October 22, 2009, 5:26pm UTC](https://www.ruby-forum.com/t/connecting-to-exchange/174967/4 "2009-10-22T17:26:03Z")

</div>

On Sep 4, 3:20 pm, removed\_email\_address@domain.invalid wrote:

> > Any other solutions to connect to anexchangeserver? All I need to  
> > do is check/get/parse mail.
> 
> Depending on the version ofExchangeand server configuration you may  
> be able to use the webdav or soap interfaces. I don’t know of any  
> pre-rolled ruby libraries for those. Or, use one of the web scraping  
> libraries on OWA.

It is still in the early stages of development, but I am writing a  
client access library for MS Exchange that talks via Exchange Web  
Services that may help you out. You can get the code from  
[GitHub - WinRb/Viewpoint: A Ruby client access library for Microsoft Exchange Web Services (EWS)](http://github.com/zenchild/Viewpoint). Have a look at the README and  
some of the scripts in the “test” and “examples” directories.
