Bug 4325 - Following redirects when retrieving image
Summary: Following redirects when retrieving image
Status: RESOLVED FIXED
Alias: None
Product: Claws Mail (GTK 2)
Classification: Unclassified
Component: Plugins/Libravatar (show other bugs)
Version: 3.17.3
Hardware: PC Linux
: P3 normal
Assignee: users
URL:
Depends on:
Blocks:
 
Reported: 2020-03-18 15:00 UTC by Lars Kruse
Modified: 2020-06-21 19:49 UTC (History)
0 users

See Also:


Attachments
Libravatar plugin preferences (116.91 KB, image/png)
2020-05-04 20:42 UTC, Ricardo Mones
no flags Details

Description Lars Kruse 2020-03-18 15:00:18 UTC
I configured the libravatar plugin for Claws Mail.

Afterwards I noticed in the logs (~/.xsession-errors) the following hint:

  failed to load image '/home/foo/.claws-mail/avatarcache/retro/....': failed to determine format of file ....

(translated - the specific wording may differ a bit)

The referenced file above contains the following:

  <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
  <html><head>
  <title>301 Moved Permanently</title>
  </head><body>
  <h1>Moved Permanently</h1>
  <p>The document has moved <a href="https://cdn.libravatar.org/avatar/....?s=48&amp;d=retro">here</a>.</p>
  </body></html>

Thus it looks like the plugin does not follow up on redirects (301).

Thank you for your time and the plugin!
Comment 1 Ricardo Mones 2020-05-04 20:42:00 UTC
Created attachment 2057 [details]
Libravatar plugin preferences
Comment 2 Ricardo Mones 2020-05-04 20:43:28 UTC
Since you don't mention it, do you have the "Allow redirects to other sites" checkbox enabled?

(see attached image for location within plugin preferences)
Comment 3 Lars Kruse 2020-05-13 16:44:50 UTC
> Since you don't mention it, do you have the
> "Allow redirects to other sites" checkbox enabled?

Good point!

No, indeed the setting was disabled (by default, I guess).

After enabling the setting, the behavior changes slightly. Now the created file below "~/.claws-mail/avatarcache/" is empty (zero bytes) instead of containing the html redirect text.

btw: the tooltip of the setting indicates, that the redirect may involve 3rd party ressources (e.g. gravatar.com). But in my case it is just about a local redirect within the original domain (cdn.libravatar.org).

Thank you for your time!
Comment 4 Ricardo Mones 2020-05-13 21:52:04 UTC
> No, indeed the setting was disabled (by default, I guess).

Yes, that's default value.

> After enabling the setting, the behavior changes slightly. Now the created file
> below "~/.claws-mail/avatarcache/" is empty (zero bytes) instead of containing
> the html redirect text.
>
> btw: the tooltip of the setting indicates, that the redirect may involve 3rd
> party ressources (e.g. gravatar.com). But in my case it is just about a local
> redirect within the original domain (cdn.libravatar.org).

Yes, this depends on the missing icon mode you have selected.

Notice that it may not work very well currently, you can read more here:

https://lists.claws-mail.org/pipermail/devel/2020-May/002476.html

You can try to open "claws-mail --debug" in a terminal and see which error is shown.

Thanks!
Comment 5 Ricardo Mones 2020-06-21 19:49:13 UTC
Fixed in master¹ and gtk3² branches.

¹ 3fdfe990c6976d2e5b41b27655dc3c4da5bccb94
² a0cd23ecbb4ea8b3bc76568b47e8e9451678a2cb

Note You need to log in before you can comment on or make changes to this bug.