Changelog:
Nov 2010 - EmailReporting-0.8.4
	- Improved the project category list
	- If no attachment filename has been found, EmailReporting will generate a name instead of rejecting the file
	- Relative paths are converted to absolute paths for mail_debug_directory and mail_tmp_directory.

Sep 2010 - EmailReporting-0.8.3
	- Officially compatible with Mantis 1.2.2 and 1.2.3
	- Updated readme
	- Changed conflicting language variable names for title, description and author to plugin_title, plugin_description and plugin_author.
	- Updated PEAR packages supplied with EmailReporting
	- Non-global categories can now also be selected as a category for a mailbox (datacompboy)
	- Fixed incorrect function call in parser.php on line 306 and 310 (obstbaum80)

May 2010 - EmailReporting-0.8.2
	- Fixed a problem when both remove mantis and remove all replies are turned ON (obones)
	- Configuration option type array is now called string_multiline
	- Configuration option type dropdown_mailbox_encryption is now called dropdown_encryption
	- Configuration option type dropdown_mailboxes is now called dropdown_descriptions
	- yes and no strings now come from the core language files
	- mailbox_ part of the indexes for the mailbox arrays have been removed
	- Fixed wrong variable usage during testing of mailbox
	- zero_mailboxes lang index name changed to zero_descriptions
	- Language indexes for actions that ended on _mailbox have been changed to _action
	- The configuration option that defines what identifies a reply is now a multiline input box (obones)
	- New function which returns the GLOBALS index name of the mailbox_api (ERP_get_mailbox_api_name())
	- 2 new functions which can return mailbox data (ERP_get_current_mailbox and ERP_get_mailboxes)
	- Updated readme based on added plugins that depend on EmailReporting
	- hostname and port are no longer stored in a sub array within mailbox. They now have there own indexes
	- Event added that allows the addition of extra mailbox form fields (see readme)
	- New config type added called dropdown_descriptions_multiselect
	- Added 2 specific ERP events for manipulating data before adding bug reports and bugnotes
	- Some texts in the ERP_output_config_option will always use the EmailReporting plugins translation even if its called from another plugin
	- Get from LDAP is now also an option for the preferred usernames. This will be attempted using the email address
	- Email addresses will now be compared to LDAP records incase login_method is LDAP and use_ldap_email is ON
	- Small optimization to the creation of the global path_erp variable

Apr 2010 v2 - EmailReporting-0.8.1
	- Officially compatible with MantisBT 1.2.1
	- Fixed a bug on linux with directory strings in the configurations (obones)
	- File number before attachments only added when required (obones)
	- Added a notice to the readme stating that for proper operation of EmailReporting, the scheduled job needs to operate under the same user account as the webserver

