Page 1 of 1

PEAR Error

Posted: 22 Jul 2011, 12:51
by andrea.mills
When i test the mailbox (in debug mode) i get an array printout, but no Mantis page.

I try to run the reporting script and get this error:

Code: Select all

Mailbox: Test
[pear_error: message=", " code=0 mode=return level=notice prefix="" info=""]

Fatal error: Cannot use object of type PEAR_Error as array in C:\wamp\www\mantis
\plugins\EmailReporting\core\Net\IMAP_1.0.3.php on line 176
I have PEAR installed. But maybe not all the packages required?

Mantis: 1.2.5
PHP: 5.3.6
Email Reporting: 0.8.4 with 0.9.0-DEV mimeDecode
mailbox settings:

Code: Select all

array
  'enabled' => boolean true
  'description' => string 'Test' (length=4)
  'type' => string 'IMAP' (length=4)
  'hostname' => string 'gsemail' (length=8)
  'port' => int 993
  'encryption' => string 'None' (length=4)
  'username' => string 'mantisemail@gses.com' (length=20)
  'password' => string '*****************' (length=12)
  'auth_method' => string 'USER' (length=4)
  'project_id' => int 1
  'global_category_id' => int 5
  'basefolder' => string '' (length=0)
  'createfolderstructure' => boolean false
What am I doing wrong?

Re: PEAR Error

Posted: 22 Jul 2011, 18:15
by SL-Gundam
The array dump was only shown in debug mode. This should not have happened during testing so i've applied a fix for it: https://github.com/mantisbt-plugins/Ema ... cbe857cb9e

I've made some improvements in the error handling with IMAP. Hopefully it will return a proper error for you or even better just work as it should: https://github.com/mantisbt-plugins/Ema ... 88647f871d

Please let me know the results

Re: PEAR Error

Posted: 26 Jul 2011, 12:30
by andrea.mills
So if i test a mailbox and nothing is reported, does that mean everything is okay? I'm now using the latest version from git (i think. this is the first time using git).

I ran the script via command line and this is the return:
Mailbox: INITIALIZATION PHASE
Message: Debug output memory usage
Location: Mail API - Finished __construct
Current memory usage: 10.92 MiB / 128M
Peak memory usage: 10.92 MiB / 128M
Current real memory usage: 11 MiB / 128M
Peak real memory usage: 11 MiB / 128M

array(13) {
["enabled"]=>
bool(true)
["description"]=>
string(4) "Test"
["hostname"]=>
string(8) "gsemail1"
["port"]=>
int(993)
["encryption"]=>
string(3) "SSL"
["username"]=>
string(20) "mantisemail@gses.com"
["password"]=>
string(12) "***********"
["auth_method"]=>
string(4) "USER"
["project_id"]=>
int(1)
["global_category_id"]=>
int(5)
["mailbox_type"]=>
string(4) "IMAP"
["imap_basefolder"]=>
string(0) ""
["imap_createfolderstructure"]=>
bool(false)
}


Mailbox: Test
Message: Debug output memory usage
Location: Mail API - Start process mailbox
Current memory usage: 10.92 MiB / 128M
Peak memory usage: 10.93 MiB / 128M
Current real memory usage: 11 MiB / 128M
Peak real memory usage: 11 MiB / 128M



Mailbox: Test
Message: Debug output memory usage
Location: Mail API - Finished process mailbox
Current memory usage: 10.92 MiB / 128M
Peak memory usage: 10.93 MiB / 128M
Current real memory usage: 11 MiB / 128M
Peak real memory usage: 11 MiB / 128M



Mailbox: Test
[pear_error: message=", " code=0 mode=return level=notice prefix="" info=""]


Done checking all mailboxes

Re: PEAR Error

Posted: 26 Jul 2011, 12:43
by andrea.mills
However, if i run via the web interface, here is the output:

Code: Select all

Mailbox: Test Message: Debug output memory usage Location: Mail API - Start process mailbox Current memory usage: 15.32 MiB / 256M Peak memory usage: 15.34 MiB / 256M Current real memory usage: 15.5 MiB / 256M Peak real memory usage: 15.5 MiB / 256M Mailbox: Test Message: Debug output memory usage Location: Mail API - Finished process mailbox Current memory usage: 15.32 MiB / 256M Peak memory usage: 15.34 MiB / 256M Current real memory usage: 15.5 MiB / 256M Peak real memory usage: 15.5 MiB / 256M 2907,C:\wamp\www\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:| A0007 OK STATUS completed. | 2863,C:\wamp\www\mantis\plugins\EmailReporting\core\Net\IMAPProtocol_1.0.3.php,PROTOCOL ERROR!:must be a but is a 'A0007' !!!! 2895,C:\wamp\www\mantis\plugins\EmailReporting\core\Net\IMAPProtocol_1.0.3.php,PROTOCOL ERROR!:bogus response!!!! (COMMAND: ) 2907,C:\wamp\www\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. | 2863,C:\wamp\www\mantis\plugins\EmailReporting\core\Net\IMAPProtocol_1.0.3.php,PROTOCOL ERROR!:must be a but is a 'STATUS' !!!! 2895,C:\wamp\www\mantis\plugins\EmailReporting\core\Net\IMAPProtocol_1.0.3.php,PROTOCOL ERROR!:bogus response!!!! (COMMAND: ) 2907,C:\wamp\www\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: Test [pear_error: message=", " code=0 mode=return level=notice prefix="" info=""] Done checking all mailboxes

