Report a bug via email

General discussion of Mantis.

Moderators: Developer, Contributor

DaVinci
Posts: 95
Joined: 13 Apr 2007, 07:39

Report a bug via email

Post by DaVinci »

im trying to impliment the "Reort bug by email" into Mantis.
I have download and installed the patch but i still dont know how it is going to work.

I want all the e-mails that are sendt to hm@abc.com to open a ticket in mantis (isnt this what the functinality is suppose to do?)

after installing the update i got the columns shown below under <b>Manage Project</b> for each induvidual project

[img]http://aftab.watapage.com/mantis_mail_report.JPG[/img]

can someone please help me figure out what do i ned to fill inn the columns to make the reporting via email work?
jboulay
Posts: 14
Joined: 16 Jul 2007, 15:49

Post by jboulay »

Hi DaVinci,

We will continue our topic here...

>I want all the e-mails that are sendt to hm@abc.com to open a ticket in mantis (isnt this what the functinality is suppose to do?)

You're right. This is the right extension.

Has I wrote in the mantis bug report, you have to fill the fields in the project administration page, with the following informations:

-pop3 host : is the name of your mail server
-pop3 user : is the account you will use to connect to your mail server. This is the account that will receive the mail you want to report !!
in your case, it should be something like "hm".
-pop3 password : is the password of this user.

In your last message on the forum, it seems that your pop3 connection parameters are wrong. Did you try different solutions?
DaVinci
Posts: 95
Joined: 13 Apr 2007, 07:39

Post by DaVinci »

still not working..

my settings are (which i am doing for a project named Hyperlinks):
pop3 host: mail.abc.com
pop3 user: hm (i have also tried hm@abc.com)
pop3 password: 123456 (should this me the account password for hm@abc.com or the passqors dor mail.abc.com)

then i click on the button that says: Set Mail Account Data
and then
Activate Mail Account per Category

after doing so...
i send a mail to hm@abc.com
this should update the project Hyperlink and send me a mail..
but even after 10 minutes i didnt receive any...
i tink i am doing something wrong..
what am i doing wrong?
jboulay
Posts: 14
Joined: 16 Jul 2007, 15:49

Post by jboulay »

DaVinci wrote:still not working..
...
Activate Mail Account per Category
I think your configuration should be ok. You have to fill the account without the full email adress (hm only and not hm@abc.com)
DaVinci wrote: after doing so...
i send a mail to hm@abc.com
this should update the project Hyperlink and send me a mail..
but even after 10 minutes i didnt receive any...
i tink i am doing something wrong..
what am i doing wrong?
In order to activate the recovery of the email you sent, you must go to the following adress : http://your_mantis_server/bug_report_mail.php
This page contains the php code that recover the email and create the bug. If no error happen during the execution, your configuration is ok.
If the bug is not created, there should be an issue with the configuration file

If you want to execute this page automatically, you can use a batch file.

Here is an extract of my configuration file (config_inc.php)

Code: Select all