Apr 2010 - EmailReporting-0.8.0
	- Improved the mailbox settings page
	- Improved the plugin configuration page
	- Improved the changelog a tiny bit
	- Updated the readme with upgrade instructions
	- "Mailbox settings" page is now called "Manage Mailboxes". This includes the filenames, maintainmailbox is now called manage_mailbox
	- "Configuration" page is now called "Manage Configuration Options". This includes the filenames, config is now called manage_config
	- PEAR files are now located in the core_pear directory. This way they can be easily removed if you don't need them.
	- New user creation emails from EmailReporting now also contain a proper urls
	- "Copy mailbox" action is now available for mailboxes
	- Various textual corrections and improvements
	- mail_delete option now works for IMAP. Emails will be marked as deleted but not expunged when this option is disabled
	- Removed redundant config_get for limit_email_domain
	- Fixed a possible error with content-transfer-encoding index missing in parser.php
	- Fixed neglecting of properly closing connection to the IMAP server during the testing of mailboxes
	- Fixed a bug in the mail_parse_address function concerning the usage of a wrong index name when no name was found in the from part of the email
	- New EmailReporting menu above every EmailReporting page
	- Attachments will only be added if allow_file_upload is turned ON
	- Debugging of the alternative method for running bug_report_mail at scheduled intervals has been improved
	- Updated the plugin description on the manage plugins page. It now includes the git.mantisforge.org link
	- Added changelog page to the EmailReporting menu in mantis
	- Added readme page to the EmailReporting menu in mantis
	- All of the function names are now prepended by "ERP_" (Email Reporting Plugin), sometimes replacing the already present "mail_"
	- The ERP_update_check function will now check whether or not it needs to perform some updates to the configuration options
	- Some configuration options that were no longer used but could still be lingering in the database will be removed by ERP_update_check
	- The mail_reporter setting will now be saved using the user_id instead of the username
	- The setting mail_reporter is now called mail_reporter_id
	- The setting mail_directory is now called mail_debug_directory
	- Removed the require_once for core.php from pages/bug_report_mail.php
	- A set of settings for a mailbox will only contain those required for the selected mailbox_type
	- Improved IMAP and POP connection and error handling
	- Mail_fetch_max now works properly for IMAP when mailbox_createfolderstructure is enabled
	- Removed default values for configuration options in pages/manage_config_edit.php
	- Removed default values for mailboxes in pages/manage_mailbox_edit.php
	- Adjusted the amount of times email_separator1 needs to be found from 3 to 5
	- Added IPv6 support
	- Testing a mailbox now shows default ports used if you did not fill any in
	- Fixed an error which occurs if you try to perform an action on a mailbox that no longer exists
	- Changed the random number generator for user creations from mt_rand( 4, 5 ) to mt_rand( 1000, 99999 )
	- mail_get_mailboxes function removed as it outlived its function
	- Mailbox encryption features now only available if PHP OpenSSL extension is available
	- Fixed a problem with a missing port number when using the alternative method to running bug_report_mail (~25072)
	- Updated readme with "Partial support" notice for Outlook RTF formatted emails
	- Improved functionality when using IMAP in combination with the inbox folder as the basefolder
	- mail_api.php has been restructured to form a class
	- Improved email_is_valid check with caching (only for the current session).
	- Email_is_valid will only be performed when the Mail Reporter is used or on a new user creation
	- Optimized the Mail_Parser a little bit
	- Configuration option mail_bug_priority_default has been removed. The default_bug_priority from the core mantis configuration options will be used instead
	- bug_report_mail is now allowed to run for as long as it needs
	- Default configuration option for mail_tmp_directory is php.ini option upload_tmp_dir if available else it will revert to the old value /tmp
	- The regular expression for the bugnote check now accepts all characters for the project names
	- Removed useless CVS $id$ tags in three files as git can not use them
	- Updated the add_bug function to be more like its counterpart in bug_report.php including plugin hooks
	- Improved the mail_is_a_bugnote function. Now only one regex is needed
	- A new functionality has been added which optionally removes all replies from emails
	- A new functionality has been added which optionally temporarily enables email_receive_own during the current session
	- 2 new options with which you can enable or disable the adding of bugnotes and bugs
	- Added a new option to disable the fallback to the mail reporter account
	- The PHP memory limit is disabled when bug_report_mail is running.
	- When debug mode is enabled the memory usage of the mail_api will be shown at specific moments of processing
	- Mailboxes can be disabled
	- Memory usage optimized (~20% less memory required)
	- Debug mode will no longer show the parsed email contents. They will be saved to the debug directory in a file just like the raw email contents
	- Removed the alternative method to running bug_report_mail as a scheduled job.
	- Applied a fix for bug #11818 (~25040)
	- Besides the reporter id and email, bug_report_mail now also shows the bug_id where the actions were performed
	- Found existing users must have an enabled account
	- mailbox_project is now called mailbox_project_id
	- mailbox_global_category is now called mailbox_global_category_id
	- mail_identify_reply is now called mail_remove_mantis_email
	- Parse MIME setting removed. It was useless as simply parsing the raw message already costs much more memory then processing subparts in the message
	- bugnotes to readonly issues will now generate a new bug report with a bug relation to the readonly issue
	- New configuration option which allows you to select a preferred username for new user creations
	- User creations with long usernames longer then 32 characters have been fixed

