电子邮件缩略图网址已更改为gmail中的googleusercontent.com [英] Email thumbnail URL changed to googleusercontent.com in gmail

查看:117
本文介绍了电子邮件缩略图网址已更改为gmail中的googleusercontent.com的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个系统,每当用户上传图片时,它就会向注册用户的gmail发送一封电子邮件.但是在电子邮件中,我看到了类似这样的内容,无法查看缩略图.

我检查了元素,发现链接到此URL的src: https://ci5.googleusercontent.com/proxy/VI2cPXWhfKZEIarh-iyKNz1j9q7Ymh8ty4Yz19lXh82RjSlACBzS0aRajfIj913uXAsX2ylcLEDs5FBsj4cR9TcU75Pw5djdHx4htxdCAQxs_ue1Q1wi5TV43uLLBpigpjH1xN747mUHSRdTBJmXQWFyykInJCRXicM1KhNk=s0-d-e1-ft#https://www.somedomain.com/files/1658/thumbnail_71JtDozxS1L._SY450_.jpg

很明显它正在被Google代理缓存

但是我可以通过访问https://www.somedomain.com/files/1658/thumbnail_71JtDozxS1L._SY450_.jpg来查看没有Google用户内容的图像(我屏蔽了域,因此您可能无法使用该图像).

我试图清除浏览器缓存,但问题仍然存在.我该如何绕过googleusercontent或至少使缩略图能够显示.

我在此链接上结帐未显示Gmail图像,但未使用本地主机而且图像本身可以在我的本地网络之外访问.

解决方案

Google图片代理如何工作

Google Image Proxy是一个缓存代理服务器.每当电子邮件中包含图片链接时,请求都会先转到Google图片代理,以查看它是否已缓存,如果已缓存,则应从代理中提供该图片,否则将其提取并缓存在那里. /p>

大多数问题的解决方案

如果出现以下图像,Google图像代理服务器将获取您的图像:

  • 仅具有.png.jpg/.jpeg.gif之类的扩展名.也可能是.webp.但不是 .svg .
  • 请勿在图像URL中使用任何类型的查询字符串部分,例如?id=123
  • 具有一个直接映射到图像的URL.
  • 名字不长.

图像服务器要求:

  • 图像服务器/代理服务器的响应必须包含正确的标头,例如Content-Type: image/jpeg.
  • 文件扩展名和content-type标头必须为同一类型.
  • 服务器响应中的状态码必须为200,而不是403、500等.

还有什么可以帮忙的?

Google支持解答:

设置图像URL代理白名单

当您的用户打开电子邮件时,Gmail使用Google的安全代理 服务器提供可能包含在这些消息中的图像.这 保护您的用户和域免受基于图像的安全性 漏洞.

由于使用了图像代理,因此链接到依赖于 内部IP,有时会破坏cookie.图片网址代理 白名单设置可让您通过创建白名单来避免断开指向图像的链接 并维护将绕过代理的内部URL的白名单 保护.

在配置图像URL代理白名单时,您可以指定一个 域集和可用于指定大域的路径前缀 网址组.有关示例,请参见下面的指南.

