Page 1 of 2

testing gmail simply reloads the page, nothing happens

Posted: 19 Dec 2016, 14:26
by slabo
I'm on Email Reporting: Mailbox settings
I configure the settings as accurately as I know, click Add then scroll down, select the new entry, select Test and then click Select Mailbox. When the new page loads, I scroll down and click test. Nothing happens, it simply reloads the page, no error message, no nothing.

Re: testing gmail simply reloads the page, nothing happens

Posted: 19 Dec 2016, 19:19
by slabo
Further testing. I tried a little php script with the same config details as I used in the EmailReporting plugin, works, I can get the last few emails in my inbox. So IMAP is allowed and works.

Any help appreciated,
Thanks

Re: testing gmail simply reloads the page, nothing happens

Posted: 19 Dec 2016, 21:53
by slabo
On a different machine, trying Test produces the same behavior again.
But trying Complete Test actually gave an error message.

( ! ) Fatal error: Maximum execution time of 30 seconds exceeded in C:\Program Files\Ampps\www\mantis\plugins\EmailReporting\core_pear\Net\IMAPProtocol.php on line 2786
Call Stack
# Time Memory Function Location
1 0.0040 149232 {main}( ) ...\plugin.php:0
2 0.2500 6907768 include( 'C:\Program Files\Ampps\www\mantis\plugins\EmailReporting\pages\manage_mailbox_edit.php' ) ...\plugin.php:69
3 0.3410 8863968 ERP_mailbox_api->process_mailbox( ) ...\manage_mailbox_edit.php:67
4 0.3430 8866960 ERP_mailbox_api->process_imap_mailbox( ) ...\mail_api.php:230
5 2.9092 8897136 Net_IMAP->getListing( ) ...\mail_api.php:404
6 2.9092 8897208 Net_IMAP->getMessagesList( ) ...\IMAP.php:3013
7 2.9092 8897336 Net_IMAPProtocol->cmdFetch( ) ...\IMAP.php:411
8 2.9092 8897448 Net_IMAPProtocol->_genericCommand( ) ...\IMAPProtocol.php:987
9 12.0147 9619584 Net_IMAPProtocol->_genericImapResponseParser( ) ...\IMAPProtocol.php:3561
10 29.9557 9671192 Net_IMAPProtocol->_retrParsedResponse( ) ...\IMAPProtocol.php:3458
11 29.9617 9671240 Net_IMAPProtocol->_getEXTarray( ) ...\IMAPProtocol.php:3099
12 29.9987 9671808 Net_IMAPProtocol->_getNextToken( ) ...\IMAPProtocol.php:2888
Any help appreciated, thanks

Re: testing gmail simply reloads the page, nothing happens

Posted: 19 Dec 2016, 23:22
by SL-Gundam
EmailReporting forwarded "Test" on succes back to the mailbox page when so configured in MantisBT. So Basically it meaned no errors were encountered
This is confusing people more and more so it has now been changed in 0.9.3-DEV
https://github.com/mantisbt-plugins/Ema ... a823137955

As for the second issue. For some reason your mail server connection seems slow. Maybe it the internal connection or the mail server or maybe something else entirely. Could it be a large email thats waiting in the mailbox?
Either way during testing EmailReporting is limited by default PHP limitations for max runtime and memory usage. This is not an issue when EmailReporting's scripts/bug_report_mail.php is called from the command line as those limitations will be removed... if possible. Try running scripts/bug_report_mail.php from the command line and see whether it eventually completes without issue

Re: testing gmail simply reloads the page, nothing happens

Posted: 21 Dec 2016, 12:43
by slabo
Ran full test, Operation successful.

I wish I know what I did different this time. I wiped ampps and started fresh. I know, first time I got Operation failed when doing the simple test, then, after fixing the settings, I was simply getting redirected without confirmation that the test was successful. Yes, it is confusing. Thanks for fixing though, next version.

Re: testing gmail simply reloads the page, nothing happens

Posted: 21 Dec 2016, 12:50
by slabo
OK, I just can't find documentation on what to do next. How do I get an email to create an issue?

Re: testing gmail simply reloads the page, nothing happens

Posted: 21 Dec 2016, 16:43
by SL-Gundam
You've set up a mailbox in EmailReporting.
Now you need to create a cron/scheduled job so that "/scripts/bug_report_mail.php" is run every X minutes

Every time that script runs it will check the mailbox for new emails and turn them into issues or notes

Re: testing gmail simply reloads the page, nothing happens

Posted: 22 Dec 2016, 14:29
by slabo
SL-Gundam wrote:You've set up a mailbox in EmailReporting.
Now you need to create a cron/scheduled job so that "/scripts/bug_report_mail.php" is run every X minutes

Every time that script runs it will check the mailbox for new emails and turn them into issues or notes

OK, I tried that. Nothing happened. when I run the script on command line, I get::
f:\Ampps\php\php.exe f:\Ampps\www\mantis\plugins\EmailReporting\scripts\bug_report_mail.php
Start checking all mailboxes: Thursday 22nd of December 2016 14:17:03



Done checking all mailboxes
I also assigned the Mail58241 (the user created by installing the email reporting plugin) to a project and made sure the setting Email Reporting: Create new issues is set to yes. After that, I sent an email and nothing happened. Not issues created. The default settings look fine. how can i further troubleshoot this?

Any help appreciated,
Thanks

Re: testing gmail simply reloads the page, nothing happens

Posted: 22 Dec 2016, 17:12
by SL-Gundam
That is generally the result if EmailReporting does not find any emails... or maybe even mailboxes to process. Since i expect you to have added at least one mailbox and based on your description also prepared an email... this is unexpected

Please enable debug mode.
Please enable "Show the memory usage in different stages of the email processing process"