Mar 2010 v2 - EmailReporting-0.7.9
	- All from email addresses will now be checked by the email_is_valid function before a email will be processed
	- Updated readme based on new functionality
	- EmailReporting will now show an error when a email address is rejected.
	- Fixed a bug with the email address that was given to email_is_valid for checking
	- removed the email_is_valid check from the mail_get_user function as it does need to be checked twice

Mar 2010 - EmailReporting-0.7.8
	- EmailReporting is now officially compatible with 1.2.0
	- Some code improvements for the mail_add_bug function
	- When EmailReporting removes a mantis reply, it will now add a text to notify that it has been removed
	- Subprojects were not properly selectable for setup with a mailbox
	- Empty bugnote emails will no longer be added to the issues. The attachment in those emails (if present) will still be added
	- limit_email_domain will now be adhered to. Any from email addresses not accepted by this setting will be ignored and deleted
	- Some small note corrections in emailreporting.php
	- Further updated the separated README and CHANGELOG
	- Removed libregeek's regular expressions for incoming email address functionality as limit_email_domain should be used
	- Reverted libregeek's undocumented changes to scripts/bug_report_mail.php as they could cause problems for cronjobs in specific situations

Feb 2010 v3 - EmailReporting-0.7.7
	- Reverted the change of version 0.7.6 (libregeek)
	- Separated README and CHANGELOG (libregeek)

Feb 2010 v2 - EmailReporting-0.7.6
	- If the incoming email address is present in database then update the corresponding user_id in mail_get_user(). This is true even if 'mail_use_reporter' is set (libregeek). 

Feb 2010 - EmailReporting-0.7.5
	- Configuration parameter to specify regular expressions for incoming email address (libregeek).

Jan 2010 - EmailReporting-0.7.4
	- Small fix for possible problems finding core.php in scripts/bug_report_mail.php
	- mbstring extension is no longer a requirement for running this plugin
	- Disabled quoted_printable_decode in parser since mimedecode is already doing that
	- rfc_822bodies forced to true (also needed transfer_encoding)
	- Kerio Mailserver had a compatibility issue with net_imap 1.0.3 (was fixed in net_imap 1.1.0). The fix has been backported to 1.0.3 in this plugin
	- Some connection error handling improvements
	- Adding notes by email generated 2 exactly the same notifications
	- Status change and resolution change for adding bugnotes by email now only occures when the status of the bug has gone past 'bug_resolved_status_threshold' instead of 'bug_reopen_status'
	- mail_mantisbt_url is now called mail_mantisbt_url_fix because variables with url in the end are not allowed to be stored in the database anymore

Dec 2009 v3 - EmailReporting-0.7.3
	- Applied a natural case insensitive sort on the charset dropdown list in the configuration menu
	- Changed the sort method from normal sort to natural case insensitive sort for mailbox_auth_method
	- Mimedecode pear package updated to new version
	- rfc_822bodies (new option in mimedecode) forced to false
	- The messages in IMAPs with the deleted status will not be counted towards the mail_fetch_max counter
	- various small code optimizations
	- Scheduling bug_report_mail as a cron / scheduled job is not required anymore, but is recommended and EmailReporting default configuration assumes you have / will set one up.
	- Adjusted the check whether bug_report_mail can run in a webserver to the same method as in send_emails.php
	- The On and Off texts have been replaced by Yes and No
	- Added helper_mantis_url around 1st bug_report_mail link on the configuration page
	- Removal of mantis replies is no longer experimental
	- Applied a fix for the path in emails that are generated by mantis while bug_report_mail is running outside of a browser
	- During installation allow_blank_email will no longer use config_set. It will use config_set_cache
	- Changed the random number generator for user creations from rand() to mt_rand( 4, 5 )