配置图像URL代理白名单设置:

  • 登录到您的管理控制台审核日志下跟踪以前的更改.

    应用图片网址代理白名单设置的指南

    安全注意事项

    在配置图像URL代理之前,请咨询您的安全团队. 白名单设置.绕过图像代理白名单的决定 保护可能会使您的用户和域面临安全风险(如果没有的话) 小心使用.

    通常,如果您的域需要通过Cookie进行身份验证, 并且该域是否由您内部的管理员控制 组织,并且受到完全信任,然后将该URL列入白名单 不应使您的域遭受基于图像的攻击.<​​/p>

    重要:不建议禁用图像代理.此选项可为管理员提供灵活性,但是 禁用图像代理可能会使您的用户容易受到恶意攻击 攻击.

    输入图片网址格式

    维护将绕过代理的内部URL的白名单 保护,请在图片网址代理中输入图片网址格式 白名单设置.匹配的URL将绕过图片代理.

    模式可以包含方案,域和路径.图案 域和之间必须始终存在正斜杠(/) 小路.如果网址格式指定了方案,则该方案和 域必须完全匹配.否则,该域可以部分匹配 URL后缀.例如,模式google.com匹配 www.google.com,但不是gle.com.网址格式可以指定一个 与路径前缀匹配的路径.

    重要:输入图像网址格式时,请输入您的实际域名.始终在末尾加上斜杠(/). 域名.

    图片网址格式示例

    以下模式仅是示例.以下模式:

    http://rule_fixed_scheme_domain.com/
    rule_flex_scheme_domain.com/
    rule_fixed_subpath.com/cgi-bin/
    

    ...将匹配以下URL:

    http://rule_fixed_scheme_domain.com/
    http://rule_fixed_scheme_domain.com/test.jpg?foo=bar#frag
    http://rule_fixed_scheme_domain.com
    rule_flex_scheme_domain.com/
    t.rule_flex_scheme_domain.com/test.jpg
    http://t.rule_flex_scheme_domain.com/test.jpg
    https://t.rule_flex_scheme_domain.com/test.jpg
    http://rule_fixed_subpath.com/cgi-bin/
    http://rule_fixed_subpath.com/cgi-bin/people
    

    注意:URL方案(http://)是可选的.如果省略方案,则模式可以匹配任何方案,并允许部分匹配 在域后缀上.

    预览图像URL模式

    单击预览,以查看URL是否与图像URL模式匹配 你已经设定了.如果图片网址与格式匹配,则会看到一个 确认消息.如果图片网址不匹配,则报错 消息出现.

I have a system whenever user upload an image, it will send an email to the registered user's gmail. But in the email, i see something like this, the thumbnail is not viewable.

I inspect on the element, and found the src linked to this url: https://ci5.googleusercontent.com/proxy/VI2cPXWhfKZEIarh-iyKNz1j9q7Ymh8ty4Yz19lXh82RjSlACBzS0aRajfIj913uXAsX2ylcLEDs5FBsj4cR9TcU75Pw5djdHx4htxdCAQxs_ue1Q1wi5TV43uLLBpigpjH1xN747mUHSRdTBJmXQWFyykInJCRXicM1KhNk=s0-d-e1-ft#https://www.somedomain.com/files/1658/thumbnail_71JtDozxS1L._SY450_.jpg

Obviously it is being cached by google proxy

But i can view the image without google user content, by accessing https://www.somedomain.com/files/1658/thumbnail_71JtDozxS1L._SY450_.jpg (i masked the domain so the image might not available to you).

I tried to clear browser cache but the problem still persist. How can i bypass the googleusercontent thingy or at least make the thumbnail able to display.

I checkout on this link Images not displayed for Gmail but im not using localhost and the image itself is accessible outside of my local network.

解决方案

How does Google Image Proxy work

The Google Image Proxy is a caching proxy server. Every time an image link is included in email the request will go to the Google Image Proxy first to see if it has been cached, if so it should serve it up from the proxy or it will go fetch it and cache it there after.

The solution for most issues

The Google Image Proxy server will fetch your images if this images:

  • have extensions like .png, .jpg/.jpeg or .gif only. May be .webp too. But not .svg.
  • do not use any kind of query string part in the image URL like ?id=123
  • have an URL which is mapped onto the image directly.
  • have not a long name.

Requirements for image server:

  • The response from image server/proxy server must include the correct header like Content-Type: image/jpeg.
  • File extension and content-type header must be in the same type.
  • Status code in server response must be 200 instead of 403, 500 and etc.

What could help too?

Google support answer:

Set up an image URL proxy whitelist

When your users open email messages, Gmail uses Google’s secure proxy servers to serve images that might be included in these messages. This protects your users and domain against image-based security vulnerabilities.

Because of the image proxy, links to images that are dependent on internal IPs and sometimes cookies are broken. The Image URL proxy whitelist setting lets you avoid broken links to images by creating and maintaining a whitelist of internal URLs that'll bypass proxy protection.

When you configure the Image URL proxy whitelist, you can specify a set of domains and a path prefix that can be used to specify large groups of URLs. See the guidelines below for examples.

Configure the Image URL proxy whitelist setting:

  • Sign in to your Google Admin console. Sign in using your administrator account (does not end in @gmail.com).
  • From the Admin console Home page, go to Apps > G Suite > Gmail > Advanced settings. Tip: To see Advanced settings, scroll to the bottom of the Gmail page.
  • On the left, select your top-level organization.
  • Scroll to the Image URL proxy whitelist section.
  • Enter image URL proxy whitelist patterns. Matching URLs will bypass image proxy protection. See the guidelines below for more details and instructions.
  • At the bottom, click Save.

It can take up to an hour for changes to propagate to user accounts. You can track prior changes under Admin console audit log.

Guidelines for applying the Image URL proxy whitelist setting

Security considerations

Consult with your security team before configuring the Image URL proxy whitelist setting. The decision to bypass image proxy whitelist protection can expose your users and domain to security risks if not used with care.

In general, if you have a domain that needs authentication via cookie, and if that domain is controlled by an administrator within your organization and is completely trusted, then whitelisting that URL should not expose your domain to image-based attacks.

Important: Disabling the image proxy is not recommended. This option is available to provide flexibility for administrators, but disabling the image proxy can leave your users vulnerable to malicious attacks.

Entering Image URL patterns

To maintain a whitelist of internal URLs that'll bypass proxy protection, enter the image URL patterns in the Image URL proxy whitelist setting. Matching URLs will bypass the image proxy.

A pattern can contain the scheme, the domain, and a path. The pattern must always have a forward slash (/) present between the domain and path. If the URL pattern specifies a scheme, then the scheme and the domain must fully match. Otherwise, the domain can partially match the URL suffix. For example, the pattern google.com matches www.google.com, but not gle.com. The URL pattern can specify a path that's matched against the path prefix.

Important: Enter your actual domain name as you enter the image URL pattern. Always include a trailing forward slash (/) after the domain name.

Examples of Image URL patterns

The following patterns are examples only. The following patterns:

http://rule_fixed_scheme_domain.com/
rule_flex_scheme_domain.com/
rule_fixed_subpath.com/cgi-bin/

... will match the following URLs:

http://rule_fixed_scheme_domain.com/
http://rule_fixed_scheme_domain.com/test.jpg?foo=bar#frag
http://rule_fixed_scheme_domain.com
rule_flex_scheme_domain.com/
t.rule_flex_scheme_domain.com/test.jpg
http://t.rule_flex_scheme_domain.com/test.jpg
https://t.rule_flex_scheme_domain.com/test.jpg
http://rule_fixed_subpath.com/cgi-bin/
http://rule_fixed_subpath.com/cgi-bin/people

Note: The URL scheme (http://) is optional. If the scheme is omitted, the pattern can match any scheme, and allows partial matches on the domain suffix.

Previewing the image URL patterns

Click Preview to see if the URLs match the image URL patterns you've set. If the image URL matches a pattern, you'll see a confirmation message. If the image URL does not match, an error message appears.

这篇关于电子邮件缩略图网址已更改为gmail中的googleusercontent.com的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