You should be able to set up the system to autologin on startup and then run commands from the auto-logged-in user’s .bash_profile, if you can reduce what you want to do to a script. You’d probably want to specially set up a user for this, to reduce security risks.
(I just stood up a weird little Gentoo media PC that does approximately this—logs a user in on startup and then runs startx from .bash_profile to make it easier to use with no keyboard attached and no DM. You’d just want to put a different command in instead.)


It’s possible—I’ve used Perl scripts to pull data automatically out of email attachments stored in a maildir setup, and you should be able to pick commands out of a plain-text email body with a scripting language even more easily—but I will add my voice to the chorus that’s saying you should look into any other method you can find before settling on this. If it turns out you must proceed along these lines, think long and hard about security.