View Issue Details

IDProjectCategoryView StatusLast Update
0020684mantisbtemailpublic2016-06-12 00:42
ReporteratrolAssigned Tovboctor 
Status closedResolutionfixed 
Product Version1.3.0-rc.1 
Target Version1.3.0-rc.2Fixed in Version1.3.0-rc.2 
Summary0020684: Possible regression caused by changed $g_debug_email handling

Commit 4235a08618da1d66b44337867b72f4fdea633dc0 changed logic


  • Used for debugging e-mail notifications.
  • When it is OFF, the emails are sent normally.
  • If set to an e-mail address, all messages are sent to it, with the
  • original recipients (To, Cc, Bcc) included in the message body.
  • @global int $g_debug_email
    $g_debug_email = OFF;


  • This is used for debugging the e-mail features in mantis. By default this is blank.
  • This can be set to a valid email address when diagnosing problems with emails.
  • All e-mails are sent to this address with the original To, Cc, Bcc included in the message body.
  • Note: The email is NOT send to the recipients, only to the debug email address.
  • @global string $g_debug_email
    $g_debug_email = '';

The administrator documentation has not been updated to reflect this change.

I think that having just a string instead of OFF|email-address is the better approach, but it introduces a regression after upgrading if
someone has set $g_debug_email = OFF; in config_inc.php (the system will try to send email to address 0)
Maybe this is one of some reasons why there are some users telling that e-mail does no longer work after upgrading to 1.3.x.

TagsNo tags attached.


related to 0020679 closeddregad Enhance the logging to show email addresses being sent to 




2016-03-10 03:53

developer   ~0052733

Reminder sent to: dregad, vboctor

What do you think?
1) revert the change or
2) update documentation and have a check in check_email_inc.php for $g_debug_email == OFF

The old logic is a bit confusing, e.g. have a look at 0020679 and

So I tend to say that option 2) is the better one.



2016-03-10 04:31

developer   ~0052735

I like the consistency approach of always using strings introduced by this commit, so I'm also in favor of option 2.

Moving forward...

update the docs


have a check in check_email_inc.php for $g_debug_email == OFF

OK, but to cover 0020679 we need to cover the "ON" case too. However, that should be transitional.

To allow us to eventually remove the extra code in email_send(), I believe we should also add a step in admin checks, to inform admins they need to update their config.



2016-03-10 04:54

developer   ~0052737

OK, but to cover 0020679 we need to cover the "ON" case too
I don't think so, ON did never work, this was just a mistake of the user.



2016-03-10 05:38

developer   ~0052738

Currently the code does

if( !empty( $t_debug_email ) ) {

If instead we did

if( !$t_debug_email ) {

it would cover the case of debug_email = '' as well as OFF (and false too)

To cover the user's case in 0020679 (i.e. facilitate troubleshooting), we could also amend the log event message to indicate we're using the debug e-mail.



2016-03-20 12:26

manager   ~0052808

Let's go with option 2 and get OFF to work. I don't know if this really is worth a check for administrator, so I wouldn't bother with that.



2016-06-04 19:35

manager   ~0053265




2016-06-05 19:02

developer   ~0053270

Following up on my note 0020684:0052738, I added a logging message when using debug email, as originally requested in 0020679.

Related Changesets

MantisBT: master 4235a086

2014-01-06 17:55:53

Paul Richards

Details Diff
1) Always treat debug email address as a string (this makes phpdoc/clients that try to do type checking less confused)

2) Use PHP's own email validation routines (available since php 5.2)
mod - admin/check/check_config_inc.php Diff File
mod - config_defaults_inc.php Diff File
mod - core/email_api.php Diff File
mod - login_page.php Diff File

MantisBT: master 8684dfea

2016-06-04 19:31:28


Details Diff
Update documentation of 'debug_email'

Fixes 0020684
mod - docbook/Admin_Guide/en-US/config/logging.xml Diff File

MantisBT: master 0bb3cfb1

2016-06-05 18:49:47


Details Diff
Enhance logging to show debug email when used

Prior to this, when using an invalid address, user would not see a clear
indication in the log file that the debug email was being used,
resulting in confusion caused by the error message generated by

This commit adds a LOG_EMAIL_VERBOSE entry clearly showing when the
debug email address is used.

Fixes 0020679
mod - core/email_api.php Diff File

Issue History

Date Modified Username Field Change
2016-03-10 03:50 atrol New Issue
2016-03-10 03:52 atrol Relationship added related to 0020679
2016-03-10 03:53 atrol Note Added: 0052733
2016-03-10 04:15 dregad Changeset attached => MantisBT master 4235a086
2016-03-10 04:31 dregad Note Added: 0052735
2016-03-10 04:54 atrol Note Added: 0052737
2016-03-10 05:38 dregad Note Added: 0052738
2016-03-20 12:26 vboctor Note Added: 0052808
2016-03-21 12:15 vboctor Assigned To => atrol
2016-03-21 12:15 vboctor Status new => assigned
2016-06-04 19:35 vboctor Note Added: 0053265
2016-06-04 19:35 vboctor Assigned To atrol => vboctor
2016-06-05 14:42 vboctor Changeset attached => MantisBT master 8684dfea
2016-06-05 14:42 vboctor Status assigned => resolved
2016-06-05 14:42 vboctor Resolution open => fixed
2016-06-05 14:42 vboctor Fixed in Version => 1.3.0-rc.2
2016-06-05 19:02 dregad Note Added: 0053270
2016-06-05 19:02 dregad Changeset attached => MantisBT master 0bb3cfb1
2016-06-12 00:42 vboctor Status resolved => closed