HAH's picture


Having an issue with emails being sent after a MySQL backup has taken place on the WordPress containers. I've tried multiple different email addresses and different versions of the WordPress container with no joy. 

Nothing ever appears in the mail queue, mail log or "/var/log/messages". Email does work from websites that run on the same containers. 

I am using a schedule, the backups do complete OK. I've tried all possible cobinations of options I can think off and now I'm a bit lost since there's nothing to give an indicator. 

Is there anything I need to do differently on the container to get it working? I've got the emails working in other setups ie Debian LAMP stack. 

Any help or pointers will be greatly appriciated.


Jeremy Davis's picture

That sounds like an interesting - albeit annoying issue!

My first question is regarding your backup process. Are you using TKLBAM? Or some other method? You note "MySQL backup" which suggests that it's not a full backup, but just a DB backup?!

My next question is, how is email set up within WordPress itself? Are you using our default config (which uses the locally installed Postfix to send email directly) or are have you configured WordPress to use an alternate SMTP server?

If it's the former, have you configured Postfix to use an SMTP relay as well (e.g. via Confconsole, or manually configured)? If it's the latter, then that may possibly explain things...

I was going to suggest that perhaps there was some issue with the backup itself, but you note that the backup finishes successfully.

Have you tested sending mail directly from the commandline? If so, does that work ok?

HAH's picture

Hi Jeremy, 

I am using the "Backup Databases" utility in "MySQL Database Server". (Just a DB Backup). Wordpress is using the default settings and using Postfix.

Postfix is set to use an SMTP server but it looks like the email for the "Backup Report" is never generated on the server to be sent to the SMTP server.

I just tried sending an email from the command line and this was successful. The email went through the SMTP server OK too. 

The backups are still completing OK on the schedule. 

Is there anything else you would like me to try?

Jeremy Davis's picture

So it sounds like you are essentially generating a mysqldump. Am I right in guessing that that is via Webmin (i.e. via https on port 12321)? Or is it via some other method/interface (e.g. a WordPress plugin? some other software you've installed? etc)?

Either way, it sounds like everything within your server is working as it should, except that the mysqldump process isn't generating an email as you are expecting.

Without knowing more about how you have enabled this DB dump, I can't be sure whether this is a misunderstanding on your part, or a software and/or config bug. I know that when you create a mysqldump via commandline, there is no facility to generate an email (at least not that I am aware of).

If you can clarify the process by which this DB backup was configured and confirm that it is being generated by some software that we are pre-installing, then I could have a closer look and try to see what is going on. If it is being generated by software that we pre-install, then there is a chance that there is some misconfiguration on our behalf. Or perhaps it's a bug in the the software itself?

Whilst we do provide some custom software that we develop ourselves, the only backup tool that we develop and maintain is TKLBAM. Most of the rest of software included in TurnKey appliances we're merely pre-installing and pre-configuring. The code itself is provided by an upstream source; some we package ourselves; such as Webmin, some we install from upstream source such as WordPress, but most of the OS comes directly from Debian.

HAH's picture

Hi Jeremy,

I can confirm that the MySQLDump was configured from within Webmin. Below is an example of the configuration. 

The "command to run before backup" & "command to run after backup" are two script files that create a directory with todays date and move any backup files to them. Nothing that should interfere with the email process. (I have tried it without these scripts and I got the same result.

I hope this clears things up abit. Thanks so far.


Jeremy Davis's picture

Ok thanks for clarifying the issue you're experiencing. That totally clears things up! :)

So I've done a bit of googling and I discovered that this behaviour matches a bug in a previous version of Webmin but has apparently since been fixed.

However, it seems that email must be configured separately within Webmin (see here). I'm not 100% sure, but I don't think that we're pre-configuring that (but really there's no good reason for us not to). So I suggest that you double check that first.

Next up, I found a similar bug report on the Webmin support forums (it was related to Bitnami rather than TurnKey, but that should be irrelevant). The user noted that once they had viewed and manually run the backup task within Webmin's cron job area, that it "just worked". That seems a little weird to me, but probably worth a try...

Other than that, I can only assume that there is some missing config and/or some misconfiguration. Or perhaps it's a reappearance of the above mentioned bug?! It sounds like you've pretty much done everything required (although please double check Webmin's email config), but it may be worth reading through the upstream Webmin MySQL DB backup doc just in case there is something you've missed.

Please let me know how you go. If it remains an issue, I'll walk you through updating Webmin to ensure that the issue still exists with the latest version (we package it ourselves and sometimes lag behind upstream version a bit; although we prioritise updating it when we become aware of security issues). If it remains an issue after updating, we'll open a bug report with upstream (i.e. the Webmin dev). If you can confirm that you need to set up the mail config for Webmin (and then it "just works"), we'll open a TurnKey bug and aim to pre-configure that by default in future releases.

Regardless, good luck with it and thanks for reporting your issue.

Add new comment