Some hosts do perform intentional misconfiguration of the mail function, causing it not to work.
When the mail function is misconfigured, we can still access and execute the mail function from within the codebase, but we get an error.
There’s no accurate way to know the PHP mail function is misconfigured. Unless we execute the function with all the proper parameters and check the exception error message against this error `Could not instantiate mail function.`
MAILPOET-4760
We don't want to run any actions during migrations.
This will also clean duplicate trigger actions
that were potentially created because of requests race conditions.
[MAILPOET-4684]
This was causing flakiness of acceptance test ReinstallFromScratchCest.php:reinstallFromScratch
and also potential issue for production.
In Activator::deactivate we remove MailPoet's DB tables. This takes some time.
In case there is another request during the deletion it may detect some tables are missing and trigger activation
and we end up creating MailPoet tables and removing them at the same time.
This commit adds locking to deactivate method so that any other attempt for activation ends up with an error.
[MAILPOET-4274]