LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Sendmail ignore RunAsUser option (https://www.linuxquestions.org/questions/linux-server-73/sendmail-ignore-runasuser-option-822388/)

Pavel Samsonov 07-27-2010 04:36 AM

Sendmail ignore RunAsUser option
 
I use Slackware 13.1 with Sendmail 8.14. I set RunAsUser=mail option in sendmail.cf, but Sendmail still run under root. How run Sendmail under nonpriveleged user? Thanks.

quanta 08-16-2010 12:19 PM

Who owns sendmail service?
Code:

ls -l `which sendmail`

Pavel Samsonov 08-20-2010 02:52 AM

ls -l `which sendmail`
-r-xr-sr-x 1 root smmsp 710452 2010-04-24 20:45 /usr/sbin/sendmail

This is system defaults in Slackware.

My configuration:

grep RUN sendmail.mc
define(`confRUN_AS_USER', `mail')dnl

grep Run /etc/mail/sendmail.cf
#O MaxRunnersPerQueue=1
#O NiceQueueRun
#O MaxQueueRunSize=0
O RunAsUser=mail

And after /etc/rc.d/rc.sendmail stop; /etc/rc.d/rc.sendmail start:

ps aux | grep sendmail
root 2308 0.0 0.1 7076 1964 ? Ss 11:45 0:00 sendmail: accepting connections
smmsp 2311 0.0 0.1 6688 1628 ? Ss 11:45 0:00 sendmail: Queue runner@00:25:00 for /var/spool/clientmqueue
root 2340 0.0 0.0 2420 832 pts/3 S+ 11:49 0:00 grep sendmail

bathory 08-20-2010 03:59 AM

Hi,

sendmail needs to start running as root, so it can bind to port 25. Unprivileged users cannot open ports bellow 1025.
After that whenever a smtp connection is done, it's processed by a child running as the user specified with the RunAsUser option. You can read this, that explains everything

Regards

Pavel Samsonov 08-27-2010 04:39 AM

Thanks!
I have understood the general aspects of local delivery of the letter in sendmail. Sendmail it is executed under the user "mail" as I have specified in my configuration. Procmail has root setuid bit. Simply I couldn't understand - why at permissions user:user 600 on mbox, sendmail continued to deliver letters


All times are GMT -5. The time now is 02:06 AM.