View Issue Details

IDProjectCategoryView StatusLast Update
0025101mantisbtemailpublic2019-01-20 03:30
Reporterstm_ Assigned Todregad  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionno change required 
Product Version2.18.0 
Summary0025101: Some mails cannot be sent
Description

Password change and account registration mails are not sent. The mails stay in the queue (mantis_email_table). The following message is in the logs:

[Thu Dec 20 10:07:31 2018] [php7:notice] [pid 6526] [client 77.12.89.98] [host eressea.dracones.de] 2018-12-20 10:07 CET MAIL email_api.php:1401 email_send() ERROR: Message could not be sent - Could not instantiate mail function.\n

After updating user information, the corresponding mail /is/ sent, along with the mails in the queue. So this error occurs only for "Password Reset", but not for "Account updated" mails.

I'm using $g_phpMailer_method = PHPMAILER_METHOD_MAIL;

Steps To Reproduce
  • Go to user adminstration screen (using admin account)
  • Reset a user's password (results in mailer error)
  • Go back to user adminstration
  • change user details, leave notify user box checked
  • both mails are sent
TagsNo tags attached.
Attached Files

Activities

atrol

atrol

2018-12-21 02:44

developer   ~0061089

stm_,

I was not able to reproduce your problem (tried on Ubuntu 16.04 using PHP 7.0.32-0ubuntu0.16.04.1)

The following additional information may be useful:

  • Exact version of PHP, Database, Web server, Browser and Operating System
  • Relevant customizations (e.g. changes in config_inc.php, etc)
  • Installed plugins or custom functions ?
  • Was the MantisBT source code modified in any way ?
stm_

stm_

2018-12-24 09:20

reporter   ~0061094

Let's see ... It's a Hosteurope Webhosting Site.
Linux wp152 4.4.74-1-xenu-static-he+1+
Apache 2.0
PHP 7.2.13-he.0
mysql server 5.6.40-84.0-log
Browser was Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:64.0) Gecko/20100101 Firefox/64.0
Nothing special in the config and straight mantis-2.18, though the database was upgraded recently from Mantis 1.2.something.

Happy to provide further information.

config_inc.php (3,420 bytes)   
<?php
# MantisBT - A PHP based bugtracking system

# MantisBT is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# MantisBT is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with MantisBT.  If not, see <http://www.gnu.org/licenses/>.

/**
 * @package MantisBT
 * @copyright Copyright (C) 2000 - 2002  Kenzaburo Ito - kenito@300baud.org
 * @copyright Copyright (C) 2002 MantisBT Team - mantisbt-dev@lists.sourceforge.net
 * @link http://www.mantisbt.org
 */

# 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 uncommenting the config option
# and setting its value in this file.

# Rename this file to config_inc.php after configuration.

# 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://www.mantisbt.org/docs/ or config_defaults_inc.php for more
# detailed comments.

# --- Database Configuration ---
	$g_hostname = 'localhost';
	$g_db_username = 'user';
	$g_db_password = 'pw';
	$g_database_name = 'db-mbugs';
$g_db_type       = 'mysqli';

# --- Security ---
$g_crypto_master_salt = 'sss';	#  Random string of at least 16 chars, unique to the installation

# --- Anonymous Access / Signup ---
$g_allow_signup				= ON;
$g_allow_anonymous_login	= ON;
$g_anonymous_account		= 'Anonymous';

# --- Email Configuration ---
$g_phpMailer_method		= PHPMAILER_METHOD_MAIL; # or PHPMAILER_METHOD_SMTP, PHPMAILER_METHOD_SENDMAIL
$g_smtp_host			= 'localhost';			# used with PHPMAILER_METHOD_SMTP
$g_smtp_username		= '';					# used with PHPMAILER_METHOD_SMTP
$g_smtp_password		= '';					# used with PHPMAILER_METHOD_SMTP
$g_webmaster_email      = 'webmaster@example.de';
$g_from_email           = 'noreply@example.de';	# the "From: " field in emails
$g_return_path_email    = 'webmaster@example.de';	# the return address for bounced mail
# $g_from_name			= 'M Mantis Bug Tracker';
# $g_email_receive_own	= OFF;
$g_email_send_using_cronjob = OFF;
$g_log_level =LOG_EMAIL;

# --- Attachments / File Uploads ---
# $g_allow_file_upload	= ON;
# $g_file_upload_method	= DATABASE; # or DISK
# $g_absolute_path_default_upload_folder = ''; # used with DISK, must contain trailing \ or /.
# $g_max_file_size		= 5000000;	# in bytes
# $g_preview_attachments_inline_max_size = 256 * 1024;
# $g_allowed_files		= '';		# extensions comma separated, e.g. 'php,html,java,exe,pl'
# $g_disallowed_files		= '';		# extensions comma separated

# --- Branding ---
$g_window_title			= 'M Bugtracker';
$g_search_title                 = 'Mb';
# $g_logo_image			= 'images/mantis_logo.png';
# $g_favicon_image		= 'images/favicon.ico';

# --- Real names ---
# $g_show_realname = OFF;
# $g_show_user_realname_threshold = NOBODY;	# Set to access level (e.g. VIEWER, REPORTER, DEVELOPER, MANAGER, etc)

# --- Others ---
# $g_default_home_page = 'my_view_page.php';	# Set to name of page to go to after login
config_inc.php (3,420 bytes)   
dregad

dregad

2018-12-25 04:13

developer   ~0061095

MantisBT is not the origin of this error, it just reports it. It is in fact triggered by PHPMailer, and is caused by how you (or your hosting provider) configured e-mail.

https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting may help (there's even a section related to the error message you reported).

In any case, this is not a MantisBT error, so I'm going to close this issue.

stm_

stm_

2019-01-03 12:47

reporter   ~0061142

You are more or less right. The error is probably caused by some kind of server configuration. I could not find out what exactly prevents it from executing correctly, but it only occurs when it's called from email_shutdown_function(). The error message, according to my hosting provider, is "550: Could not determine home-directory for user (ec:19)". The reason appears to be that this function is called with '/' as working directory, where normally it would be '/var/www/mantisbt' or whatever. I don't know how widespread this problem might be, but it might be a good idea to add
chdir(dirname(FILE));
in email_shutdown_function() (core/email_api.php), which fixed it in my case.

atrol

atrol

2019-01-03 15:41

developer   ~0061143

@stm_ could you please try latest version 2.19.0 ?
I am asking as we have a major upgrade of the underlying PHPMailer library in it, which might include some fixes related to newer PHP versions, see 0024990.

stm_

stm_

2019-01-04 04:07

reporter   ~0061144

Yes, same error, same fix with 2.19.