OK, I found it. The hovered/clicked message is passed to the callback function in the info parameter, https://webextension-api.thunderbird.net/en/beta-mv2/menus.html#menus-onclicked. So you just use this to get the sender: info.selectedMessages.messages[0].author