Page 1 of 2

Mantis taking too long to submit a new case

Posted: Aug 16, 2012 6:06 pm
by admin@mantis
Hello everyone, I don't normally post on forums or newsgroups and i believe this is my first time posting here. I've been having this problem with Mantis for more than 3 months now and I can't figure out how to solve it, I've researched the web hundreds of times, read Mantis documentation, forums, articles but still no luck.

The problem I'm having is that whenever a user submits a new case, it takes approximately a minute and a half for the page to refresh and display succesfull submission of the case. The other users receive emails notification almost instantly, so it's not a problem with sending email notification but with the time it takes to submit the new case. This is definitely an issue with my email settings because if I turn off Email notifications cases are submitted instantly (the page refreshes within a second).

This also occurs when a user make changes or edit cases that require Mantis to send email notifications, it also takes 1-2 minutes for the page to refresh. I've check my php settings and everything looks fine, I also increased some PHP values, but no luck. I also checked if Sendmail was working properly, sent a couple emails from command line (using Sendmail) and they go through instantly everytime. Also worth mentioning that if users perform actions that do not require Mantis to send email notifications the page refreshes instantly.

I was wondering if there is some value that I have to increase within my Sendmail/server settings, or something that can point me to the right direction! Thanks for your time in advance.

I'm running Mantis on CentOS 5.8
Mantis Version 1.2.10
PHP 5.3.15
Sendmail 8.13.8

Re: Mantis taking too long to submit a new case

Posted: Aug 17, 2012 1:55 am
by atrol
Check database table mantis_email_table.
Is it empty or does it contain entries?

Re: Mantis taking too long to submit a new case

Posted: Aug 17, 2012 10:14 am
by admin@mantis
Hi atrol,

I checked database table "mantis_email_table" and it's empty. Result of MySQl was "MySQL returned an empty result set (i.e. zero rows). (Query took 0.0001 sec)"

Re: Mantis taking too long to submit a new case

Posted: Aug 17, 2012 10:24 am
by atrol
As a workaround you can send asynchronous by setting

Code: Select all

$g_email_send_using_cronjob = ON;
http://www.mantisbt.org/wiki/doku.php/m ... il_queuing

Re: Mantis taking too long to submit a new case

Posted: Aug 17, 2012 10:54 am
by admin@mantis
I changed that value to $g_email_send_using_cronjob = ON; Now, I'd like to set the cronjob to every five minutes, but what file is to be executed with the cronjob? I looked for /mantis/core/send_emails.php but that file doesn't exist. I only see "/core/email_api.php" and "/core/email_queue_api.php". I'm assuming it's email_queue_api.php but I just want to make sure. Thanks

Re: Mantis taking too long to submit a new case

Posted: Aug 17, 2012 11:36 am
by atrol
Read the doc how to setup the job (chapter "Sending the Emails")
http://www.mantisbt.org/wiki/doku.php/m ... the_emails
The script is in directory scripts.

Re: Mantis taking too long to submit a new case

Posted: Aug 17, 2012 12:37 pm
by admin@mantis
Thanks for the info, I followed all the steps and now the page refreshes instantly when submitting a new case, but now users do not get email notifications. I setup an email alert for that cronjob and it says:

PHP Warning: Module 'imap' already loaded in Unknown on line 0
Sending emails...
Done.

Re: Mantis taking too long to submit a new case

Posted: Aug 17, 2012 1:16 pm
by admin@mantis
Never mind! Emails are being sent normally and the page refreshes almost instantly! I submitted an issue and was waiting for email notification but my configuration doesn't send emails to users that submit the issue so I was waiting for an email that was never supposed to get to me in the first place, what an idiot :lol: I checked with other users and everyone is receiving emails!

Thank you so much for your help atrol, I really appreciate your time and your patience!

Re: Mantis taking too long to submit a new case

Posted: May 20, 2019 2:47 pm
by haseebraza
Hi,
I got same. i have changed value of $g_email_send_using_cronjob = ON; but did not understand how to execute this command
php /path/to/mantis/scripts/send_emails.php and where to write this thing
Minute = *, Hour = *, Day = *, Month = *, Weekday = * ???
Can you please help me ?

i am using Cnetos 7
Mantis 2.20
Mariadb 10.0

Re: Mantis taking too long to submit a new case

Posted: May 20, 2019 3:44 pm
by atrol
haseebraza wrote:
May 20, 2019 2:47 pm
I got same.
Did you check the same?
atrol wrote:
Aug 17, 2012 1:55 am
Check database table mantis_email_table.
Is it empty or does it contain entries?

Re: Mantis taking too long to submit a new case

Posted: May 21, 2019 1:59 pm
by haseebraza
it is empty when i set cronjob to OFF;
but when i set cronjob to ON table contains to many emails for sending,
remember that i have not configured following things yet.

1::::::::::php /path/to/mantis/scripts/send_emails.php
2::::::::::Minute = *, Hour = *, Day = *, Month = *, Weekday = *

Re: Mantis taking too long to submit a new case

Posted: May 22, 2019 12:08 pm
by atrol
@haseebraza I am not sure if I understand what you are asking for.
Might help some way http://lmgtfy.com/?q=cron+centos

Re: Mantis taking too long to submit a new case

Posted: May 30, 2019 7:35 pm
by haseebraza
Dear Atrol,
I followed these instruction but emails are not sending by cronjob.
http://www.mantisbt.org/wiki/doku.php/m ... il_queuing

I did following steps :
1: email_send_using_cronjob= ON;
2: * * * * * php /var/www/html/mantis/core/email_queue_api.php
3: restarted httpd

cronjob is working after every minute but emails are stucked in the mantis_email_table;
can you please help?

Re: Mantis taking too long to submit a new case

Posted: May 31, 2019 8:54 am
by atrol
haseebraza wrote:
May 21, 2019 1:59 pm
it is empty when i set cronjob to OFF;
Does it mean that email was working with this setting?

Independant from that, check your PHP logs for errors and warnings.

Re: Mantis taking too long to submit a new case

Posted: May 31, 2019 7:13 pm
by haseebraza
Yes emails were working when cronjob was off but when i set to use cronjob emails are not moving they are stacked in the database table.