IMAP revisited

This plugin allows you to report an issue in MantisBT by sending an email to a particular mail account

Moderators: Developer, Contributor

Post Reply
GeroldK
Posts: 14
Joined: 30 Jul 2009, 12:12

IMAP revisited

Post by GeroldK »

Hello,

we just spent a day trying to configure Email reporting and are halfway there. We run Mantis 1.2.3 and Email Reporting 0.8.4 towards Exchange 2010. And yes, I have read the previous posts in this forum.

First , documentation is very sparse (expecially for those not dealing with email and authentication protocols for a living), but should I ever get this running I promise to write a users guide (with screenshots) for the undiscerning user. Promised.

The goal is not too ambitious: In my Outlook I would like to d&d a mail to a specific folder. The mail should then quickly appear in the correct project. If a bug id is found the mail should be attached as a bugnote and the attachments uploaded. If not, a new issue should be created and the attachments uploaded.

We have around 25 projects, so I do not want one mailbox per project. So I choose IMAP for soon to learn that MS has abandoned IMAP support for public folders in 2010. I created an account and - lo and behold - after a few tweaks EmailReporting would take the specified Inbox/mantis as the basefolder and create subfolders for the existing projects. That is how far I am.

I posted a mail in one of the projects with an existing bug id in the subject. When I run 'php.exe -q bug_report_mail.php I get all sorts of protocol errors of which I add an excerpt for the disposed reader:
-----------------------------------------------------
Mailbox: Temporary Storage for E-Mail cases
[pear_error: message=", " code=0 mode=return level=notice prefix="" info=""]
2915,D:\Mantis\plugins\EmailReporting\core\Net\IMAPProtocol_1.0.3.php,PROTOCOL ERROR!:PARSE ERROR!!! must be a '\r\n' here but is a
' '!!!! (getting the next line)|STR:|
A000168 OK STATUS completed.
|
2871,D:\Mantis\plugins\EmailReporting\core\Net\IMAPProtocol_1.0.3.php,PROTOCOL ERROR!:must be a but is a 'A000168' !!!!
2903,D:\Mantis\plugins\EmailReporting\core\Net\IMAPProtocol_1.0.3.php,PROTOCOL ERROR!:bogus response!!!! (COMMAND: )
2915,D:\Mantis\plugins\EmailReporting\core\Net\IMAPProtocol_1.0.3.php,PROTOCOL ERROR!:PARSE ERROR!!! must be a '\r\n' here but is a
'OK'!!!! (getting the next line)|STR:| STATUS completed.
|
2871,D:\Mantis\plugins\EmailReporting\core\Net\IMAPProtocol_1.0.3.php,PROTOCOL ERROR!:must be a but is a 'STATUS' !!!!
2903,D:\Mantis\plugins\EmailReporting\core\Net\IMAPProtocol_1.0.3.php,PROTOCOL ERROR!:bogus response!!!! (COMMAND: )
2915,D:\Mantis\plugins\EmailReporting\core\Net\IMAPProtocol_1.0.3.php,PROTOCOL ERROR!:PARSE ERROR!!! must be a '\r\n' here but is a
'COMPLETED.'!!!! (getting the next line)|STR:|
|


Mailbox: Temporary Storage for E-Mail cases
[pear_error: message=", " code=0 mode=return level=notice prefix="" info=""]
2915,D:\Mantis\plugins\EmailReporting\core\Net\IMAPProtocol_1.0.3.php,PROTOCOL ERROR!:PARSE ERROR!!! must be a '\r\n' here but is a
' '!!!! (getting the next line)|STR:|
A000171 OK STATUS completed.
|
2871,D:\Mantis\plugins\EmailReporting\core\Net\IMAPProtocol_1.0.3.php,PROTOCOL ERROR!:must be a but is a 'A000171' !!!!
2903,D:\Mantis\plugins\EmailReporting\core\Net\IMAPProtocol_1.0.3.php,PROTOCOL ERROR!:bogus response!!!! (COMMAND: )
2915,D:\Mantis\plugins\EmailReporting\core\Net\IMAPProtocol_1.0.3.php,PROTOCOL ERROR!:PARSE ERROR!!! must be a '\r\n' here but is a
'OK'!!!! (getting the next line)|STR:| STATUS completed.
|
2871,D:\Mantis\plugins\EmailReporting\core\Net\IMAPProtocol_1.0.3.php,PROTOCOL ERROR!:must be a but is a 'STATUS' !!!!
2903,D:\Mantis\plugins\EmailReporting\core\Net\IMAPProtocol_1.0.3.php,PROTOCOL ERROR!:bogus response!!!! (COMMAND: )
2915,D:\Mantis\plugins\EmailReporting\core\Net\IMAPProtocol_1.0.3.php,PROTOCOL ERROR!:PARSE ERROR!!! must be a '\r\n' here but is a
'COMPLETED.'!!!! (getting the next line)|STR:|
|


