Problem with email notifications

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
kofoster
Posts: 5
Joined: 14 Jan 2014, 21:13

Problem with email notifications

Post by kofoster »

Installed MantisBT 1.2.15 in two different places - one on a subdomain on GoDaddy and the other locally on a QNAP NAS. Both are exhibiting the same problem. I haven't included any email statements in my config_inc.php file so I am assuming the default values, from config_defaults_inc.php, are being used.

On both installs, which I started testing this morning, initially email notifications were received for both creating new users and creating new issues. This afternoon, when I came back to testing, creating new users will generate a notification email but creating a new issue or updating an issue will not.

I have seen other forum entries about email not working at all but has anyone seen this particular issue and have a fix/workaround for it?

Thanks.
atrol
Site Admin
Posts: 8366
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Problem with email notifications

Post by atrol »

Check database table mantis_email_table.
There is a problem sending the emails if there are entries in it.
If it's empty MantisBT was able to sent (at least got no error return value).
Maybe the emails got marked as spam on their way to the recipient or on your email client.
Please use Search before posting and read the Manual
kofoster
Posts: 5
Joined: 14 Jan 2014, 21:13

Re: Problem with email notifications

Post by kofoster »

Check database table mantis_email_table.
There is a problem sending the emails if there are entries in it.
If it's empty MantisBT was able to sent (at least got no error return value).
Maybe the emails got marked as spam on their way to the recipient or on your email client.
On both databases, the mantis_email_table is empty. I am thinking it is safe to assume, then, that the emails have been sent. Is there anywhere in MantisBT where a log of emails sent/not sent is stored? I checked the junk/spam folders on the email clients but I don't see the missing mails there.

Any idea why the user creation emails still come through?
atrol
Site Admin
Posts: 8366
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Problem with email notifications

Post by atrol »

kofoster wrote: Any idea why the user creation emails still come through?
Maybe they don't fit the rule that might mark the other mails as spam.
This seems to be no problem of MantisBT and no problem of your email client, but a problem of your email server.
Please use Search before posting and read the Manual
kofoster
Posts: 5
Joined: 14 Jan 2014, 21:13

Re: Problem with email notifications

Post by kofoster »

I made some changes and there has been some progress. The change that made the most difference was that I added the statement "$g_enable_email_notification = ON;" to the config_inc.php file on both installs, first one and then the other. The effect was the same on both - now I am seeing notifications for assignment of issues and addition of notes and reminders to issues. There still isn't, however, any email notifications being sent when an issue is created.

I am not sure why adding the statement is making this difference since "$g_enable_email_notification = ON;" is supposed to be the default in the config_defaults_inc.php file. Could the problem be in this version of MantisBT or in the mailer package being used? There is another recent posting on this forum (http://www.mantisbt.org/forums/viewtopi ... =3&t=21916) that seems to suggest that there are issues with phpmailer 5.2.1, which is bundled in with MantisBT 1.2.15. The poster said they upgraded to phpmailer 5.2.4 and the problem went away. Someone else also posted that the next version of MantisBT (1.2.16) will bundle in phpmailer 5.2.6.
atrol
Site Admin
Posts: 8366
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Problem with email notifications

Post by atrol »

kofoster wrote:There still isn't, however, any email notifications being sent when an issue is created.
Do you assign the issue when it's created?
If not, who should receive the email?
kofoster wrote:I am not sure why adding the statement is making this difference since "$g_enable_email_notification = ON;" is supposed to be the default in the config_defaults_inc.php file. Could the problem be in this version of MantisBT or in the mailer package being used?
No, if this would be the problem you would get no email. Hard to believe that $g_enable_email_notification = ON; in config_inc.php changed anything. Did you double check that config_defaults_inc.php is the original one from MantisBT 1.2.15 and contains nothing more than exactly one assignment of $g_enable_email_notification = ON; ? Maybe someone added a second one with OFF ?
Please use Search before posting and read the Manual
kofoster
Posts: 5
Joined: 14 Jan 2014, 21:13

Re: Problem with email notifications

Post by kofoster »

I decided to start again from scratch so made a new install of MantisBT 1.2.15. I wasn't sure in what way the configuration changes I had made were affecting how Mantis was operating, hence the new install. I made no changes to the config_inc.php file. I added a project, a reporter user and a developer one. Emails were sent out for both user creations. I then used the reporter profile to create a new issue. No emails were sent but, after checking the manual again, it seems, out of the box, MantisBT is set up to not send any emails on issue creation. When I assign the issue or add notes to it, emails are sent to the respective users. So I am assuming, despite my own misunderstanding, that MantisBT is working as designed.

What I want is for someone, say a manager or developer or even the administrator, to be notified when a new issue is created. What configuration changes must I make to accomplish that?
atrol
Site Admin
Posts: 8366
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Problem with email notifications

Post by atrol »

kofoster wrote:No emails were sent but, after checking the manual again, it seems, out of the box, MantisBT is set up to not send any emails on issue creation.
That's why I asked: Do you assign the issue when it's created?
If not, who should receive the email?

Goto page Manage > Manage Configuration > E-mail Notifications
Enable the checkboxes In row "Status changes to 'new'" for the access levels you want.
Please use Search before posting and read the Manual
kofoster
Posts: 5
Joined: 14 Jan 2014, 21:13

Re: Problem with email notifications

Post by kofoster »

That worked. Thanks for your help.

One additional question. Is there any way be more granular with this? What I would like to do is assign a different manager level user to each project and have each receive email notifications only for new issues created in their project(s).

Update: I made the settings, to send emails to manager assigned to the project on new issue creation, at the project level instead of at the global level and it seems to be working the way I want it to - send new issue email notification to manager level user assigned to the particular project and not to any other manager level user. Is this the correct configuration?

Once again thanks for helping me resolve, what turned out to be, my own misunderstanding.
atrol
Site Admin
Posts: 8366
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Problem with email notifications

Post by atrol »

kofoster wrote:Is this the correct configuration?
Yes
Please use Search before posting and read the Manual
Bitmann
Posts: 1
Joined: 16 Mar 2018, 14:27

Re: Problem with email notifications

Post by Bitmann »

If anyone still faces issue or error while configuration add log level so that you can drill down the problem further. Below settings worked for me. Detailed explanation is written here
$g_phpMailer_method = PHPMAILER_METHOD_SMTP;
$g_administrator_email = 'your-admin-email@gmail.com';
$g_webmaster_email = 'your-webmaster-email@gmail.com';
$g_return_path_email = 'your-return-email@gmail.com';
$g_from_email = 'your-from-email@gmail.com';

$g_smtp_host = 'smtp.gmail.com';
$g_smtp_port = 465;
$g_smtp_connection_mode = 'ssl';
$g_smtp_username = 'username';
$g_smtp_password = 'password';

$g_log_level = LOG_EMAIL | LOG_EMAIL_RECIPIENT;
$g_log_destination = 'file:/var/log/mantisbt.log';

$g_validate_email = OFF;
Post Reply