On one server I run MailCow and other - Postfix and Dovecot. I also have a script that sends emails. For the moment I run a script from my local laptop and it works fine.

If I, however, ran a script on each of the 2 servers themselves, I’d be able to connect to the MTAs and get authenticated simpler.

How would I do it?

What would I have to set up, what permissions grant?