Solving a problem with the Mailwizz cron jobs when using the ISPconfig 3 panel with Jailkit

OptiBiz1

Active Member
I thought I'd share my experiences with the Mailwizz cron jobs when using the ISPconfig3 panel with Jailkit installed.
When installing ISPconfig 3 you can choose if you want to use Jailkit ( http://olivier.sessink.nl/jailkit/ ) or not. This decision comes with something you need to be aware of, the Mailwizz cron jobs won't work without a little tweak in the cron setup. It's easy to fix, but it must be fixed otherwise your sendouts will be paused forever :). I have done this before but I had kind of forgot about it now when I moved from one dedicated server to another yesterday.

When you create the Mailwizz cron jobs they are saved by ISPconfig 3 in /etc/cron.d and they are created like this:

MAILTO=''
SHELL='/usr/sbin/jk_chrootsh'
* * * * * <user> /path/to/php5 -q /path/to/mailwizz/apps/console/console.php send-campaigns >/dev/null 2>&1
.
.
.


this must be changed to

MAILTO=''
SHELL='/bin/sh'

* * * * * <user> /path/to/php5 -q /path/to/mailwizz/apps/console/console.php send-campaigns >/dev/null 2>&1
.
.
.


This is all you need to do.

(one thing of more "cosmetic nature" is that you rename your changed cron jobs from e.g. "ispc_chrooted_web1" to "ispc_web1" since it's not chrooted anymore)
 
Last edited:
PHP:
<?php

$key =  $_GET['key'];
$command = $_GET['command'];

$validCommands = ['send-campaigns', 'send-transactional-emails','feedback-loop-handler', 'bounce-handler', 'process-delivery-and-bounce-log','daily'];

if (!isset($_GET['key']) || ! isset($_GET['command']) || $key != 'my-key' || !in_array($command, $validCommands))
{
 echo "error";
 return;
}

exec('/path/to/php -f /path/to/mailwizz/apps/console/console.php '. $command);
Hi, since we had a similar issue we wanted to share this super simple script that you can place in web root. With this you can trigger cron with HTTP requests with URLs like:

http://www.my-mailwizz.com/cron.php?key=my-key&command=send-campaigns
 
Last edited by a moderator:
I think @twisted1919 meant that it could be used like that. I was actually thinking the same at first. But knowing it should not be run from the browser makes it an alternative to think of.
 
Even if you use the browser triggered send-campaigns,
it will still be object to timeouts, and these timeouts might kick-in more oft for heavy campaigns, so this method is not really reliable and hence rather not an alternative to crons...that is what I read out of the above.

One could try to adjust the load to make all runs light, if there is no way to run a normal cron, but it is not a guarantee for a smooth mwz operation.

Hope that helps.
 
Back
Top