Email notifications not being sent

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
acoder2020
Posts: 66
Joined: 11 Jan 2024, 19:32

Email notifications not being sent

Post by acoder2020 »

Emails appear to have stopped and I'm unsure why. When they were working a few days ago, it was set up the same - to use the built in mail function in linux. I am able to send mail from this same server from command prompt with the mail command.

I installed a fresh copy of 2.26.1 (without setting up HTML Email). Here's the config file from that:

Code: Select all

<?php
$g_hostname               = 'localhost';
$g_db_type                = 'mysqli';
$g_database_name          = 'bugtracker';
$g_db_username            = 'dbusername';
$g_db_password            = 'somepassword';

$g_default_timezone       = 'America/New_York';
$g_crypto_master_salt     = 'salthere';
$g_path                   = 'https://mantis.example.com/';

$g_log_level = LOG_EMAIL | LOG_EMAIL_RECIPIENT;
$g_log_destination = 'file:/data/www/mantis/log/mantisbt.log';
?>
Here's the resulting log file from when edits were made to a ticket that U19 is configured to receive notifications for

Code: Select all

[acoder@box mantis]# cat log/mantisbt.log 
2024-04-11 15:09 EDT MAIL email_api.php:1084 email_bugnote_add() Note ~6661 added to issue #1935
2024-04-11 15:09 EDT RECIPIENT email_api.php:302 email_collect_recipients() Issue = #1935, add @U19 (reporter)
2024-04-11 15:09 EDT RECIPIENT email_api.php:312 email_collect_recipients() Issue = #1935, add @U19 (handler)
2024-04-11 15:09 EDT RECIPIENT email_api.php:330 email_collect_recipients() Issue = #1935, add @U17 (monitoring)
2024-04-11 15:09 EDT RECIPIENT email_api.php:359 email_collect_recipients() Issue = #1935, add @U19 (note author)
2024-04-11 15:09 EDT RECIPIENT email_api.php:446 email_collect_recipients() Issue = #1935, drop @U19 (own action)
2024-04-11 15:09 EDT RECIPIENT email_api.php:470 email_collect_recipients() Issue = #1935, drop @U17 (pref threshold)
2024-04-11 15:20 EDT MAIL email_api.php:1037 email_bug_added() Issue #1976 reported
2024-04-11 15:20 EDT RECIPIENT email_api.php:302 email_collect_recipients() Issue = #1976, add @U19 (reporter)
2024-04-11 15:20 EDT RECIPIENT email_api.php:312 email_collect_recipients() Issue = #1976, add @U19 (handler)
2024-04-11 15:20 EDT RECIPIENT email_api.php:446 email_collect_recipients() Issue = #1976, drop @U19 (own action)
My user account is configured to receive emails:
Screenshot from 2024-04-11 15-25-49.png
Screenshot from 2024-04-11 15-25-49.png (123.84 KiB) Viewed 166 times
The system is configured to send emails as below:
Screenshot from 2024-04-11 15-25-49.png
Screenshot from 2024-04-11 15-25-49.png (123.84 KiB) Viewed 166 times
I'm not seeing any emails being sent out per /var/log/maillog
Attachments
Screenshot from 2024-04-11 15-26-55.png
Screenshot from 2024-04-11 15-26-55.png (87.67 KiB) Viewed 166 times
acoder2020
Posts: 66
Joined: 11 Jan 2024, 19:32

Re: Email notifications not being sent

Post by acoder2020 »

I'm curious what this means

2024-04-11 15:09 EDT RECIPIENT email_api.php:446 email_collect_recipients() Issue = #1935, drop @U19 (own action)


Did a little exploring and found this:

Code: Select all

if( ( auth_get_current_user_id() == $t_id ) && ( OFF == config_get( 'email_receive_own' ) ) ) {
    log_event( LOG_EMAIL_RECIPIENT, 'Issue = #%d, drop @U%d (own action)', $p_bug_id, $t_id );
    continue;
}
Now to find where email_receive_own is set.
acoder2020
Posts: 66
Joined: 11 Jan 2024, 19:32

Re: Email notifications not being sent

Post by acoder2020 »

and there it is:

Code: Select all

$g_email_receive_own

    This defines whether users should receive emails for their own actions. This option is defaulted to OFF, hence, users do not receive email notification for their own actions. This can be a source for confusions for users upgrading from MantisBT 0.17.x versions, since in these versions users used to get notified of their own actions. 
acoder2020
Posts: 66
Joined: 11 Jan 2024, 19:32

Re: Email notifications not being sent

Post by acoder2020 »

resolved, thanks.
Post Reply