PEAR Error

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

Moderators: Developer, Contributor

PEAR Error

Postby andrea.mills » Jul 22, 2011 7:51 am

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?
andrea.mills
 
Posts: 35
Joined: Jul 22, 2011 7:38 am

Re: PEAR Error

Postby SL-Gundam » Jul 22, 2011 1:15 pm

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
SL-Gundam
 
Posts: 181
Joined: Jul 06, 2011 9:17 am

Re: PEAR Error

Postby andrea.mills » Jul 26, 2011 7:30 am

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
andrea.mills
 
Posts: 35
Joined: Jul 22, 2011 7:38 am

Re: PEAR Error

Postby andrea.mills » Jul 26, 2011 7:43 am

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
andrea.mills
 
Posts: 35
Joined: Jul 22, 2011 7:38 am

Re: PEAR Error

Postby SL-Gundam » Jul 27, 2011 10:13 am

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
SL-Gundam
 
Posts: 181
Joined: Jul 06, 2011 9:17 am

Re: PEAR Error

Postby andrea.mills » Jul 27, 2011 1:30 pm

It seems to work with gmail's IMAP. Thanks for your help.
andrea.mills
 
Posts: 35
Joined: Jul 22, 2011 7:38 am

Re: PEAR Error

Postby andrea.mills » Aug 02, 2011 1:01 pm

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?
andrea.mills
 
Posts: 35
Joined: Jul 22, 2011 7:38 am

Re: PEAR Error

Postby SL-Gundam » Aug 02, 2011 5:16 pm

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.
SL-Gundam
 
Posts: 181
Joined: Jul 06, 2011 9:17 am

Re: PEAR Error

Postby andrea.mills » Aug 04, 2011 6:25 pm

I'm running Exchange 2010
andrea.mills
 
Posts: 35
Joined: Jul 22, 2011 7:38 am

Re: PEAR Error

Postby SL-Gundam » Aug 05, 2011 11:37 am

Will test it.

If i find anything i'll let you know
SL-Gundam
 
Posts: 181
Joined: Jul 06, 2011 9:17 am

Re: PEAR Error

Postby SL-Gundam » Aug 05, 2011 3:44 pm

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
SL-Gundam
 
Posts: 181
Joined: Jul 06, 2011 9:17 am

Re: PEAR Error

Postby andrea.mills » Aug 08, 2011 7:35 am

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".
andrea.mills
 
Posts: 35
Joined: Jul 22, 2011 7:38 am

Re: PEAR Error

Postby nourdine » Aug 18, 2011 7:35 am

Hello

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


Thanks by Advance
Nourdine
nourdine
 
Posts: 9
Joined: Aug 04, 2011 3:39 am

Re: PEAR Error

Postby SL-Gundam » Aug 18, 2011 10:11 am

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
SL-Gundam
 
Posts: 181
Joined: Jul 06, 2011 9:17 am

Re: PEAR Error

Postby dereks » Sep 06, 2011 11:58 pm

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.
dereks
 
Posts: 3
Joined: Sep 06, 2011 11:23 pm


Return to EmailReporting

Who is online

Users browsing this forum: No registered users and 1 guest