Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Email header for a profile picture or avatar?

I am playing around with the python mailjet api, and found that I can set the sender's name so instead of emails showing up from "Info" ([email protected]) I can have them show up from "Carlos". I would also like to add a profile picture like that of Southwest Airlines or Twitter.

enter image description here

Anyone have any idea how I might do that?

I know that if I don't post code then people get angry, so here's some code:

mailjet = Client(auth=(API_KEY, API_PASSWORD), version='v3.1')
data = {
    'Messages': [
        {
            "From": {
                "Email": "[email protected]",
                "Name": "Carlos"
            },
            "To": [
                {
                    "Email": trip.email
                }
            ],
            "Subject": "Subject of the message",
            "TextPart":"This is the body of the message",
            "Headers": {
                    "X-My-Header": "https://www.example.com/profile_pic.png"
            }
        }
    ]
}
mailjet.send.create(data=data)
like image 715
Chase Roberts Avatar asked Nov 08 '22 15:11

Chase Roberts


1 Answers

2022 update: The best method for this is BIMI, Brand Indicators for Message Identification.

BIMI uses DMARC to ensure authenticity and then allows specifying a brand icon to be displayed in email clients. Google has supported it since 2020, but BIMI didn't exist back in 2018 when I composed this original answer.

I don't think there's a specification yet (see the IETF BIMI draft from 2021), so the best resource is the BIMI Group itself.


There are two headers out there that may (but probably won't) work for you:

  1. X-Face
  2. X-Image-URL

Neither has great support. X-Image-URL was supported in Apple Mail until v4.5.

It's not a header, but I think Gravatar is probably the closest thing to what you're looking for. With a Gravatar account, you can post an image to match your email's MD5 hash for various websites and email clients to pick up. There are a few implementations of email client helpers/extensions/add-ons that apply sender email Gravatars to a message, including Thunderbird's Contact Photos add-on, but that doesn't even have broad adoption on Thunderbird, which itself doesn't have broad adoption.

I can't comment on how it's done with Google specifically, but many enterprise systems simply propagate your image from your account profile.

Note that this does introduce a new confidence indicator that can be abused by phishing attacks, though I haven't seen one yet.

like image 190
Adam Katz Avatar answered Nov 14 '22 21:11

Adam Katz