######################
	# Mail Reporting
	######################

	# --- mail reporting settings -----
	# This tells Mantis to report all the Mail with only one account
	$g_mail_use_reporter	= ON;

	# The account's name for mail reporting
	# Also used for fallback if a user is not found in database
	# Positionner le user correspondant  Laurent Lafeuille
	$g_mail_reporter	= 'mail';

	# Signup new users automatically (possible security risk!)
	# Default is OFF, ignored if mail_use_reporter is ON
	$g_mail_auto_signup	= OFF;

	# How many mails should be fetched at the same time
	# If big mails with attachments should be received, specify only one
	$g_mail_fetch_max	= 1;

	# Write complete mail into the "Additional Information"
	$g_mail_additional	= ON;

	# Write sender of the message into the bug report
	$g_mail_save_from	= OFF;

	# Parse MIME mails (may require a lot of memory)
	$g_mail_parse_mime	= ON;

	# Parse HTML mails
	$g_mail_parse_html	= ON;

	# HTML Parser Command
	# It should print the formatted text to STDOUT
	# For example: "/usr/bin/w3m -T text/html -dump"
	$g_mail_html_parser	= ON;

	# directory for saving temporary mail content
	$g_mail_tmp_directory	= 'C:/TEMP';
	
	# Delete incoming mail from POP3 server
	$g_mail_delete		= ON;

	# Signup new users automatically (possible security risk!)
	# Default is OFF, ignored if mail_use_reporter is ON
	$g_mail_debug		= OFF;
	
	# Save mail contents to this directory if debug mode is ON
	$g_mail_directory	= 'C:/TEMP/mantis';
	
	# The auth method used for POP3
	# Valid methods are: 'DIGEST-MD5','CRAM-MD5','LOGIN','PLAIN','APOP','USER'
	$g_mail_auth_method	= 'USER';
	
	# Looks for priority header field
	$g_mail_use_bug_priority = ON;
	
	# Default priority for mail reported bugs
	$g_mail_bug_priority_default = NORMAL;
DaVinci
Posts: 95
Joined: 13 Apr 2007, 07:39

Post by DaVinci »

im pasting mine config_inc.php below..
and i cant see the code that u have psoted:
<?php
# Mantis - a php based bugtracking system
# Copyright (C) 2000 - 2002 Kenzaburo Ito - kenito@300baud.org
# Copyright (C) 2002 - 2005 Mantis Team - mantisbt-dev@lists.sourceforge.net
# This program is distributed under the terms and conditions of the GPL
# See the README and LICENSE files for details

# --------------------------------------------------------
# $Id: config_inc.php.sample,v 1.16.14.1 2006/10/29 00:34:44 vboctor Exp $
# --------------------------------------------------------

# This sample file contains the essential files that you MUST
# configure to your specific settings. You may override settings
# from config_defaults_inc.php by assigning new values in this file

# Rename this file to config_inc.php after configuration.

###########################################################################
# CONFIGURATION VARIABLES
###########################################################################

# In general the value OFF means the feature is disabled and ON means the
# feature is enabled. Any other cases will have an explanation.

# Look in http://manual.mantisbugtracker.com/ or config_defaults_inc.php for more
# detailed comments.

# --- database variables ---------


$g_hostname = 'db.abc.com';
$g_db_type = 'mysql';
$g_database_name = 'abc';
$g_db_username = 'abc';
$g_db_password = 'abc123';




# --- email variables -------------
$g_administrator_email = 'hm@abc.com';
$g_webmaster_email = 'it@abc.com';

# the "From: " field in emails
$g_from_email = 'noreply@abc.com';

# the return address for bounced mail
$g_return_path_email = 'it@abc.com, hm@.abc.com';

# --- file upload settings --------
# This is the master setting to disable *all* file uploading functionality
#
# The default value is ON but you must make sure file uploading is enabled
# in PHP as well. You may need to add "file_uploads = TRUE" to your php.ini.
$g_allow_file_upload = ON;

# --- file signup settings --------
# allow users to signup for their own accounts.
# Mail settings must be correctly configured in order for this to work
$g_allow_signup = OFF;

## CUSTOM GLOBAL VARIABLES TO UNBRAND MANTIS
## $g_application_homepage = 'http://your.domain.com/'; [^] //e.g. http://bugs.mantisbt.org [^]
$g_application_title = 'ABC HelpDesk'; //e.g. Mantis Bug Tracker
##$g_application_logo = 'images/your_logo.jpg'; //This is the header logo, rename and point to the correct location
$g_company_name = 'ABC'; //e.g. Mantis
## $g_company_homepage = 'http://www.domain.com/'; [^] //e.g. http://www.mantisbt.org [^]
## $g_powered_by_logo = 'images/powered_by.gif'; //This is the footer logo, rename and point to the correct location
?>
and my bug_report_mail.php is:
<?php
# Mantis - a php based bugtracking system
# Copyright (C) 2002 - 2004 Mantis Team - mantisbt-dev@lists.sourceforge.net
# Copyright (C) 2004 Gerrit Beine - gerrit.beine@pitcom.de
# This program is distributed under the terms and conditions of the GPL
# See the README and LICENSE files for details

