diff -Nur mantis-1.0.0rc3.orig/admin/schema.php mantis-1.0.0rc3/admin/schema.php
--- mantis-1.0.0rc3.orig/admin/schema.php	Wed Aug  3 16:20:34 2005
+++ mantis-1.0.0rc3/admin/schema.php	Mon Oct 31 11:18:41 2005
@@ -192,7 +192,10 @@
 $upgrade[] = Array('CreateTableSQL',Array(config_get('mantis_project_category_table'),"
   project_id 		 I  UNSIGNED NOTNULL PRIMARY DEFAULT '0',
   category 		C(64) NOTNULL PRIMARY DEFAULT \" '' \",
-  user_id 		 I  UNSIGNED NOTNULL DEFAULT '0'
+  user_id 		 I  UNSIGNED NOTNULL DEFAULT '0',
+  pop3_host		C(250) NULL,
+  pop3_user		C(250) NULL,
+  pop3_pass		C(250) NULL
 ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS')));
 
 $upgrade[] = Array('CreateTableSQL',Array(config_get('mantis_project_file_table'),"
@@ -222,7 +225,11 @@
   view_state 		I2 NOTNULL DEFAULT '10',
   access_min 		I2 NOTNULL DEFAULT '10',
   file_path 		C(250) NOTNULL DEFAULT \" '' \",
-  description 		XS NOTNULL
+  description 		XS NOTNULL,
+  pop3_host		C(250) NULL,
+  pop3_user		C(250) NULL,
+  pop3_pass		C(250) NULL,
+  pop3_categories	L NOTNULL DEFAULT '0'
 ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS')));
 $upgrade[] = Array('CreateIndexSQL',Array('idx_project_id',config_get('mantis_project_table'),'id'));
 $upgrade[] = Array('CreateIndexSQL',Array('idx_project_name',config_get('mantis_project_table'),'name',Array('UNIQUE')));
@@ -340,5 +347,9 @@
 $upgrade[] = Array('InsertData', Array( config_get('mantis_user_table'), 
     "(username, realname, email, password, date_created, last_visit, enabled, protected, access_level, login_count, lost_password_request_count, failed_login_count, cookie_string) VALUES 
         ('administrator', '', 'root@localhost', '63a9f0ea7bb98050796b649e85481845', " . db_now() . ", " . db_now() . ", 1, 0, 90, 3, 0, 0, '" . 
+             md5( mt_rand( 0, mt_getrandmax() ) + mt_rand( 0, mt_getrandmax() ) ) . md5( time() ) . "')" ) );
+$upgrade[] = Array('InsertData', Array( config_get('mantis_user_table'), 
+    "(username, realname, email, password, date_created, last_visit, enabled, protected, access_level, login_count, lost_password_request_count, failed_login_count, cookie_string) VALUES 
+        ('mail', 'Mail Reporter', 'root@nomail@localhost', 'a268462c3c679a9027658c5aa723f97c', " . db_now() . ", " . db_now() . ", 1, 0, 25, 0, 0, 0, '" . 
              md5( mt_rand( 0, mt_getrandmax() ) + mt_rand( 0, mt_getrandmax() ) ) . md5( time() ) . "')" ) );
 ?>
diff -Nur mantis-1.0.0rc3.orig/bug_report_mail.php mantis-1.0.0rc3/bug_report_mail.php
--- mantis-1.0.0rc3.orig/bug_report_mail.php	Thu Jan  1 01:00:00 1970
+++ mantis-1.0.0rc3/bug_report_mail.php	Mon Oct 31 11:18:41 2005
@@ -0,0 +1,40 @@
+<?php
+error_reporting(E_ALL);
+	# 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' ) ) {
+			print_r($t_mailaccounts);
+		}
+		$t_mails = mail_get_all_mails($t_mailaccount);
+		foreach ($t_mails as $t_mail)
+		{
+			if ( config_get( 'mail_debug' ) ) {
+				print_r($t_mail);
+			}
+			$GLOBALS['g_cache_current_user_id'] = mail_get_user( $t_mail['From'] );
+			mail_add_bug($t_mail, $t_mailaccount);
+		}
+	}
+?>
+
diff -Nur mantis-1.0.0rc3.orig/config_defaults_inc.php mantis-1.0.0rc3/config_defaults_inc.php
--- mantis-1.0.0rc3.orig/config_defaults_inc.php	Sat Oct 29 01:36:32 2005
+++ mantis-1.0.0rc3/config_defaults_inc.php	Mon Oct 31 11:18:41 2005
@@ -1617,4 +1617,37 @@
 	#   )
 	# );
 	$g_custom_group_actions = array();
+
+	######################
+	# 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
+	$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;
+
+	# Write complete mail into the "Additional Information"
+	$g_mail_additional	= OFF;
+
+	# 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	= 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;
+
+	# Signup new users automatically (possible security risk!)
+	# Default is OFF, ignored if mail_use_reporter is ON
+	$g_mail_debug		= OFF;
 ?>
diff -Nur mantis-1.0.0rc3.orig/core/category_api.php mantis-1.0.0rc3/core/category_api.php
--- mantis-1.0.0rc3.orig/core/category_api.php	Sat Feb 12 21:01:10 2005
+++ mantis-1.0.0rc3/core/category_api.php	Mon Oct 31 11:18:41 2005
@@ -186,7 +186,7 @@
 
 		$t_project_category_table = config_get( 'mantis_project_category_table' );
 
-		$query = "SELECT category, user_id
+		$query = "SELECT category, user_id, pop3_host, pop3_user, pop3_pass
 				FROM $t_project_category_table
 				WHERE project_id='$c_project_id' AND
 					category='$c_category'";
@@ -206,7 +206,7 @@
 
 		$t_project_category_table = config_get( 'mantis_project_category_table' );
 
-		$query = "SELECT category, user_id
+		$query = "SELECT category, user_id, pop3_host, pop3_user, pop3_pass
 				FROM $t_project_category_table
 				WHERE project_id='$c_project_id'
 				ORDER BY category";
diff -Nur mantis-1.0.0rc3.orig/core/mail_api.php mantis-1.0.0rc3/core/mail_api.php
--- mantis-1.0.0rc3.orig/core/mail_api.php	Thu Jan  1 01:00:00 1970
+++ mantis-1.0.0rc3/core/mail_api.php	Mon Oct 31 11:18:41 2005
@@ -0,0 +1,443 @@
+<?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$
+	# --------------------------------------------------------
+
+	$t_core_dir = dirname( __FILE__ ).DIRECTORY_SEPARATOR;
+
+	require_once( $t_core_dir . 'bug_api.php' );
+	require_once( $t_core_dir . 'bugnote_api.php' );
+	require_once( $t_core_dir . 'user_api.php' );
+	require_once( $t_core_dir . 'project_api.php' );
+	require_once( $t_core_dir . 'file_api.php' );
+
+	# This page receives an E-Mail via POP3 and generates an Report
+
+	require_once( 'Net/POP3.php' );
+	require_once( 'Mail/mimeDecode.php' );
+
+	# --------------------
+	# Return mail account data for the specified project
+	function mail_get_account_data( $p_project_id ) {
+		$v_project_id = db_prepare_int( $p_project_id );
+
+		$t_project_table = config_get( 'mantis_project_table' );
+
+		$query = "SELECT pop3_host, pop3_user, pop3_pass, pop3_categories
+				FROM $t_project_table 
+				WHERE id='$v_project_id'";
+
+		$result = db_query( $query );
+
+		return db_fetch_array( $result );
+	}
+
+	# --------------------
+	# Update the mail account data for a project
+	function mail_update( $p_project_id, $p_pop3_host, $p_pop3_user, $p_pop3_pass ) {
+		$v_project_id	= db_prepare_int( $p_project_id );
+		$v_pop3_host	= db_prepare_string( $p_pop3_host );
+		$v_pop3_user	= db_prepare_string( $p_pop3_user );
+		$v_pop3_pass	= db_prepare_string( $p_pop3_pass );
+
+		$t_project_table = config_get( 'mantis_project_table' );
+
+		$query = "UPDATE $t_project_table 
+			 	SET pop3_host='$v_pop3_host',
+				pop3_user='$v_pop3_user',
+				pop3_pass='$v_pop3_pass'
+				WHERE id='$v_project_id'";
+
+		db_query( $query );
+
+		return true;
+	}
+
+	# --------------------
+	# Removes the mail account data from a project
+	function mail_delete( $p_project_id ) {
+		$v_project_id	= db_prepare_int( $p_project_id );
+
+		$t_project_table = config_get( 'mantis_project_table' );
+
+		$query = "UPDATE $t_project_table 
+				SET pop3_host=NULL,
+				pop3_user=NULL,
+				pop3_pass=NULL
+				WHERE id='$v_project_id'";
+
+		db_query( $query );
+
+		return true;
+	}
+
+	# --------------------
+	# Activate the 'Mail per Category' feature for a project
+	function mail_categories( $p_project_id, $p_active ) {
+		$v_project_id	= db_prepare_int( $p_project_id );
+
+		if ($p_active == 'On') {
+			$v_active = 1;
+		} else {
+			$v_active = 0;
+		}
+
+		$t_project_table = config_get( 'mantis_project_table' );
+
+		$query = "UPDATE $t_project_table 
+				SET pop3_categories='$v_active'
+				WHERE id='$v_project_id'";
+
+		db_query( $query );
+
+		return true;
+	}
+
+	# --------------------
+	# Return mail account data for the specified project and category
+	function mail_category_get_account_data( $p_project_id, $p_category ) {
+		$v_project_id	= db_prepare_int( $p_project_id );
+		$v_category	= db_prepare_string( $p_category );
+
+		$t_project_category_table = config_get( 'mantis_project_category_table' );
+
+		$query = "SELECT pop3_host, pop3_user, pop3_pass
+				FROM $t_project_category_table 
+				WHERE project_id='$v_project_id' AND category='$v_category'";
+
+		$result = db_query( $query );
+
+		return db_fetch_array( $result );
+	}
+
+	# --------------------
+	# Update the mail account data for a category
+	function mail_category_update( $p_project_id, $p_category, $p_pop3_host, $p_pop3_user, $p_pop3_pass ) {
+		$v_project_id	= db_prepare_int( $p_project_id );
+		$v_category	= db_prepare_string( $p_category );
+		$v_pop3_host	= db_prepare_string( $p_pop3_host );
+		$v_pop3_user	= db_prepare_string( $p_pop3_user );
+		$v_pop3_pass	= db_prepare_string( $p_pop3_pass );
+
+		$t_project_category_table = config_get( 'mantis_project_category_table' );
+
+		$query = "UPDATE $t_project_category_table 
+			 	SET pop3_host='$v_pop3_host',
+				pop3_user='$v_pop3_user',
+				pop3_pass='$v_pop3_pass'
+				WHERE project_id='$v_project_id' AND category='$v_category'";
+
+		db_query( $query );
+
+		return true;
+	}
+
+	# --------------------
+	# Removes the mail account data for a category
+	function mail_category_delete( $p_project_id, $p_category ) {
+		$v_project_id	= db_prepare_int( $p_project_id );
+		$v_category	= db_prepare_string( $p_category );
+		
+		$t_project_table = config_get( 'mantis_project_table' );
+
+		$t_project_category_table = config_get( 'mantis_project_category_table' );
+
+		$query = "UPDATE $t_project_category_table 
+			 	SET pop3_host=NULL,
+				pop3_user=NULL,
+				pop3_pass=NULL
+				WHERE project_id='$v_project_id' AND category='$v_category'";
+
+		db_query( $query );
+
+		return true;
+	}
+
+	# --------------------
+	# return all mailaccounts
+	#  return an empty array if there are no
+	function mail_get_accounts() {
+		$v_accounts = array();
+		$t_projects = mail_project_get_all_rows();
+
+		foreach ($t_projects as $t_project) {
+			if ($t_project['pop3_categories']) { echo 1;
+				$v_categories = mail_categories_get_all_rows( $t_project['id'] );
+				$v_accounts = array_merge($v_accounts, $v_categories);
+			} else {
+				array_push($v_accounts, $t_project);
+			}
+		}
+
+		return $v_accounts;
+	}
+
+	# --------------------
+	# return all projects with valid data for mail access
+	#  return an empty array if there are no such projects
+	function mail_project_get_all_rows() {
+		$v_projects = array();
+		$t_projects = project_get_all_rows();
+
+		foreach ($t_projects as $t_project) {
+			if ($t_project['pop3_host'] || $t_project['pop3_categories']) {
+				array_push($v_projects, $t_project);
+			}
+		}
+
+		return $v_projects;
+	}
+
+	# --------------------
+	# return all categories from a project with valid data for mail access
+	#  return an empty array if there are no such categories
+	function mail_categories_get_all_rows( $p_project_id ) {
+		$v_categories = array();
+		$t_categories = category_get_all_rows( $p_project_id );
+
+		foreach ($t_categories as $t_category) {
+			if ($t_category['pop3_host']) {
+				$t_category['id'] = $p_project_id;
+				array_push($v_categories, $t_category);
+			}
+		}
+
+		return $v_categories;
+	}
+
+	# --------------------
+	# return all mails for an account
+	#  return an empty array if there are no new mails
+	function mail_get_all_mails( $p_account ) {
+		$t_mail_parse_mime	= config_get( 'mail_parse_mime' );
+		$t_mail_fetch_max	= config_get( 'mail_fetch_max' );
+		$t_mail_additional	= config_get( 'mail_additional' );
+		
+		$v_mails = array();
+		$t_pop3 = &new Net_POP3();
+		$t_pop3_host = $p_account['pop3_host'];
+		$t_pop3_user = $p_account['pop3_user'];
+		$t_pop3_password = $p_account['pop3_pass'];
+		$t_pop3->connect($t_pop3_host, 110);
+		$t_pop3->login($t_pop3_user, $t_pop3_password);
+
+		if ( 0 == $t_pop3->numMsg() ) {
+			return $v_mails;
+		}
+		for ($i = 1; $i <= $t_mail_fetch_max; $i++) {
+			$t_headers = $t_pop3->getParsedHeaders($i);
+			$t_msg = $t_pop3->getMsg($i);
+			if (true == $t_mail_parse_mime &&
+				true == isset( $t_headers['MIME-Version'] ) &&
+				'multipart' == strtolower ( substr( $t_headers['Content-Type'], 0, 9 ) ) ) {
+				$t_mail = mail_parse_content( $t_msg );
+			} else {
+				$t_mail = $t_headers;
+				$t_mail['X-Mantis-Body'] = $t_pop3->getBody($i);
+			}
+
+			if (true == $t_mail_additional) {
+				$t_mail['X-Mantis-Complete'] = $t_msg;
+			}
+
+			array_push($v_mails, $t_mail);
+			#$t_pop3->deleteMsg($i);
+		}
+
+		$t_pop3->disconnect();
+		return $v_mails;
+	}
+
+	# --------------------
+	# return the mail parsed for Mantis
+	function mail_parse_content ( $p_mail ) {
+		$v_mail = array ();
+		$t_decoder = new Mail_mimeDecode($p_mail);
+		$t_params['include_bodies'] = true;
+		$t_params['decode_bodies']  = true;
+		$t_params['decode_headers'] = true;
+		$t_structure = $t_decoder->decode($t_params);
+		$v_mail['To'] = $t_structure->headers['to'];
+		$v_mail['From'] = $t_structure->headers['from'];
+		$v_mail['Subject'] = $t_structure->headers['subject'];
+		if (is_array($t_structure->parts)) {
+			$t_parts = mail_parse_parts( $t_structure->parts );
+		} else {
+                	$t_parts = array ( mail_parse_part( $t_structure ) );
+		}
+		if (strtolower($t_parts[0]['Content-Type']) == 'text/plain' ||
+			strtolower($t_parts[0]['Content-Type']) == 'text/html' ) {
+			$t_body['Body'] = $t_parts[0]['Body'];
+		} else {
+			$t_body['Body'] = "It seems, there is no text... :-o";
+		}
+		$v_mail['X-Mantis-Parts'] = $t_parts;
+		$v_mail['X-Mantis-Body'] = $t_body['Body'];
+
+		return $v_mail;
+	}
+
+	# --------------------
+	# return the parsed parts from the mail
+	function mail_parse_parts ( $p_parts ) {
+		$v_parts = array ();
+		foreach ( $p_parts as $t_part ) {
+			array_push($v_parts, mail_parse_part( $t_part ));
+		}
+
+		return $v_parts;
+	}
+
+	# --------------------
+	# return one parsed part
+	function mail_parse_part ( $p_part ) {
+		$v_part = array ();
+		$v_part['Content-Type'] = $p_part->ctype_primary."/".$p_part->ctype_secondary;
+		$v_part['Name'] = $p_part->ctype_parameters['name'];
+		$v_part['Body'] = $p_part->body;
+
+		return $v_part;
+	}
+
+	# --------------------
+	# return the mailadress from the mail's 'From'
+	function mail_parse_address ( $p_mailaddress ) {
+		if (preg_match("/<(.*?)>/", $p_mailaddress, $matches)) {
+			$v_mailaddress = $matches[1];
+		}
+
+		return $v_mailaddress;
+	}
+
+	# --------------------
+	# return the a valid username from an email address
+	function mail_user_name_from_address ( $p_mailaddress ) {
+		return preg_replace("/[@\.-]/", '_', $p_mailaddress);
+	}
+
+	# --------------------
+	# return true if there is a valid mantis bug referernce in subject
+	function mail_is_a_bugnote ( $p_mail_subject ) {
+		return preg_match("/\[([A-Za-z0-9-_\. ]*\s[0-9]{7})\]/", $p_mail_subject);
+	}
+
+	# --------------------
+	# return the bug's id from the subject
+	function mail_get_bug_id_from_subject ( $p_mail_subject ) {
+		preg_match("/\[([A-Za-z0-9-_\. ]*\s([0-9]{7}?))\]/", $p_mail_subject, $v_matches);
+
+		return $v_matches[2];
+	}
+
+	# --------------------
+	# return the user id for the mail reporting user
+	function mail_get_user ($p_mailaddress) {
+		$t_mail_use_reporter	= config_get( 'mail_use_reporter' );
+		$t_mail_auto_signup	= config_get( 'mail_auto_signup' );
+		$t_mail_reporter	= config_get( 'mail_reporter' );
+		
+		$v_mailaddress = mail_parse_address( $p_mailaddress );
+
+		if ( $t_mail_use_reporter ) {
+			// Always report as mail_reporter
+			$t_reporter_id = user_get_id_by_name( $t_mail_reporter );
+		} else {
+			// Try to get the reporting users id
+			$t_reporter_id = user_get_id_by_mail ( $v_mailaddress );
+			if ( ! $t_reporter_id && $t_mail_auto_signup ) {
+				// So, we've to sign up a new user...
+				$t_user_name = mail_user_name_from_address ( $v_mailaddress );
+				user_signup($t_user_name, $v_mailaddress);
+				$t_reporter_id = user_get_id_by_name($t_user_name);
+			} elseif ( ! $t_reporter_id ) {
+				// Fall back to the default mail_reporter
+				$t_reporter_id = user_get_id_by_name( $t_mail_reporter );
+			}
+		}
+
+		// dirty: Set the identified user's id
+		// required if bug_report_mail is run via command line
+		$GLOBAL['g_cache_current_user_id'] = $t_reporter_id;
+
+		return $t_reporter_id;
+	}
+
+	# --------------------
+	# Very dirty: Adds a file to a bug.
+	function mail_add_file( $p_bug_id, $p_part ) {
+		$GLOBALS['_mail_file_'] = $p_part['Name'];
+		if ( 0 < strlen($p_part['Name']) ) {
+			$t_file_name = '/tmp/'.$p_part['Name'];
+			file_put_contents($t_file_name, $p_part['Body']);
+			file_add($p_bug_id, $t_file_name,  $p_part['Name'], $p_part['Content-Type'], 'bug');
+			unlink($t_file_name);
+		}
+	}
+
+	# --------------------
+	# Adds a bug which is reported via email
+	# Taken from bug_report.php and 
+	function mail_add_bug ( $p_mail, $p_account ) {
+		$t_mail_save_from	= config_get( 'mail_save_from' );
+
+		$t_bug_data = new BugData;
+		$t_bug_data->build			= gpc_get_string( 'build', '' );
+		$t_bug_data->platform			= gpc_get_string( 'platform', '' );
+		$t_bug_data->os				= gpc_get_string( 'os', '' );
+		$t_bug_data->os_build			= gpc_get_string( 'os_build', '' );
+		$t_bug_data->version			= gpc_get_string( 'product_version', '' );
+		$t_bug_data->profile_id			= gpc_get_int( 'profile_id', 0 );
+		$t_bug_data->handler_id			= gpc_get_int( 'handler_id', 0 );
+		$t_bug_data->view_state			= gpc_get_int( 'view_state', config_get( 'default_bug_view_status' ) );
+
+		if ( $p_account['category']) {
+			$t_bug_data->category			= gpc_get_string( 'category', $p_account['category'] );
+		} else {
+			$t_bug_data->category			= gpc_get_string( 'category', '' );
+		}
+		$t_bug_data->reproducibility		= 10;
+		$t_bug_data->severity			= 50;
+		$t_bug_data->priority			= gpc_get_int( 'priority', NORMAL );
+		$t_bug_data->summary			= $p_mail['Subject'];
+		if ( $t_mail_save_from ) {
+			$t_bug_data->description	= "Report from: ".$p_mail['From']."\n\n".$p_mail['X-Mantis-Body'];
+		}
+		else {
+			$t_bug_data->description	= $p_mail['X-Mantis-Body'];
+		}
+		$t_bug_data->steps_to_reproduce		= gpc_get_string( 'steps_to_reproduce', '' );
+		$t_bug_data->additional_information	= $p_mail['X-Mantis-Complete'];
+
+		$t_bug_data->project_id			= $p_account['id'];
+
+		$t_bug_data->reporter_id		= mail_get_user( $p_mail['From'] );
+
+		if ( mail_is_a_bugnote( $p_mail['Subject'] ) ) {
+			# Add a bug note
+			$t_bug_id = mail_get_bug_id_from_subject( $p_mail['Subject'] );
+			if ( ! bug_is_readonly( $t_bug_id ) ) {
+				bugnote_add ( $t_bug_id, $p_mail['X-Mantis-Body'] );
+				email_bugnote_add ( $t_bug_id );
+			}
+		} else	{
+			# Create the bug
+			$t_bug_id = bug_create( $t_bug_data );
+			email_new_bug( $t_bug_id );
+		}
+		# Add files
+		if ( null != $p_mail['X-Mantis-Parts'] ) {
+			foreach ($p_mail['X-Mantis-Parts'] as $part) {
+				mail_add_file ( $t_bug_id, $part );
+			}
+		}
+
+	}
+
+?>
+
diff -Nur mantis-1.0.0rc3.orig/core/user_api.php mantis-1.0.0rc3/core/user_api.php
--- mantis-1.0.0rc3.orig/core/user_api.php	Fri Jul 22 17:34:02 2005
+++ mantis-1.0.0rc3/core/user_api.php	Mon Oct 31 11:18:41 2005
@@ -526,6 +526,24 @@
 		}
 	}
 
+	# get a user id from an mail address
+	#  return false if the mail address does not exist
+	function user_get_id_by_mail( $p_mailaddress ) {
+		$c_mailaddress = db_prepare_string( $p_mailaddress );
+		$t_user_table = config_get( 'mantis_user_table' );
+
+		$query = "SELECT id
+				  FROM $t_user_table
+				  WHERE email='$c_mailaddress'";
+		$result = db_query( $query );
+
+		if ( 0 == db_num_rows( $result ) ) {
+			return false;
+		} else {
+			return db_result( $result );
+		}
+	}
+
 	# --------------------
 	# return all data associated with a particular user name
 	#  return false if the username does not exist
diff -Nur mantis-1.0.0rc3.orig/doc/README.bug_report_mail mantis-1.0.0rc3/doc/README.bug_report_mail
--- mantis-1.0.0rc3.orig/doc/README.bug_report_mail	Thu Jan  1 01:00:00 1970
+++ mantis-1.0.0rc3/doc/README.bug_report_mail	Mon Oct 31 11:19:12 2005
@@ -0,0 +1,116 @@
+The current version of bug_report_mail support plain text and MIME
+encoded e-mails via POP3 Mailaccounts with PEAR's Net_POP3 package.
+
+bug_report_mail is able to recognize if mail is a reply to an already opened
+bug and adds the content as a bugnote.
+
+If you are alway running Mantis you have to alter your projects table
+with the sql/bug_report_mail.sql script.
+If not, you can create the database tables in the way described in
+the doc/INSTALL file.
+
+This patch changes the following files:
+    core/category_api.php
+    core/user_api.php
+    admin/schema.php
+    config_defaults_inc.php
+    manage_proj_cat_edit_page.php
+    manage_proj_edit_page.php
+These files are new:
+    core/mail_api.php
+    doc/README.bug_report_mail
+    doc/bug_report_mail.sql
+    bug_report_mail.php
+    manage_proj_cat_mail_delete.php
+    manage_proj_cat_mail_update.php
+    manage_proj_mail_categories.php
+    manage_proj_mail_delete.php
+    manage_proj_mail_update.php
+
+After installing this patch, you can add a POP3 server's hostname
+and authentication data for each of your projects with the project edit form.
+
+There are two ways to receive mail with bug_report_mail:
+The secure (and default) way is to use a standard reporting user:
+You have to create a reporter account, for example 'Mail'.
+The name for this reporter account you have to write in your config_inc.php file:
+	$g_mail_reporter = "Mail";
+and then, bug_report_mail must be informed to behave like this:
+	$g_mail_use_reporter = ON;
+
+The other way is to signup new user accounts automatically.
+For using this, you have to change this
+	$g_mail_auto_signup     = OFF;
+from OFF to ON.
+Now, bug_report_mail will look for an user named like the mail's sender
+or an user which mail adress is identical.
+If no user is found, then a new account will be created.
+The new user's name will be the mail address.
+
+This could be used for attacks, but there is no other way in the moment.
+
+If you like to parse MIME encoded mails, you have to install the PEAR
+Mail_Mime package and set
+	$g_mail_parse_mime	= OFF;
+from OFF to ON.
+
+For debugging controls there is the switch
+	$g_mail_additional	= OFF;
+which puts the complete message into the Additional Information field,
+if it is activated.
+
+In this case you should decrease the amount of fetched messages via
+	$g_mail_fetch_max	= 1;
+because the mime decoding needs a lot of memory.
+
+If you'd like to use the Mail Reporter but don't save the whole message for
+making the sender's address available, set
+	$g_mail_save_from	= OFF;
+to ON.
+
+After this, bug_report_mail can be used via cron like this:
+
+*/5 *   *   *   * lynx --dump http://mantis.homepage.com/bug_report_mail.php
+or via command line interface
+*/5 *   *   *   * /usr/local/bin/php /path/to/mantis/bug_report_mail.php
+
+This line fetch bug reports from via POP3 every 5 minutes. 
+
+This addon is distributed under the same conditions as Mantis itself.
+
+Gerrit Beine, August 2004
+
+Changelog:
+Oct 2005
+	- update to Mantis 1.0.0rc3
+	- update to Mantis 0.19.3
+Sep 2005:
+	- update to Mantis 1.0.0rc2
+	- fixed a bug in getting all categories for a project
+		category_get_all_rows in core/category_api.php
+Aug 2005:
+	- update to Mantis 1.0.0rc1
+	- include the additional patches submitted by
+		- gernot (Fixed MIME handling and save the mail's sender)
+		  mail_get_all_mails in core/mail_api.php
+		  mail_parse_content in core/mail_api.php
+		  mail_add_bug in core/mail_api.php
+		- stevenc (Fixed MIME handling)
+		  mail_parse_content in core/mail_api.php
+		- rainman (Fixed empty files bug and regex for finding a bug id)
+		  mail_add_file in core/mail_api.php
+		  mail_get_bug_id_from_subject in core/mail_api.php
+Dec 2004:
+	- update to Mantis 0.19.2
+	- add config: g_mail_parse_mime
+	- add config: g_mail_additional
+	- add config: g_mail_fetch_max
+	- make it working via CLI
+Nov 2004:
+	- update to Mantis 0.19.1
+	- add support for MIME decoding
+Sep 2004:
+	- update to Mantis 0.19.0
+Aug 2004:
+	- create patch for Mantis 0.18.3
+
diff -Nur mantis-1.0.0rc3.orig/doc/bug_report_mail.sql mantis-1.0.0rc3/doc/bug_report_mail.sql
--- mantis-1.0.0rc3.orig/doc/bug_report_mail.sql	Thu Jan  1 01:00:00 1970
+++ mantis-1.0.0rc3/doc/bug_report_mail.sql	Mon Oct 31 11:18:41 2005
@@ -0,0 +1,12 @@
+ALTER TABLE `mantis_project_table`
+ADD `pop3_host` VARCHAR( 255 ) DEFAULT NULL ,
+ADD `pop3_user` VARCHAR( 255 ) DEFAULT NULL ,
+ADD `pop3_pass` VARCHAR( 255 ) DEFAULT NULL ,
+ADD `pop3_categories` ENUM( '0', '1' ) DEFAULT '0' NOT NULL ;
+
+ALTER TABLE `mantis_project_category_table`
+ADD `pop3_host` VARCHAR( 255 ) DEFAULT NULL ,
+ADD `pop3_user` VARCHAR( 255 ) DEFAULT NULL ,
+ADD `pop3_pass` VARCHAR( 255 ) DEFAULT NULL ;
+
+INSERT INTO mantis_user_table (username, realname, email, password, date_created, last_visit, enabled, protected, access_level, login_count, lost_password_request_count, failed_login_count, cookie_string) VALUES ('Mail', 'Mail Reporter', 'nomail', 'a268462c3c679a9027658c5aa723f97c', '2004-12-25 15:41:49', '2004-12-25 15:41:49', 1, 0, 25, 0, 0, 0, CONCAT(MD5(RAND()),MD5(NOW())));
diff -Nur mantis-1.0.0rc3.orig/manage_proj_cat_edit_page.php mantis-1.0.0rc3/manage_proj_cat_edit_page.php
--- mantis-1.0.0rc3.orig/manage_proj_cat_edit_page.php	Sat Feb 12 21:01:06 2005
+++ mantis-1.0.0rc3/manage_proj_cat_edit_page.php	Mon Oct 31 11:18:41 2005
@@ -15,6 +15,7 @@
 	$t_core_path = config_get( 'core_path' );
 
 	require_once( $t_core_path.'category_api.php' );
+	require_once( $t_core_path.'mail_api.php' );
 ?>
 <?php
 	$f_project_id	= gpc_get_int( 'project_id' );
@@ -24,6 +25,10 @@
 
 	$t_row = category_get_row( $f_project_id, $f_category );
 	$t_assigned_to = $t_row['user_id'];
+	$t_mail = mail_get_account_data( $f_project_id );
+	if ( $t_mail['pop3_categories'] ) {
+		$t_category_mail = mail_category_get_account_data( $f_project_id, $f_category );
+	}
 ?>
 <?php html_page_top1() ?>
 <?php html_page_top2() ?>
@@ -84,4 +89,59 @@
 	</form>
 </div>
 
+<?php  if ( $t_mail['pop3_categories'] ) { ?>
+<!-- MAIL ACCOUNT CHANGE -->
+<br />
+<div align="center">
+	<form method="post" action="manage_proj_cat_mail_update.php">
+		<input type="hidden" name="project_id" value="<?php echo $f_project_id ?>" />
+		<input type="hidden" name="category" value="<?php echo string_attribute( $f_category ) ?>" />
+		<table class="width75" cellspacing="1">
+			<tr>
+				<td class="form-title" colspan="4">
+					<?php echo 'Category Mail Account Settings' ?>
+				</td>
+			</tr>
+			<tr class="row-1">
+				<td class="category" width="25%">
+					<?php echo "POP3 Host"?>
+				</td>
+				<td width="75%">
+					<input type="text" name="pop3_host" size="64" maxlength="255" value="<?php echo string_attribute( $t_category_mail['pop3_host'] ) ?>" />
+				</td>
+			</tr>
+			<tr class="row-1">
+				<td class="category" width="25%">
+					<?php echo "POP3 User"?>
+				</td>
+				<td width="75%">
+					<input type="text" name="pop3_user" size="64" maxlength="255" value="<?php echo string_attribute( $t_category_mail['pop3_user'] ) ?>" />
+				</td>
+			</tr>
+			<tr class="row-1">
+				<td class="category" width="25%">
+					<?php echo "POP3 Password"?>
+				</td>
+				<td width="75%">
+					<input type="text" name="pop3_pass" size="64" maxlength="255" value="<?php echo string_attribute( $t_category_mail['pop3_pass'] ) ?>" />
+				</td>
+			</tr>
+			<tr>
+			<td colspan="2">
+				<input type="submit" value="<?php echo 'Set Mail Account Data' ?>" />
+				</td>
+			</tr>
+		</table>
+	</form>
+</div>
+<!-- MAIL ACCOUNT RESET -->
+<div class="border-center">
+	<form method="post" action="manage_proj_cat_mail_delete.php">
+		<input type="hidden" name="project_id" value="<?php echo $f_project_id ?>" />
+		<input type="hidden" name="category" value="<?php echo string_attribute( $f_category ) ?>" />
+		<input type="submit" value="<?php echo 'Delete Mail Account Data' ?>" />
+	</form>
+</div>
+<?php } ?>
+ 
 <?php html_page_bottom1( __FILE__ ) ?>
diff -Nur mantis-1.0.0rc3.orig/manage_proj_cat_mail_delete.php mantis-1.0.0rc3/manage_proj_cat_mail_delete.php
--- mantis-1.0.0rc3.orig/manage_proj_cat_mail_delete.php	Thu Jan  1 01:00:00 1970
+++ mantis-1.0.0rc3/manage_proj_cat_mail_delete.php	Mon Oct 31 11:18:41 2005
@@ -0,0 +1,44 @@
+<?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$
+	# --------------------------------------------------------
+
+	require_once( 'core.php' );
+
+	$t_core_path = config_get( 'core_path' );
+
+	require_once( $t_core_path . 'mail_api.php' );
+
+	$f_project_id	= gpc_get_int( 'project_id' );
+	$f_category	= gpc_get_string( 'category' );
+
+	access_ensure_project_level( config_get( 'manage_project_threshold' ), $f_project_id );
+
+	mail_category_delete( $f_project_id, $f_category );
+
+	$t_redirect_url = 'manage_proj_cat_edit_page.php?project_id=' . $f_project_id . '&category=' . $f_category;
+
+	html_page_top1();
+
+	html_meta_redirect( $t_redirect_url );
+
+	html_page_top2();
+?>
+
+<br />
+<div align="center">
+<?php
+	echo lang_get( 'operation_successful' ) . '<br />';
+
+	print_bracket_link( $t_redirect_url, lang_get( 'proceed' ) );
+?>
+</div>
+
+<?php html_page_bottom1( __FILE__ ) ?>
+
diff -Nur mantis-1.0.0rc3.orig/manage_proj_cat_mail_update.php mantis-1.0.0rc3/manage_proj_cat_mail_update.php
--- mantis-1.0.0rc3.orig/manage_proj_cat_mail_update.php	Thu Jan  1 01:00:00 1970
+++ mantis-1.0.0rc3/manage_proj_cat_mail_update.php	Mon Oct 31 11:18:41 2005
@@ -0,0 +1,59 @@
+<?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$
+	# --------------------------------------------------------
+
+	require_once( 'core.php' );
+
+	$t_core_path = config_get( 'core_path' );
+
+	require_once( $t_core_path . 'mail_api.php' );
+
+	$f_project_id	= gpc_get_int( 'project_id' );
+	$f_pop3_host	= gpc_get_string( 'pop3_host' );
+	$f_pop3_user	= gpc_get_string( 'pop3_user' );
+	$f_pop3_pass	= gpc_get_string( 'pop3_pass' );
+	$f_category	= gpc_get_string( 'category' );
+
+	access_ensure_project_level( config_get( 'manage_project_threshold' ), $f_project_id );
+
+	if ( is_blank( $f_pop3_host ) ) {
+			trigger_error( ERROR_EMPTY_FIELD, ERROR );
+	}
+	else {
+		if ( is_blank( $f_pop3_user ) ) {
+			trigger_error( ERROR_EMPTY_FIELD, ERROR );
+	}
+		if ( is_blank( $f_pop3_pass ) ) {
+			trigger_error( ERROR_EMPTY_FIELD, ERROR );
+		}
+	}
+
+	mail_category_update( $f_project_id, $f_category, $f_pop3_host, $f_pop3_user, $f_pop3_pass );
+
+	$t_redirect_url = 'manage_proj_cat_edit_page.php?project_id=' . $f_project_id . '&category=' . $f_category;
+
+	html_page_top1();
+
+	html_meta_redirect( $t_redirect_url );
+
+	html_page_top2();
+?>
+
+<br />
+<div align="center">
+<?php
+	echo lang_get( 'operation_successful' ) . '<br />';
+
+	print_bracket_link( $t_redirect_url, lang_get( 'proceed' ) );
+?>
+</div>
+
+<?php html_page_bottom1( __FILE__ ) ?>
+
diff -Nur mantis-1.0.0rc3.orig/manage_proj_edit_page.php mantis-1.0.0rc3/manage_proj_edit_page.php
--- mantis-1.0.0rc3.orig/manage_proj_edit_page.php	Tue Jul 26 14:41:02 2005
+++ mantis-1.0.0rc3/manage_proj_edit_page.php	Mon Oct 31 11:18:41 2005
@@ -18,6 +18,7 @@
 	require_once( $t_core_path . 'version_api.php' );
 	require_once( $t_core_path . 'custom_field_api.php' );
 	require_once( $t_core_path . 'icon_api.php' );
+	require_once( $t_core_path . 'mail_api.php' );
 ?>
 <?php
 	$f_project_id = gpc_get_int( 'project_id' );
@@ -25,6 +26,7 @@
 	access_ensure_project_level( config_get( 'manage_project_threshold' ), $f_project_id );
 
 	$row = project_get_row( $f_project_id );
+	$mail = mail_get_account_data( $f_project_id );
 ?>
 <?php html_page_top1() ?>
 <?php html_page_top2() ?>
@@ -689,5 +691,76 @@
 	</tr>
 	</table>
 </div>
+
+<?php  if ( ! $mail['pop3_categories'] ) { ?>
+<!-- MAIL ACCOUNT CHANGE -->
+<br />
+<div align="center">
+	<form method="post" action="manage_proj_mail_update.php">
+		<input type="hidden" name="project_id" value="<?php echo $f_project_id ?>" />
+		<table class="width75" cellspacing="1">
+			<tr>
+				<td class="form-title" colspan="4">
+					<?php echo 'Mail Account Settings' ?>
+				</td>
+			</tr>
+			<tr class="row-1">
+				<td class="category" width="25%">
+					<?php echo "POP3 Host"?>
+				</td>
+				<td width="75%">
+					<input type="text" name="pop3_host" size="64" maxlength="255" value="<?php echo string_attribute( $mail['pop3_host'] ) ?>" />
+				</td>
+			</tr>
+			<tr class="row-1">
+				<td class="category" width="25%">
+					<?php echo "POP3 User"?>
+				</td>
+				<td width="75%">
+					<input type="text" name="pop3_user" size="64" maxlength="255" value="<?php echo string_attribute( $mail['pop3_user'] ) ?>" />
+				</td>
+			</tr>
+			<tr class="row-1">
+				<td class="category" width="25%">
+					<?php echo "POP3 Password"?>
+				</td>
+				<td width="75%">
+					<input type="text" name="pop3_pass" size="64" maxlength="255" value="<?php echo string_attribute( $mail['pop3_pass'] ) ?>" />
+				</td>
+			</tr>
+			<tr>
+				<td colspan="2">
+					<input type="submit" value="<?php echo 'Set Mail Account Data' ?>" />
+				</td>
+			</tr>
+		</table>
+	</form>
+</div>
+<!-- MAIL ACCOUNT RESET -->
+<div class="border-center">
+	<form method="post" action="manage_proj_mail_delete.php">
+		<input type="hidden" name="project_id" value="<?php echo $f_project_id ?>" />
+		<input type="submit" value="<?php echo 'Delete Mail Account Data' ?>" />
+	</form>
+</div>
+<br />
+<!-- MAIL ACCOUNT CATEGORIES -->
+<div class="border-center">
+	<form method="post" action="manage_proj_mail_categories.php">
+		<input type="hidden" name="project_id" value="<?php echo $f_project_id ?>" />
+		<input type="hidden" name="categories" value="On" />
+		<input type="submit" value="<?php echo 'Activate Mail Account per Category' ?>" />
+	</form>
+</div>
+<?php } else { ?>
+<!-- MAIL ACCOUNT CATEGORIES -->
+<div class="border-center">
+	<form method="post" action="manage_proj_mail_categories.php">
+		<input type="hidden" name="project_id" value="<?php echo $f_project_id ?>" />
+		<input type="hidden" name="categories" value="Off" />
+		<input type="submit" value="<?php echo 'Deactivate Mail Account per Category' ?>" />
+	</form>
+</div>
+<?php } ?>
 
 <?php html_page_bottom1( __FILE__ ) ?>
diff -Nur mantis-1.0.0rc3.orig/manage_proj_mail_categories.php mantis-1.0.0rc3/manage_proj_mail_categories.php
--- mantis-1.0.0rc3.orig/manage_proj_mail_categories.php	Thu Jan  1 01:00:00 1970
+++ mantis-1.0.0rc3/manage_proj_mail_categories.php	Mon Oct 31 11:18:41 2005
@@ -0,0 +1,43 @@
+<?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$
+	# --------------------------------------------------------
+
+	require_once( 'core.php' );
+
+	$t_core_path = config_get( 'core_path' );
+
+	require_once( $t_core_path . 'mail_api.php' );
+
+	$f_project_id	= gpc_get_int( 'project_id' );
+	$f_activate	= gpc_get_string( 'categories' );
+
+	access_ensure_project_level( config_get( 'manage_project_threshold' ), $f_project_id );
+
+	mail_categories( $f_project_id, $f_activate );
+
+	$t_redirect_url = 'manage_proj_edit_page.php?project_id=' . $f_project_id;
+
+	html_page_top1();
+
+	html_meta_redirect( $t_redirect_url );
+
+	html_page_top2();
+?>
+
+<br />
+<div align="center">
+<?php
+	echo lang_get( 'operation_successful' ) . '<br />';
+	print_bracket_link( $t_redirect_url, lang_get( 'proceed' ) );
+?>
+</div>
+
+<?php html_page_bottom1( __FILE__ ) ?>
+
diff -Nur mantis-1.0.0rc3.orig/manage_proj_mail_delete.php mantis-1.0.0rc3/manage_proj_mail_delete.php
--- mantis-1.0.0rc3.orig/manage_proj_mail_delete.php	Thu Jan  1 01:00:00 1970
+++ mantis-1.0.0rc3/manage_proj_mail_delete.php	Mon Oct 31 11:18:41 2005
@@ -0,0 +1,43 @@
+<?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$
+	# --------------------------------------------------------
+
+	require_once( 'core.php' );
+
+	$t_core_path = config_get( 'core_path' );
+
+	require_once( $t_core_path . 'mail_api.php' );
+
+	$f_project_id	= gpc_get_int( 'project_id' );
+
+	access_ensure_project_level( config_get( 'manage_project_threshold' ), $f_project_id );
+
+	mail_delete( $f_project_id );
+
+	$t_redirect_url = 'manage_proj_edit_page.php?project_id=' . $f_project_id;
+
+	html_page_top1();
+
+	html_meta_redirect( $t_redirect_url );
+
+	html_page_top2();
+?>
+
+<br />
+<div align="center">
+<?php
+	echo lang_get( 'operation_successful' ) . '<br />';
+
+	print_bracket_link( $t_redirect_url, lang_get( 'proceed' ) );
+?>
+</div>
+
+<?php html_page_bottom1( __FILE__ ) ?>
+
diff -Nur mantis-1.0.0rc3.orig/manage_proj_mail_update.php mantis-1.0.0rc3/manage_proj_mail_update.php
--- mantis-1.0.0rc3.orig/manage_proj_mail_update.php	Thu Jan  1 01:00:00 1970
+++ mantis-1.0.0rc3/manage_proj_mail_update.php	Mon Oct 31 11:18:41 2005
@@ -0,0 +1,58 @@
+<?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$
+	# --------------------------------------------------------
+
+	require_once( 'core.php' );
+
+	$t_core_path = config_get( 'core_path' );
+
+	require_once( $t_core_path . 'mail_api.php' );
+
+	$f_project_id	= gpc_get_int( 'project_id' );
+	$f_pop3_host	= gpc_get_string( 'pop3_host' );
+	$f_pop3_user	= gpc_get_string( 'pop3_user' );
+	$f_pop3_pass	= gpc_get_string( 'pop3_pass' );
+
+	access_ensure_project_level( config_get( 'manage_project_threshold' ), $f_project_id );
+
+	if ( is_blank( $f_pop3_host ) ) {
+			trigger_error( ERROR_EMPTY_FIELD, ERROR );
+	}
+	else {
+		if ( is_blank( $f_pop3_user ) ) {
+			trigger_error( ERROR_EMPTY_FIELD, ERROR );
+	}
+		if ( is_blank( $f_pop3_pass ) ) {
+			trigger_error( ERROR_EMPTY_FIELD, ERROR );
+		}
+	}
+
+	mail_update( $f_project_id, $f_pop3_host, $f_pop3_user, $f_pop3_pass );
+
+	$t_redirect_url = 'manage_proj_edit_page.php?project_id=' . $f_project_id;
+
+	html_page_top1();
+
+	html_meta_redirect( $t_redirect_url );
+
+	html_page_top2();
+?>
+
+<br />
+<div align="center">
+<?php
+	echo lang_get( 'operation_successful' ) . '<br />';
+
+	print_bracket_link( $t_redirect_url, lang_get( 'proceed' ) );
+?>
+</div>
+
+<?php html_page_bottom1( __FILE__ ) ?>
+