Dec 2009 v2 - EmailReporting-0.7.2
	- If a charset has already been found in the email it will stop searching for other charsets
	- If a attachment has a size of 0 bytes it will now be added to the rejected-files.txt else it will block proper processing of emails
	- The max attachment size will now be calculated the same way Mantis does
	- Added SSL support for IMAP and POP3 connections partially based on work from obstbaum80
	- mailbox_auth_method will save the selected value properly now (obstbaum80)
	- The possible values for mailbox_auth_method are now retrieved from the pear packages Net_IMAP and Net_POP3
	- various small code optimizations

Dec 2009 - EmailReporting-0.7.0
	- Added a fix for the adding of bugnotes when the issue is readonly (~21199)
	- Sometimes the charset names in emails were lowercase while mb_list_encodings returned names using a mix of upper and lower case names. This caused problems for detecting valid encodings used in emails
	- Support for IMAP has been added based on Rolf Kleef's work
	- Added Net_IMAP 1.0.3 to this package. 1.1.0 seems to be broken in some situations so EmailReporting will force the use of 1.0.3
	- Added sanity check to the bug priority array config. If this fails the old value will be retained
	- mail_auth_method (now called mailbox_auth_method) has been moved from the configuration menu to the mailbox settings. This way you can modify this per mailbox
	- Script is now declared compatible with 1.2.0rc2
	- Restored lost functionality to mail_fetch_max. This functionality was lost from version mantis-1.0.3.patch.gz and onwards. You might want to increase the mail_fetch_max value since by default it wil only retrieve one email per mailbox everytime bug_report_mail.php is executed
	- Deleting mailboxes works again. Seems to have been broken since the 0.5.0 release

Okt 2009 - EmailReporting-0.6.3
	- mb_convert_encoding converted strings even if they were using the same charsets. This caused the necessary problems since somehow certain chars seemed to be replaced with empty spaces.
	- EmailReporting will now try to retrieve the charset from the email content type if it is present, as this works better then the auto detect of mbstring functions for conversion. As a fallback it will still try the auto detect if the charset is missing.

Sep 2009 - EmailReporting-0.6.2
	- Incase the email address is not encapsulated with the proper chars EmailReporting will consider the whole string the email address (Note ~22839)
	- Problems with locating pear.php have been corrected and pear5.php is now also present in the package
	- Added a limit on the maximum allowed file size so that the emails containing those attachments don't block further processing (uses the max_file_size setting of mantis)

Aug 2009 v2 - EmailReporting-0.6.1
	- bug_report_mail.sql has been removed to avoid confusions about needing to use it
	- Decrypting the mailbox password did not occur before editing. Fixed (Note ~22655)
	- A new variable is added which resets the plugin schema and fixes the Mail Reporter user when it has the email address "nomail" (Automatically done during the first initialization of the plugin)
	- Removed functions which performed the exclusion of emails to Mail Reporter with "nomail" mail address

Aug 2009 - EmailReporting-0.6
	- The script now also recognizes a possible name in the from part of emails. It uses this as the username during the creation of the user
	- Cleaned up some more useless files that were not used
	- User creation during the installation of the plugin is now handled by mantis api's, schema functions no longer needed.

