BLU Discuss list archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Discuss] send email from script as non-root
- Subject: [Discuss] send email from script as non-root
- From: david at thekramers.net (David Kramer)
- Date: Sat, 23 Jan 2021 16:39:08 -0500
As part of my home automation, I want a process on my server (which is also my mail server) to send an email (actually an SMS throught he email gateway).? The process that needs to do it is not run as root though, it's running as a mortal user.? I've tried mail, sendmail, curl, etc and they complain send-mail: fatal: open /etc/postfix/main.cf: Permission denied Can't send mail: sendmail process failed with error code 75 If I make /etc/postfix o+rx? and make main.cf readable, it just fails on some other file in that directory, and I feel this path is going in an unsafe direction, so I made /etc/postfix 750 again. I tried creating a script owned by root and setuid, and even then I got the same error, which confused me.? I put a "who am i" in the script and it said it was running with david (maybe it doesn't show effective UID???). I guess I could add something to sudoers, but before I get too deep into this, are there better solutions for this that google isn't showing me? Have you faced this before? Thanks
- Follow-Ups:
- [Discuss] send email from script as non-root
- From: richard.pieri at gmail.com (Rich Pieri)
- [Discuss] send email from script as non-root
- From: gaf.linux at gmail.com (Jerry Feldman)
- [Discuss] send email from script as non-root
- From: kentborg at borg.org (Kent Borg)
- [Discuss] send email from script as non-root
- Prev by Date: [Discuss] Tonight's BLU meeting - live stream UPDATE
- Next by Date: [Discuss] send email from script as non-root
- Previous by thread: [Discuss] Tonight's BLU meeting - live stream UPDATE
- Next by thread: [Discuss] send email from script as non-root
- Index(es):