I'm using ssmtp, and I would like to not make my /etc/ssmtp/ssmtp.conf world-readable, because it has my gateway password in cleartext. But if it is mode 600, then ssmtp run as an unprivileged user errors out with "ssmtp: Cannot open mailhub:25", because it cannot read the config file.
This article recommend creating a special ssmtp user and making it SUID, but before I add that kind of complexity to my deployment script, I want to ask:
Is it safe (barring security holes in ssmtp) to just make the ssmtp binary SUID root, so it can read the config file?
(I'm aware of the dangers of SUID in general -- no general answers please! My question is about ssmtp in particular, because I'm wondering if it has been written with being safe for SUID-root in mind.)
Read the article again. It does not recommend running ssmtp as root. It says to chown the file to a special ssmtp user and use SUID to run the program as that user. This isn't even close to the same as what you're proposing.
Also: be aware you're reading a guide for FreeBSD; which is not Linux. You should not blindly assume those directions will work for a Linux system (they almost certainly will not).