简体   繁体   中英

iOS15 blocking images in emails to my customers

I send emails to my iOS and Android app customers from my server, hosted by JustHost. On an iOS15 device, all the images that are hosted on my server are being blocked (no error message, just an empty box). There is nothing malicious in the images, no tracking. I can successfully send images from other domains in my emails - but those same images that I copy to my server are then blocked. I called my hosting company and they had no idea. The emails show up fine in other versions of iOS and everywhere else. I use the img tag in my emails to reference the images, sent using Sendmail in Perl. What do I need to ask JustHost to do to enable my images to be shown in iOS15?

The reason your images are blocked on iOS15 is that the iOS Mail app is using "Mozilla/5.0" (as-is) as its User-Agent to download images from Web servers.

This exact User-Agent triggers the ModSecurity module (which is practically installed by nearly all Web hosts), resulting in a "406 Not Acceptable" response status code. You can verify it by spoofing your Web browser's User-Agent and visiting any URL in your website, whether the URL points to an existing resource or not.

If you have root access to your Web server (which you won't if you are on shared hosting), you can disable a rule in ModSecurity that triggers this. I wouldn't recommend disabling ModSecurity as a whole because it is an excellent module for your server's security.

Another way to circumvent this issue is by setting an ErrorDocument for 406 with a PHP script that sends the image as output, with corresponding HTTP headers of course.

I have the same problem as you, and I have figured it out just today.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM