@cas' suggestion to use
xdotool works. Not sure why previous attempts by OP weren't successful, perhaps a combination of Thunderbird updates and use of correct syntax.
The following command finds windows with Thunderbird in their name and sends the Get All New Messages key sequence to the first of the found windows:
xdotool search --name "Mozilla Thunderbird" key --window %1 shift+F5
Thanks to this thread I was able to set up KDE Connect to use my mobile to tell my laptop to download emails.
xdotool's window search works is best explained in its manpages, but in short: it builds a memory structure containing all windows that matched your criteria. How these results are sorted in memory is not in user's control, so when referring to the first window in the results (
%1), you don't know which one it is. This could be the most common reason for
xdotool invocations to have no effect: keys could be sent to the wrong window. To prevent it, try to set window search parameters to return just one window. It is tempting to replace
%@ (all matched windows), but this may include applications where the keys activate an action you don't want.