# Logstash Imap for shared mailbox

**URL:** <https://discuss.elastic.co/t/logstash-imap-for-shared-mailbox/51808>\
**Category:** Logstash\
**Created:** [June 3, 2016, 3:39pm UTC](https://discuss.elastic.co/t/logstash-imap-for-shared-mailbox/51808 "2016-06-03T15:39:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alex.C](https://avatars.discourse-cdn.com/v4/letter/a/4bbf92/32.png) [@Alex.C](https://discuss.elastic.co/u/Alex.C)\
**Post date:** [June 3, 2016, 3:39pm UTC](https://discuss.elastic.co/t/logstash-imap-for-shared-mailbox/51808/1 "2016-06-03T15:39:11Z")

</div>

Hello,

I have a mailbox bind with shared mailbox on office365.  
My mailbox is define: [user@mydomain.com](mailto:user@mydomain.com)  
My shared mailbox is define: [sharedmailbox01@subdomain.mydomain.com](mailto:sharedmailbox01@subdomain.mydomain.com)

Reffering to this article : [Access Shared mailbox using thunderbird](https://social.technet.microsoft.com/Forums/msonline/en-US/6369118f-7dee-4728-ac1c-a0c706b3d290/office-365-exchange-online-how-to-access-a-shared-mailbox-using-thunderbird-or-other-imap-client?forum=onlineservicesexchange)  
Using username with \ character; I define the configuration file as below :

> input {  
> imap {  
> host =\> "[outlook.office365.com](http://outlook.office365.com)"  
> user =\> "[user@mydomain.com](mailto:user@mydomain.com)\sharedmailbox01@subdomain.mydomain.com"  
> password =\> "myUserPassWord"  
> secure =\> true  
> }   
> }

The log file indicate error message as:

> A plugin had an unrecoverable error. Will restart this plugin.  
> Plugin: \<LogStash::Inputs::IMAP [connexion info] Error: LOGIN failed.", :level=\>:error

I found a article [here](https://community.office365.com/en-us/f/158/t/163878) indicate that this method not work anymore (and know as \> the only way to access from mobile using imap configuration)

Checking on the [input imap documentation](https://www.elastic.co/guide/en/logstash/current/plugins-inputs-imap.html): I didn't find any clue on parameter to use the shared mailbox.

Also about IMAP v4 protocol, we can access and select mailbox using the keyword SELECT as define on [RFC3501](https://tools.ietf.org/html/rfc3501#section-6.3.1)  
And ruby implement it on NET.IMAP: [SELECT method](http://ruby-doc.org/stdlib-2.0.0/libdoc/net/imap/rdoc/Net/IMAP.html#method-i-select)  
This method is not used currently on [imap module](https://github.com/logstash-plugins/logstash-input-imap/blob/master/lib/logstash/inputs/imap.rb)

Does anyone has experience a workaround for this issue?

Thank you for your help,  
Best regards,  
Alex.

---

<div class="post-metadata">

**Author:** ![Alex.C](https://avatars.discourse-cdn.com/v4/letter/a/4bbf92/32.png) [@Alex.C](https://discuss.elastic.co/u/Alex.C)\
**Post date:** [July 5, 2016, 3:21pm UTC](https://discuss.elastic.co/t/logstash-imap-for-shared-mailbox/51808/2 "2016-07-05T15:21:31Z")

</div>

Hello,

Actually, I finally found out the issue.  
I was using the full mail address instead of alias of mailbox.  
So the working syntax are :

> input {  
> imap {  
> host =\> "[outlook.office365.com](http://outlook.office365.com)"  
> user =\> "[user@mydomain.com](mailto:user@mydomain.com)\sharedmailboxAlias"  
> password =\> "myUserPassWord"  
> secure =\> true  
> }   
> }

The **sharedmailboxAlias** is not the address mail but the alias of the shared mailbox.

Best regards,  
Alex.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 4:49am UTC](https://discuss.elastic.co/t/logstash-imap-for-shared-mailbox/51808/3 "2017-07-06T04:49:25Z")

</div>


