nextcloud / nextcloud/mail

Support for loading avatars via BIMI

Open
#5,782 5 comments 2 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 like to request to add BIMI support for loading avatars in Nextcloud mail. Currently its supported to load the avatars either from an image in the address book, from the favicon of the website or via Gravatar. Adding support for BIMI (partial or complete) is easy, because we only have to check the DNS entries of the corresponding domain and search for the BIMI entry. There we can read the location of the avatar image.

We don't need to implement VMC or DMARC, but we could. Maybe as an option that we can enable/disable if needed.

Example code

Code could look something like this:

function get_bimi_record() {
  $records = dns_get_record( $domain, DNS_TXT );

  foreach ( $records as $record ) {
    if ( strpos( $record['txt'], 'v=BIMI1;' ) === 0 ) {
      return $record['txt'];
    }
  }

  return null;
}

function get_dns_tags( $value ) {
  $tags = explode( ';', $entry );
  $params = [];

  foreach ( $tags as $tag ) {
    list( $name, $value ) = explode( '=', $tag, 2 );
    $name = trim( $name );

    if ( $value ) {
      $params[ $name ] = trim( $value );
    }
  }

  return $params;
}

$dns_record = get_bimi_record();

if ( $dns_record ) {
  $tags = get_dns_tags( $dns_record );
  return $tags['l']; // there is the location
}
Is this feature wanted?

I would create a pull request for this feature request; the question is: do you want it?

References

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

No repository file or test is named. Start by locating the existing avatar-loading entry point and reviewing the referenced BIMI draft alongside the current address-book, favicon, and Gravatar paths; done means the BIMI lookup behavior and its handling of the DNS image location are decided and covered.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
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.