# --------------------------------------------------------
# $Id$
# --------------------------------------------------------

# This page receives an E-Mail via POP3 and generates an Report
header("Content-type: text/plain");
require_once( 'core.php' );

$t_core_path = config_get( 'core_path' );

require_once( $t_core_path . 'string_api.php' );
require_once( $t_core_path . 'bug_api.php' );
require_once( $t_core_path . 'mail_api.php' );

$t_mailaccounts = mail_get_accounts();

foreach ($t_mailaccounts as $t_mailaccount) {
if ( config_get( 'mail_debug' ) ) {
var_dump($t_mailaccount);
}
mail_process_all_mails( $t_mailaccount );
}
?>
DaVinci
Posts: 95
Joined: 13 Apr 2007, 07:39

Post by DaVinci »

by the way i am getting this message noe:
error:abc [pear_error: message="-ERR authorization failed" code=-1 mode=return level=notice prefix="" info=""]
where abc is both database name and username to pop3 server and the login name to dbserver
DaVinci
Posts: 95
Joined: 13 Apr 2007, 07:39

Post by DaVinci »

okey..
so i managed to get the message sednt to hm@abc.com in my inbox which is ap@abc.com
but the mail that was sendt to hm@abc.com didnt open a ticket in project Hyperlinks
can you please explain me why and how do i activate it...
and if i want eeryone who sends a messge to hm@abc.com to receive a confirmation message that the ticket has been received or been open..
jboulay
Posts: 14
Joined: 16 Jul 2007, 15:49

Post by jboulay »

DaVinci wrote:okey..
Do you mean that you manage to execute the bug_report_mail.php page without any error ??
can you please explain me why and how do i activate it...
Yes !!! Of course !! I've tried to explain how to debug your configuration for 2 days...

Let me explain you the method you have to follow in order to run the mail bug reporter in mantis:

- First, you must verify that your POP3 configuration is ok !!
By executing bug_report_mail.php, you can verify your parameters
If you don't have any error message, your POP3 configuration parameters are OK !! (So don't modify it anymore)

- Second, you have to set some parameters in the config_inc.php file

2 files are required to define parameters in mantis:
  • -config_defaults_inc.php : contains the list of all default mantis parameters. You will never modify those parameters.
    -config_inc.php : contains your own customisation parameters.
in the config_defaults_inc.php, you will find the parameters I gave you in the post before.
Just copy the section "Mail Reporting" to the config_inc.php file. Modify the parameters as indicated before.
Then resend another email and go to page bug_report_mail.php. Please let me know if you get an error...
When it's done, go to mantis and check if your bug report is created !!
DaVinci
Posts: 95
Joined: 13 Apr 2007, 07:39

Post by DaVinci »

Do you mean that you manage to execute the bug_report_mail.php page without any error ??
no, what i was trying to say was that: okey, i understand
but i am still getting the mentioned erroreventhough hm is an administrator and have full rigts to db and other stuff
Yes !!! Of course !! I've tried to explain how to debug your configuration for 2 days...
yes u have been very helpful..thankyou for that

- First, you must verify that your POP3 configuration is ok !!
those are okey since i got them in mail from the service provider and there it says:
pop3 host: mail.abc.com
pop3 user: hm@abc.com
pop3 password: 123456

By executing bug_report_mail.php, you can verify your parameters
If you don't have any error message, your POP3 configuration parameters are OK !! (So don't modify it anymore)