Jul 2009 - EmailReporting-0.5
	- Modified script to the new plugin architecture of mantis 1.2.0rc1
	- This script no longer needs new fields created in the database. This allows installation on mantis configurations where the database user only has select, insert, update and delete rights
	- custom_file_api.php has been updated to reflect the changes in its original Mantis counterpart
	- Cleaned up functions and files that were no longer usefull and / or necessary
	- Script did not use the default severity and default reproducibility for new bugs, it does now
	- New setting called secured_script to protect it from running on a webserver. Uses the same method as the send_emails.php job
	- File types that are not allowed will now be properly skipped during processing of attachments in emails so that it doesn't cause further errors down the line
	- mail_additional config setting is now called mail_add_complete_email and saves the complete email as an attachment .txt document instead of in the "Additional information" field
	- replaced html2text 1.2 (phphtmlparser) with simplehtmldom 1.11 from http://sourceforge.net/projects/simplehtmldom/
	- Names of attachments will now also be processed by mbstring to convert the character encoding. The content of the attachment does not need to be processed since its stored as binary
	- Parser will try the content-disposition field and the content-type field for a name if the name seems to be missing. As a fallback a alternative name will be provided incase of attachments of type email
	- Added support to use a different port for the pop3 server.
	- A lot of rewrites for the processing in parser.php and mail_api.php. It should now process all attachments properly
	- Reversible encryption will now be applied to the mailbox password
	- Updated the user information inside bug_report_mail.sql. This file is useless now though since the adding of the user is handled by the plugin
	- php.ini var upload-tmp-dir no longer used, the script will use the config mail_tmp_directory for temporarily saving attachments
	- html parsing no longer requires the file to be physically saved. mail_tmp_directory no longer needed here
	- The Mail Reporter user will now be filtered out of the email system as long as he has "nomail" as a email address
	- Identifying bugnotes works again
	- New function which removes automatic mantis emails from bugnotes

Dec 2008
	- Scipt made compatible with Mantis 1.1.6

Sep 2008
	- Check whether php.ini var upload-tmp-dir is empty to avoid attachment problems

Aug 2008
	- Applied a character encoding conversion on incoming emails.
	- New setting in config_defaults_inc.php called $g_mail_encoding (values can contain supported values for this function: http://www.php.net/mb_convert_encoding)

Jul 2008
	- Fixed FILE_MOVE_FAILED to ERROR_FILE_MOVE_FAILED
	- Fixed problem with attachments not being processed properly in disk mode

Jun 2008
	- update to mantis 1.1.2
	- Changes applied based on cas's code' NOTE 0016246
	- Using html2text 1.2 created by Jose Solorzano of Starnetsys, LLC. for html email parsing
	- html parsing on by default now
	- All pear packages updated to latest available versions
	- Necessary query adjustments in category_api.php

Jun 2007
	- update to Mantis 1.1.0a3
	- Support for PHP 4 ( ~13805 )
	- Fixed a bug with processing priority's of emails (priority class variable didn't exist in Mail/Parser.php)
	- Updates to the latest PEAR packages
	- print_r changed to var_dump's (Works better if you have xdebug extension installed)
	- New config setting called:
		# Default bug category for mail reported bugs (Defaults to "default_bug_category")
		# Because in Mantis 1.1.0a3 a category is required, we need a default category for issues reported by email.
		# Make sure the category exists and it has been configured correctly
		$g_mail_default_bug_category = '%default_bug_category%';
	- Fixed a missing variable in the function: "mail_process_all_mails"
		$t_mail_debug was not set and would cause notice level errors and debug mode in this function wouldn't work ( ~13854 )
	- Emails are now not allways saved to disk ( ~13854 )
	- Made sure $t_mail['X-Mantis-Complete'] would allways be populated ( with null value if the config "mail_additional" was disabled )
	- Adding attachments to bug items now also works on Windows systems (Removed hardcoded directory part "/tmp/").
	- The subject of an email is now also trimmed before storing it in $t_bug_data->summary. Like it is in bug_report.php
	- Fixed problem with duplicate attachments ( ~14255 and ~14256 )

Aug 2006
	- update to Mantis 1.0.5
	- mail parsing completely rewritten
	- include additional patches submitted by
		- cas (handling of attachments and empty fields)
		  mail_add_file in core/mail.api
		  mail_add_bug in core/mail.api

May 2006
	- update to Mantis 1.0.3
	- added support for HTML mail
	- added support for encoded mail bodies and subjects
	- changed handling of mail
	- the global mail_debug configuration option is now set OFF by default
	- include the additional patches submitted by
		- EBY (support for priorities and file uploads)
		  file_add in core/file_api.php
		  mail_parse_content in core/mail_api.php
		  config_defaults_inc.php

Dec 2005
	- update to Mantis 1.0.0rc4
	- update to Mantis 0.19.4

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
