Open nate-allen opened 1 year ago
Adding plugin to the denylist in the short term. If this issue turns up a better solution, feel free to remove it as needed.
The mailer options are saved in the {prefix_}mailpoet_settings
table.
You can force the mailer to use PHP by setting
smtp_provider
= server
.mta
you need to set the method
value as PHPMail
a:14:{s:22:"mailpoet_api_key_state";a:3:{s:18:"access_restriction";s:0:"";s:4:"data";a:1:{s:11:"is_approved";s:5:"false";}s:5:"state";s:11:"check_error";}s:14:"authentication";s:1:"1";s:10:"encryption";s:0:"";s:8:"password";s:3:"pgq";s:5:"login";s:2:"gq";s:7:"api_key";s:0:"";s:10:"secret_key";s:0:"";s:10:"access_key";s:0:"";s:6:"region";s:9:"us-east-1";s:4:"port";s:4:"2424";s:4:"host";s:14:"smtp.null.void";s:16:"mailpoet_api_key";s:0:"";s:9:"frequency";a:2:{s:8:"interval";s:1:"5";s:6:"emails";s:2:"25";}s:6:"method";s:7:"PHPMail";}
...
Array
(
[mailpoet_api_key_state] => Array
(
[access_restriction] =>
[data] => Array
(
[is_approved] => false
)
[state] => check_error
)
[authentication] => 1
[encryption] =>
[password] => pgq
[login] => gq
[api_key] =>
[secret_key] =>
[access_key] =>
[region] => us-east-1
[port] => 2424
[host] => smtp.null.void
[mailpoet_api_key] =>
[frequency] => Array
(
[interval] => 5
[emails] => 25
)
[method] => PHPMail
)
PHPMail
is the only change needed.There is another DB key called web_host
, this can be set to manual
(probably no needed)
Or you can set fake SMTP using
smtp_provider
= manual
mta
you will need to update
host
as some fake hostport
as some fake portlogin
as some fake usernamepassword
as some fake passwordmethod
as SMTP
a:14:{s:22:"mailpoet_api_key_state";a:3:{s:18:"access_restriction";s:0:"";s:4:"data";a:1:{s:11:"is_approved";s:5:"false";}s:5:"state";s:11:"check_error";}s:14:"authentication";s:1:"1";s:10:"encryption";s:0:"";s:8:"password";s:3:"pgq";s:5:"login";s:2:"gq";s:7:"api_key";s:0:"";s:10:"secret_key";s:0:"";s:10:"access_key";s:0:"";s:6:"region";s:9:"us-east-1";s:4:"port";s:4:"2424";s:4:"host";s:14:"smtp.null.void";s:16:"mailpoet_api_key";s:0:"";s:9:"frequency";a:2:{s:8:"interval";s:1:"5";s:6:"emails";s:2:"25";}s:6:"method";s:4:"SMTP";}
...
Array
(
[mailpoet_api_key_state] => Array
(
[access_restriction] =>
[data] => Array
(
[is_approved] => false
)
[state] => check_error
)
[authentication] => 1 [encryption] => [password] => pgq <<== [login] => gq <<== [api_key] => [secret_key] => [access_key] => [region] => us-east-1 [port] => 2424 <<== [host] => smtp.null.void <<== [mailpoet_api_key] => [frequency] => Array ( [interval] => 5 [emails] => 25 )
[method] => SMTP <<== )
I wasn't aware of that hook solution.
I approached a similar problem by loading the PHPMailer class early and replacing it with a subclass of my own where I overrode the send method.
Didn't really test it much.
It looks like MailPoet can be setup to send emails without using wp_mail. Look into how it does send email, and if we can disable that feature. If not, we may need to add the plugin to the deny list.