nextcloud / nextcloud/mail

Completely switch off email address avatars to avoid masses of 404 request responses

Open
#4,995 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

1. to develop enhancement
Dominant language
JavaScript
Stars
1k
Forks
348
Avg merge
12h 28m
Merged PRs (30d)
91

Description

Feature Request

I work with Debian, Plesk, Nginx and Fail2Ban. Fail2Ban overloads the server if there is too much writing to access logs happening, seems to get into a race condition on disc io. So I have found a way to configure nginx (under Plesk) such that 2xx and 3xx request responses are not written to the access log. This means that only errors are left in the logs (4xx and 5xx), which is just what I need. It also means that when inspecting the access logs, it is much much easier to see any problems.

What I have seen with Nextcloud is like this:

/index.php/apps/mail/api/avatars/url/myname%40example.com => 404 not found

I really want to avoid all avoidable 404's, so that I can monitor those which do happen and ban the offending IPs. The only thing within my power would be to match that location in Nginx and return some other code, but it would need to be a 2xx or 3xx for it to be not logged at all - and none of those tell the client that the request failed.

And I'm a bit surprised that it's happening at all, as I have the option for Gravatar and Favicon Icons deselected.

Summary

Please implement an option to suppress the looking for email-matching icons. This may be useful in some contexts, but in many they will all fail, e.g. as the emails I receive are all from people not in my private Nextcloud instance. I get a lot of emails from many different addresses, so they all end up as 404s - both from the dashboard and from the main email page. Predictably as 404's - and that's messing up my attempts to ban clients which produce too many 404s - I would have to make an extra set of jails just for Nextcloud, where the 404s are not tested )-:

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the /index.php/apps/mail/api/avatars/url/ request path and the existing Gravatar and Favicon Icons settings in the Mail app. Determine where email-matching avatar lookups are triggered from the dashboard and main email page, then verify that the new option prevents those lookups and their resulting 404 responses.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, nginx
Domain
full-stack
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.