This will show the processing in various stages

Re: testing gmail simply reloads the page, nothing happens

Posted: 23 Dec 2016, 08:16
by slabo
Thanks for the prompt reply.

yes weird. Everywhere I go, I can't find what I'm looking for, can't get what I need, everything is on hold.

No complaints though, just another person born to struggle.

C:\Users\nab>f:\Ampps\php\php.exe f:\Ampps\www\mantis\plugins\EmailReporting\scripts\bug_report_mail.php
Start checking all mailboxes: Friday 23rd of December 2016 08:11:57

Debug output memory usage
Location: Mail API - Finished __construct
Runtime in seconds: 0
Current memory usage: 8.37 MiB / -1
Peak memory usage: 8.4 MiB / -1
Current real memory usage: 8.5 MiB / -1
Peak real memory usage: 8.5 MiB / -1

F:\Ampps\www\mantis\plugins\EmailReporting\core\mail_api.php:222:
array(14) {
'enabled' =>
int(1)
'description' =>
string(17) "SIMS help at MEHE"
'mailbox_type' =>
string(4) "IMAP"
'hostname' =>
string(20) "ssl://imap.gmail.com"
'port' =>
int(993)
'encryption' =>
string(3) "SSL"
'ssl_cert_verify' =>
int(0)
'erp_username' =>
string(24) "******@gmail.com"
'erp_password' =>
string(12) "UTExcXdyZWQ="
'auth_method' =>
string(4) "USER"
'project_id' =>
int(1)
'global_category_id' =>
int(1)
'imap_basefolder' =>
string(0) ""
'imap_createfolderstructure' =>
int(1)
}

Debug output memory usage
Location: Mail API - Start process mailbox
Runtime in seconds: 0.0013
Current memory usage: 8.38 MiB / -1
Peak memory usage: 8.44 MiB / -1
Current real memory usage: 8.5 MiB / -1
Peak real memory usage: 8.5 MiB / -1

Debug output memory usage
Location: Mail API - Finished process mailbox
Runtime in seconds: 2.6295
Current memory usage: 8.4 MiB / -1
Peak memory usage: 8.48 MiB / -1
Current real memory usage: 8.5 MiB / -1
Peak real memory usage: 8.5 MiB / -1



Done checking all mailboxes

Re: testing gmail simply reloads the page, nothing happens

Posted: 23 Dec 2016, 08:49
by slabo
By the way, I'm running a stock Mantis installation, and no other plugins installed. Below is my config::

All Users All Projects database_version integer 209 administrator
All Users All Projects plugin_EmailReporting_config_version integer 15 administrator EditCloneDelete
All Users All Projects plugin_EmailReporting_job_users complex
array (
'cli' => 'Nabudarwish',
)
administrator EditCloneDelete
All Users All Projects plugin_EmailReporting_mailboxes complex
array (
0 =>
array (
'enabled' => 1,
'description' => 'SIMS help at MEHE',
'mailbox_type' => 'IMAP',
'hostname' => 'imap.gmail.com',
'port' => '993',
'encryption' => 'SSL',
'ssl_cert_verify' => 0,
'erp_username' => '*******@gmail.com',
'erp_password' => 'UTExcXdyZWQ=',
'auth_method' => 'USER',
'project_id' => 1,
'global_category_id' => 1,
'imap_basefolder' => '',
'imap_createfolderstructure' => 1,
),
)
administrator EditCloneDelete
All Users All Projects plugin_EmailReporting_mail_debug integer 1 administrator EditCloneDelete
All Users All Projects plugin_EmailReporting_mail_debug_show_memory_usage integer 1 administrator EditCloneDelete
All Users All Projects plugin_EmailReporting_mail_mantisbt_url_fix string
'http://127.0.0.1/mantis/'

administrator EditCloneDelete
All Users All Projects plugin_EmailReporting_mail_reporter_id integer 2 administrator EditCloneDelete
All Users All Projects plugin_EmailReporting_reset_schema integer 1 administrator EditCloneDelete
All Users All Projects plugin_EmailReporting_schema integer 1 administrator

Re: testing gmail simply reloads the page, nothing happens

Posted: 23 Dec 2016, 20:00
by SL-Gundam
This is the result when EmailReporting does its job but does not find any emails to process

Based on how your mailbox has been set up EmailReporting works as follows
  1. Connect to mailbox
  2. Go to the IMAP basefolder. In your case this will be the INBOX folder since you left it empty
  3. Iterate through the subfolders of INBOX for every project that exists in your MantisBT installation as you've enabled imap_createfolderstructure
  4. If emails are found in one of the subfolders of INBOX that matches a projectname in your MantisBT installation, that email will be processed
This means that emails directly in the INBOX folder will not be processed

If you want EmailReporting to process the emails directly in the INBOX folder then you need to disable imap_createfolderstructure
Or maybe set up 2 mailboxes in EmailReporting. One to process the inbox folder and one to process the subfolders

Re: testing gmail simply reloads the page, nothing happens

Posted: 26 Dec 2016, 20:34
by slabo
thanks. Create project subfolder structure didn't mean this to me, but the documentation is more than clear on this.

Re: testing gmail simply reloads the page, nothing happens

Posted: 27 Dec 2016, 03:14
by SL-Gundam
What did it mean to you? Maybe we can make the distinction better if we understand what you misunderstood

Good luck using MantisBT and EmailReporting if you have any further issues please let us know

Re: testing gmail simply reloads the page, nothing happens

Posted: 27 Dec 2016, 12:32
by slabo
I didn't think it would break Mantis for me. Thought that later on when the mailbox for the support email has subfolders for some reason, that we should also have these folders in Mantis. Didn't know it won't check the inbox and will only check the subfolders.

Also didn't know that folders should match categories existing in Mantis.