lundi 2 mars 2015

How can I reload postfix and dovecot without using the root user?


I have a script that changes postfix and dovecot config files, when it is done I want load the changes. I don't want the script to run as root, I want to give it just the permissions it needs, no more. I added it to the sudoers file:



scriptuser ALL=(ALL) NOPASSWD: /usr/sbin/postfix
scriptuser ALL=(ALL) NOPASSWD: /usr/sbin/dovecot


Which allows me to run the command, but it looks like both Postfix and Dovecot check for root UID:



$ /usr/sbin/postfix
postfix: error: to submit mail, use the Postfix sendmail command
postfix: fatal: the postfix command is reserved for the superuser
$ /usr/sbin/dovecot
Fatal: open(/var/run/dovecot/master.pid) failed: Permission denied


Is there a better approach?



Aucun commentaire:

Enregistrer un commentaire