i get the error message :(
is there anyplace else i have to change the parametes other than i config_inc.php?


- Second, you have to set some parameters in the config_inc.php file

i have and there here they are :

$g_hostname = 'db.abc.com';
$g_db_type = 'mysql';
$g_database_name = 'abc';
$g_db_username = 'hm';
$g_db_password = 'abc123456';


-config_defaults_inc.php : contains the list of all default mantis parameters. You will never modify those parameters.

i have not modified..even if i had, i have uploded the original file

in the config_defaults_inc.php, you will find the parameters I gave you in the post before.
Just copy the section "Mail Reporting" to the config_inc.php file. Modify the parameters as indicated before.
Then resend another email and go to page bug_report_mail.php. Please let me know if you get an error...
When it's done, go to mantis and check if your bug report is created !!

done it and i still get an error
jboulay
Posts: 14
Joined: 16 Jul 2007, 15:49

Post by jboulay »

those are okey since i got them in mail from the service provider and there it says:
pop3 host: mail.abc.com
pop3 user: hm@abc.com
pop3 password: 123456

For sure your service provider give you the good connexion parameters !!!

I just wanted to know if you set it correctly in the mantis administration page !!!
By executing bug_report_mail.php, you can verify your parameters
If you don't have any error message, your POP3 configuration parameters are OK !! (So don't modify it anymore)


If you always got the error by executing bug_report_mail.php, it means that the parameters in the administration page are badly configured !!

Now, can you try different combination in the administration page

pop3 host: mail.abc.com
pop3 user: hm@abc.com
pop3 password: 123456

or

pop3 host: mail.abc.com
pop3 user: hm
pop3 password: 123456

or

pop3 host: ip adress
pop3 user: hm
pop3 password: 123456

Each time you change the parameters, test it with "bug_report_mail.php"

give me the result for each execution in this page
DaVinci
Posts: 95
Joined: 13 Apr 2007, 07:39

Post by DaVinci »

by administrator page, do u mean the page with the following section

Image [/img]
jboulay
Posts: 14
Joined: 16 Jul 2007, 15:49

Post by jboulay »

Yes, I mean in the mail account setting.
jboulay
Posts: 14
Joined: 16 Jul 2007, 15:49

Post by jboulay »

There should be an issue with the following parameter in the config_inc.php file. It indicates the method used for connecting the POP3 server

Code: Select all

# The auth method used for POP3
   # Valid methods are: 'DIGEST-MD5','CRAM-MD5','LOGIN','PLAIN','APOP','USER'
   $g_mail_auth_method   = 'USER'; 
Try to leave the parameter "$g_mail_auth_method" empty. When this parameter is empty, it might use the best method to connect to the POP3 server.

Let me know what is the result when you execute the "bug_report_mail.php" page with this configuration.
DaVinci
Posts: 95
Joined: 13 Apr 2007, 07:39

Post by DaVinci »

i get the follwoing error anyhow:

[quote]
error:wno110999 [pear_error: message="-ERR authorization failed" code=-1 mode=return level=notice prefix="" info=""]
[/quote]

where
wno110999 is:
dbusername
dbname

HELP!!!!!!!!!!!
jboulay
Posts: 14
Joined: 16 Jul 2007, 15:49

Post by jboulay »

Ok DaVinci,

Please, try without activating "Mail Account per Category"
Don't use this option
Use only "Set Mail Account Data"

I've looked for the PEAR error on the PEAR project website, but can't find any error corresponding. I've searched in the pear php code and nothing ...

It might be an error generated by your POP server but I can't understand why :?

Did you try the different method to connect to the POP3 server ?

Code: Select all

# The auth method used for POP3
   # Valid methods are: 'DIGEST-MD5','CRAM-MD5','LOGIN','PLAIN','APOP','USER'
   $g_mail_auth_method   = 'USER';
Try each method please.

Other questions:
Could you explain your architecture ?
Do you host your own mantis server or is it an external hosting ?

If it's an internal hosting (I mean for the mantis server), did you try to connect to your reporter email adress with a pop3 client ?
Post Reply