admin管理员组文章数量:1291197
I've been trying to track down why my s3 bucket files are no longer being attached to automated emails being sent out by WordPress (using the Gravity Forms Entry Automation plugin).
I've been able to identify the latest version of PHPMailer being the reason why the attachments no longer get added. From the PHPMailer ticket response:
This is due to a bug fix that also closed a major security hole. PHPMailer deliberately avoids being a client for HTTP or other protocols for file attachments because it is far too risky. The solution is to take on responsibility for fetching remote files yourself.
Instead of:
$mail->addAttachment('s3://file.txt', 'file.txt');
Do this:
$mail->addStringAttachment(file_get_contents('s3://file.txt'), 'file.txt');
I reached out to the Gravity Forms authors as well as the Entry Automation authors and they both have said their plugins just generate raw notification objects and then use wp_mail() to pass the generated mail object off to the rest of my server to actually handle the sending.
Is there a way to get this working again without having to roll my WP version back? Or do y'all know how others are handling this issue?
One option would be to try to use the phpmailer_init hook, but I can't quite figure out how to do this to force using addStringAttachment.
Any suggestions? I'm kind of in a bind because the files that get attach must remain on S3 and not the local file system.
Core ticket submitted here
本文标签:
版权声明:本文标题:core - No longer able to attach S3 bucket files to emails being sent by WordPress due to PHPMailer security update 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741500813a2382046.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论