Re: PEAR Error

Posted: 27 Jul 2011, 15:13
by SL-Gundam
I suggest you try different options for the port number, encryption and auth_method.

But the real problem is, is that the net_imap pear package is broken (at least some parts of it) in 1.1.0. Thats why the use of 1.0.3 is forced. Currently i'm thinking about using the pecl imap package which seems to be better maintained.

What you can try is setting up a imap mailbox for gmail just to test whether that works without issues. Working IMAP setup for gmail:

'hostname' => 'imap.gmail.com',
'port' => '',
'encryption' => 'SSL',
'username' => 'xxxxxx',
'password' => 'xxxxxx',
'auth_method' => 'USER',
'mailbox_type' => 'IMAP',
'imap_basefolder' => 'xxxxxx',
'imap_createfolderstructure' => false,

If gmail works and your own imap server does not, then there is a compatibility issue with your imap server. Hopefully this can be addressed when EmailReporting starts using the beforementioned pecl package

Please let me know the results

Re: PEAR Error

Posted: 27 Jul 2011, 18:30
by andrea.mills
It seems to work with gmail's IMAP. Thanks for your help.

Re: PEAR Error

Posted: 02 Aug 2011, 18:01
by andrea.mills
Does the plugin care about the SSL certificate? My (Exchange) mail server is using a self-signed certificate, and Google is using a public one. Could that cause these parsing errors?

In general, IMAP works fine for a google mailbox, and for a unix mailbox, but EmailReporting gets really unhappy when it tries to use a microsoft exchange mailbox.

Thoughts?

Re: PEAR Error

Posted: 02 Aug 2011, 22:16
by SL-Gundam
As far as i know it does not cause any problems. But who knows it could differ per mail server.

I know that POP3 really does not care as the ms exchange server in my company has an incorrect certificate and EmailReporting works without issues.

Which Exchange Server do you have? I've got an Exchange 2010 server where i could perform some tests on.

Re: PEAR Error

Posted: 04 Aug 2011, 23:25
by andrea.mills
I'm running Exchange 2010

Re: PEAR Error

Posted: 05 Aug 2011, 16:37
by SL-Gundam
Will test it.

If i find anything i'll let you know

Re: PEAR Error

Posted: 05 Aug 2011, 20:44
by SL-Gundam
Well did some tests towards exhange 2010.

Net_imap 1.0.3 works for login but fails getting emails
Net_imap 1.1.0 fails login and can therefore not be tested any further than that

Searching for this problem on the internet resulted in nothing except that some people got the pecl imap package working towards exchange 2010.

I think we'll have to wait for the final 0.9.0 (or 0.9.0-DEV once the work has been committed by somebody into the git repository) which will hopefully be ready to use the pecl imap package instead of the net_imap package

But POP3 still works without issues so if its possible i suggest you use that in the mean time

Re: PEAR Error

Posted: 08 Aug 2011, 12:35
by andrea.mills
Thanks so much for all of your time on this issue. I can't wait for the 0.9.0 release!

Another workaround (for anyone else that might come across this thread) is to forward Exchange mail to a mailbox that plays nicer with Net_IMAP, and link that account to EmailReporting. That way, your users still get to email "support@company.com".

Re: PEAR Error

Posted: 18 Aug 2011, 12:35
by nourdine
Hello

I want to know what is the format of the incoming mail in order to test Issues Creation


Thanks by Advance
Nourdine

Re: PEAR Error

Posted: 18 Aug 2011, 15:11
by SL-Gundam
what do you mean format of the incoming email?

p.s. please don't post in topics that are about completely different issues. Create a new topic

Re: PEAR Error

Posted: 07 Sep 2011, 04:58
by dereks
Hello! Thanks for writing this great plugin. I think this is a killer feature for Mantis.

I wanted to let you know, I also got this error:

Code: Select all

[pear_error: message=", " code=0 mode=return level=notice prefix="" info=""]
The reason I got it this error is that my setting for Manage Plugins > Email Reporting > Manage Mailboxes > Connection encryption was incorrect. It worked fine once I set it to SSL.

I am using Dovecot IMAP and a self-signed SSL certificate. It works great!

However, I had the wrong Connection encryption setting due to a user interface bug. I did correctly set that to SSL when I first tried to configure it. But then when I tried to Add that mailbox, I was missing one of the other required fields. When the user interface showed me the page again, it did not retain my previously-entered setting for Connection encryption. (It did, however, retain the other settings fine... which is why I missed the fact that SSL was not set.)

Perhaps this will help someone else with the same issue.