What is the best way to store a password on a system/server?


I will have an application server that needs to use credentials to authenticate to another service (email). What’s the best way to securely store these credentials locally on the machine?

Thanks in advance!