Page 1 of 2

Email reporting

Posted: 26 Dec 2016, 10:21
by hanizar
Hi,

Im very new with this plugin and not sure whether the current feature able to cater my need.

Question:

1. Does this feature able to report an issue automatically with a ticket ID upon receive an email (xyz@abc.com)

Example :
Step 1 - abc@gmail.com send email to xyz@abc.com
Step 2 - xyz@abc.com received email and automatically log issue in mantis.
Step 3 - xyz@abc.com automatically respond to abc@gmail.com with mantis ID.

Re: Email reporting

Posted: 26 Dec 2016, 12:58
by SL-Gundam
You need to set up an email address which this plugin will monitor for new emails.
Any emails that are received on that email address will be processed so don't make it your own work email address

It can send a ticket id to the reporting party if EmailReporting is able to connect it to a proper reporting user based on the email address and mail_email_receive_own or email_receive_own is enabled
It also depends heavily on the notification settings of MantisBT whether or not an actual email will be generated
In general you should assume that when an action in MantisBT triggers a notification email, then the equivalent action in EmailReporting should also trigger a notification email

So in short: EmailReporting is able to work this way if you set it up in the right way

Re: Email reporting

Posted: 27 Dec 2016, 13:39
by hanizar
How do I setup this function?

Re: Email reporting

Posted: 27 Dec 2016, 18:22
by SL-Gundam
Since there are a lot of variables into play and i only provide support for the EmailReporting part i suggest you try setting this up to your liking first

If you run into questions with MantisBT, i suggest you ask them here: http://www.mantisbt.org/forums/viewforum.php?f=3
If you run into questions or issues with the EmailReporting plugin you ask them here: http://www.mantisbt.org/forums/viewforum.php?f=13

There is also a lot of documentation available for MantisBT here: https://www.mantisbt.org/documentation.php
The documentation for EmailReporting can be found here: http://www.mantisbt.org/wiki/doku.php/m ... lreporting

Re: Email reporting

Posted: 29 Dec 2016, 08:48
by hanizar
Below are the response when I did a complete test. Please advice

array(14) {
["enabled"]=>
int(1)
["description"]=>
string(16) "Evelikto Support"
["mailbox_type"]=>
string(4) "IMAP"
["hostname"]=>
string(28) "mail.evelikto-support.com.my"
["port"]=>
int(143)
["encryption"]=>
string(4) "None"
["ssl_cert_verify"]=>
int(0)
["erp_username"]=>
string(31) "XXXXXXXX"
["erp_password"]=>
string(20) "XXXXXXXX=="
["auth_method"]=>
string(5) "LOGIN"
["project_id"]=>
int(1)
["global_category_id"]=>
int(127)
["imap_basefolder"]=>
string(0) ""
["imap_createfolderstructure"]=>
int(1)
}

Mailbox: Evelikto Support
Location: Retrieve list of messages
[pear_error: message="BAD, Error in IMAP command FETCH: Invalid messageset (0.000 + 0.000 secs)." code=0 mode=return level=notice prefix="" info=""]

Operation NOT successful

Description: Evelikto Support
Mailbox type: IMAP
Hostname: mail.evelikto-support.com.my
TCP port (optional): 143
Connection encryption: None
Verify SSL certificate: 0
Username: XXXXXXX
Password: ******
Authentication method: LOGIN
Basefolder (optional): INBOX

[pear_error: message="BAD, Error in IMAP command FETCH: Invalid messageset (0.000 + 0.000 secs)." code=0 mode=return level=notice prefix="" info=""]

Re: Email reporting

Posted: 29 Dec 2016, 16:42
by SL-Gundam
Is your mailserver Microsoft Exchange?
Some issues were discovered when using IMAP with a Microsoft Exchange mail server: https://www.mantisbt.org/wiki/doku.php/ ... il_servers
One of them was fixed in 0.9.3 (https://github.com/mantisbt-plugins/Ema ... 0ce17dc3f6). So if your using Microsoft Exchange i suggest upgrading to 0.9.3

If your using another mail server, please let us know which one so that we can check for compatibility issues and fix them if possible

I see you've enabled imap_createfolderstructure. Please check this reply so that you fully understand what it does
viewtopic.php?p=60863#p60863

Re: Email reporting

Posted: 10 Jan 2017, 16:20
by alex.culley
Can you tell me how to set up the job to fetch the emails?
I have looked through all the documentation I could find and now I am really lost.

Any videos I can watch or step by step tutorials?

Re: Email reporting

Posted: 10 Jan 2017, 22:29
by SL-Gundam
It depends on your OS

I'll quote the install.txt of EmailReporting concerning the scheduled job
INSTALL.txt wrote:Linux or similar OS using Cron jobs:
Via webserver (see settings because this is disabled by default, see plugin config page in mantis)
*/5 * * * * lynx --dump http://mantis.homepage.com/plugin.php?p ... eport_mail
or via command line interface
*/5 * * * * /usr/local/bin/php /path/to/mantis/plugins/EmailReporting/scripts/bug_report_mail.php
This line fetches bug reports via POP3 or IMAP every 5 minutes.

Windows or similar OS:
Via webserver (see settings because this is disabled by default, see plugin config page in mantis)
No known method for scheduling this via webserver
or via command line interface
c:\php\php.exe c:\path\to\mantis\plugins\EmailReporting\scripts\bug_report_mail.php
So what OS are we talking about?
Do you know how to set up a scheduled job on said OS?

Re: Email reporting

Posted: 11 Jan 2017, 15:34
by alex.culley
Windows 7 is the OS
and by scheduling job do you mean "task scheduler"?

Re: Email reporting

Posted: 11 Jan 2017, 19:13
by SL-Gundam
Task scheduler is one possible option yes

Re: Email reporting

Posted: 11 Jan 2017, 21:02
by alex.culley
Excellent, I did schedule it to run through task scheduler but in never completed.

then every task after that failed due tot he previous one still trying to run.

Is there something with the file I need to do?

Re: Email reporting

Posted: 12 Jan 2017, 00:51
by SL-Gundam
With windows you can make sure anything with the PHP extension will be opened with PHP.exe

That way Task scheduler can run \scripts\bug_report_mail.php directly.
Otherwise you need to make sure that task scheduler runs the php.exe program and give \scripts\bug_report_mail.php as a parameter

Re: Email reporting

Posted: 12 Jan 2017, 19:45
by alex.culley
What program should I use to run the script?

Re: Email reporting

Posted: 12 Jan 2017, 22:35
by SL-Gundam
PHP.exe
Make sure the php.ini used by the webserver is the same one used when you call php.exe directly

Re: Email reporting

Posted: 13 Jan 2017, 15:23
by alex.culley
Ok I think i understand now.
I was able to get it to run and complete once but can not duplicate.