Checking E-Mail health

General discussion of Mantis.

Moderators: Developer, Contributor

Post Reply
GeroldK
Posts: 14
Joined: 30 Jul 2009, 12:12

Checking E-Mail health

Post by GeroldK »

I have configured async e-Mail notification running every 5 minutes.We recently had some issues where Mantis E-Mail notification would not work. The reasons were beyond Mantis (e.g. someone changed a password and didn't think of the consequences). Took 5 days to realize why bugtracking was so silent.

To avoid this, I would like to implement a daily Keepalive E-Mail. Now, to write a PowerShell script that sends an E-Mail from the server Mantis is running on takes me 5 mins, but leaves me unsatisfied
as this is only checking basic E-Mail function while Mantis is bypassed.

What I would like to do is - from a scheduled task - (without violating the integrity of the Mantis database) insert a corresponding record into the 'mantis_email_table' and off you go.

My question(s):

1. Is there a php module in Mantis that allows me to create an arbitrary mail? I'd prefer standard interfaces like this one.
2. If not, is there any conceivable problem in inserting such a record 'by hand' and have 'send_emails.php' do its work?

Thanks for the effort,

/Gerold
GeroldK
Posts: 14
Joined: 30 Jul 2009, 12:12

Re: Checking E-Mail health

Post by GeroldK »

Impatient as I am, I implemented a scheduled task which does the folllowing in mysql.exe

insert into mantis_email_table (email, subject, body,submitted, metadata) VALUES ('support@xxxxx.yy', 'Keepalive E-Mail from XXX Bugtracker', 'E-Mail Notification is functioning', 1, '') ;
quit

Ugly, but as long as I do not get any objections I have this in production running.

/Gerold
atrol
Site Admin
Posts: 8539
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Checking E-Mail health

Post by atrol »

There is a small weakness using your approach: You will get no email if no one is working with MantisBT and you did not set up to send email by cron job.
($g_email_send_using_cronjob = ON)

Read the instructions at http://www.mantisbt.org/wiki/doku.php/m ... il_queuing

Make a copy of send_emails.php and add the following line before email_send_all is called
email_store( "Recipient-Address", "YourSubject", "YourMessage");

Add a daily job to run your script.
Please use Search before posting and read the Manual
GeroldK
Posts: 14
Joined: 30 Jul 2009, 12:12

Re: Checking E-Mail health

Post by GeroldK »

Thank you. I have the sebd_emails.php implemented (that's what I meant with async notification).
I implemented your suggestion which I prefer. It works fine.

Thanks again,

/Gerold K
alijabeth

Re: Checking E-Mail health

Post by alijabeth »

atrol wrote:There is a small weakness using your approach: You will get no email if no one is working with MantisBT and you did not set up to send email by cron job.
($g_email_send_using_cronjob = ON)

Read the instructions at http://www.mantisbt.org/wiki/doku.php/m ... il_queuing

Make a copy of send_emails.php and add the following line before email_send_all is called
email_store( "Recipient-Address", "YourSubject", "YourMessage");

Add a daily job to run your script.
Thank you for you great tips :)
Post Reply