Linux – How to retrieve the Let’s Encrypt registration’s current email address

certbotlets-encryptlinux

I understand that Let's Encrypt maintains an email address as a registration and recovery contact for every "account." This email address is used to notify the owner of the certificates of upcoming expirations as well as warn of other problems with the certificate.

I have inherited several websites that use Let's Encrypt and wish to determine what (if any) registration and recovery contact email is configured for these sites. Unfortunately I find no documented means of doing so.

Several suggestions indicate the email address is stored at /etc/letsencrypt/accounts/acme-v02.api.letsencrypt.org/directory/*/regr.json, but apparently this was only the case with earlier releases of certbot.

Best Answer

Here I answer my own question:

It turns out that, at least as of certbot version 0.26.1, the following command both updates my Let's Encrypt registration and recovery contact and reports the previous contact in Let's Encrypt's debug log:

certbot register --update-registration --email <your-email-address>

In my case, after running the above command the debug log (/var/log/letsencrypt/letsencrypt.log) contained a report like:

2020-03-05 14:05:17,060:DEBUG:requests.packages.urllib3.connectionpool:"POST /acme/new-acct HTTP/1.1" 200 575
2020-03-05 14:05:17,060:DEBUG:acme.client:Received response:...
{
...
  "contact": [
    "mailto:<previous support email>"
  ],
...
  "createdAt": "<when previous support email was created>",
...
}

This allowed me to retrieve not only the previous support email address but also when it was configured, even though that information was not listed in /etc/letsencrypt/accounts/acme-v02.api.letsencrypt.org/directory/*/regr.json