Mailbox: Temporary Storage for E-Mail cases
[pear_error: message=", " code=0 mode=return level=notice prefix="" info=""]
2915,D:\Mantis\plugins\EmailReporting\core\Net\IMAPProtocol_1.0.3.php,PROTOCOL ERROR!:PARSE ERROR!!! must be a '\r\n' here but is a
' '!!!! (getting the next line)|STR:|
A000174 OK STATUS completed.
|
2871,D:\Mantis\plugins\EmailReporting\core\Net\IMAPProtocol_1.0.3.php,PROTOCOL ERROR!:must be a but is a 'A000174' !!!!
2903,D:\Mantis\plugins\EmailReporting\core\Net\IMAPProtocol_1.0.3.php,PROTOCOL ERROR!:bogus response!!!! (COMMAND: )
2915,D:\Mantis\plugins\EmailReporting\core\Net\IMAPProtocol_1.0.3.php,PROTOCOL ERROR!:PARSE ERROR!!! must be a '\r\n' here but is a
'OK'!!!! (getting the next line)|STR:| STATUS completed.
|
2871,D:\Mantis\plugins\EmailReporting\core\Net\IMAPProtocol_1.0.3.php,PROTOCOL ERROR!:must be a but is a 'STATUS' !!!!
2903,D:\Mantis\plugins\EmailReporting\core\Net\IMAPProtocol_1.0.3.php,PROTOCOL ERROR!:bogus response!!!! (COMMAND: )
2915,D:\Mantis\plugins\EmailReporting\core\Net\IMAPProtocol_1.0.3.php,PROTOCOL ERROR!:PARSE ERROR!!! must be a '\r\n' here but is a
'COMPLETED.'!!!! (getting the next line)|STR:|
|


Mailbox: Temporary Storage for E-Mail cases
[pear_error: message=", " code=0 mode=return level=notice prefix="" info=""]


Done checking all mailboxes
--------------------------------

The mail is still there and no bugnote has been created. The two seem to not agree on which languahe to speak. After some research my finding are

1. What I want is currently NOT possible in my configuration
2. In 0.8.4 the IMAP access with Exchange 2010 is broken
3. There are plans to use another IMAP package in 0.9
4. I have to upgrade to Mantis 1.2.6

Is this correct? When is the planned release of 0.9 ?

Kind regards,

/Gerold
SL-Gundam
Posts: 722
Joined: 06 Jul 2011, 14:17

Re: IMAP revisited

Post by SL-Gundam »

All correct

Currently there is no planned release date for 0.9.0 as their is still a lot of work to be done

This is the other imap package and as can be seen from the notes its possble to get it to work with exchange 2010: http://www.php.net/manual/en/function.imap-open.php

Anyone who wants to help out is free to provide patches to the repository: https://github.com/mantisbt-plugins/EmailReporting
It would help speed up the release of the new version of EmailReporting
andrea.mills
Posts: 35
Joined: 22 Jul 2011, 12:38

Re: IMAP revisited

Post by andrea.mills »

I've created a fairly extensive document on how to install. You can see it here: https://docs.google.com/document/d/1U2y ... t?hl=en_US
SL-Gundam
Posts: 722
Joined: 06 Jul 2011, 14:17

Re: IMAP revisited

Post by SL-Gundam »

Pretty nice guide

Is this document meant for your installation of Mantis + EmailReporting or as a general installation guide? If this guide is in general then the guide needs to take a more advisal point of view for basic settings. For example take the setting "What kind of search should be used to find issue id in subject". Relaxed might be necessary for you but its ill advised to set this to relaxed for everybody. Balanced would be a better advise
GeroldK
Posts: 14
Joined: 30 Jul 2009, 12:12

Re: IMAP revisited

Post by GeroldK »

Is there a particular reason (apart from just not being implemented) that the design with the subfolder per project is not available with POP3 access?

Just dreaming ....

Kind regards,

/Gerold
SL-Gundam
Posts: 722
Joined: 06 Jul 2011, 14:17

Re: IMAP revisited

Post by SL-Gundam »

pop3 only allows retrieval of the inbox by basic design of the pop3 protocol. IMAP on the other hand allows folder browsing so made it possible to use that

So not a limitation present in EmailReporting but rather a limitation of pop3
andrea.mills
Posts: 35
Joined: 22 Jul 2011, 12:38

Re: IMAP revisited

Post by andrea.mills »

The guide was just for me; I shared because most of the general ideas are there. I can alter this guide to be more general, put it in txt format, and push to git if that helps your project documentation.
SL-Gundam
Posts: 722
Joined: 06 Jul 2011, 14:17

Re: IMAP revisited

Post by SL-Gundam »

Most of the project documentation needs to be moved to the EmailReporting wiki page.

We've already pointed the [?] links behind all the settings in the plugin to the wiki page, we just need to fill the anchors with the necessary information.

After that it might be nice to have a look what still isn't covered and see how best to document those. For that a guide might be nice.

Also since the imap support is most likely going to be moved from the net_imap package to the imap extension, your guide might go instantly out of date upon release of 0.9.0

So for now lets leave it here for people visiting the forums and once 0.9.0 is released maybe you could update your guide for that version and then share it with us again
SL-Gundam
Posts: 722
Joined: 06 Jul 2011, 14:17

Re: IMAP revisited

Post by SL-Gundam »

Well after a lof of checking and debugging i've found the cause of this issue

Exchange seems to not support the MESSAGES command which net_imap uses to retrieve the number of messages in a folder.

I'm going to remove this function call and use a different method
SL-Gundam
Posts: 722
Joined: 06 Jul 2011, 14:17

Re: IMAP revisited

Post by SL-Gundam »

Pushed the possible fix for this to github

I'm going to test the fix myself on Monday but i think this should do it

https://github.com/mantisbt-plugins/Ema ... a2ab8e3abb
Post Reply