Hi
I hope this is the right place to post this.
I've been setting up a mail stack on FreeBSD and didn't see options for setting the permissions if using a unix socket with postfix.
Most of the files in /usr/local/etc/rc.d have configuation options you can tweak in /etc/rc.conf but I ran into an issue with permission so added this to the file.
/etc/rc.conf
opendmarc_enable="YES"
opendmarc_runas="opendmarc: opendmarc"
opendmarc_socketspec="unix:/var/spool/postfix/opendmarc/opendmarc.sock"
opendmarc_socketperms="0770"
/usr/local/etc/rc.d/opendmarc
opendmarc_socketperms=${opendmarc_socketperms-"0770"}
if [ -S ${opendmarc_socketspec##local:} ] ; then
chmod -R ${opendmarc_socketperms} ${opendmarc_socketspec##local:} > /dev/null 2>&1
elif [ -S ${opendmarc_socketspec##unix:} ] ; then
chmod -R ${opendmarc_socketperms} ${opendmarc_socketspec##unix:} > /dev/null 2>&1
fi
This might not be the best way to do it but I don't have much experience creating unix sockets with user and permissions, but it works and would be good to implement so opendmarc can run as user opendmarc and postfix can write to the socket.
Thanks, John
I hope this is the right place to post this.
I've been setting up a mail stack on FreeBSD and didn't see options for setting the permissions if using a unix socket with postfix.
Most of the files in /usr/local/etc/rc.d have configuation options you can tweak in /etc/rc.conf but I ran into an issue with permission so added this to the file.
/etc/rc.conf
opendmarc_enable="YES"
opendmarc_runas="opendmarc: opendmarc"
opendmarc_socketspec="unix:/var/spool/postfix/opendmarc/opendmarc.sock"
opendmarc_socketperms="0770"
/usr/local/etc/rc.d/opendmarc
opendmarc_socketperms=${opendmarc_socketperms-"0770"}
if [ -S ${opendmarc_socketspec##local:} ] ; then
chmod -R ${opendmarc_socketperms} ${opendmarc_socketspec##local:} > /dev/null 2>&1
elif [ -S ${opendmarc_socketspec##unix:} ] ; then
chmod -R ${opendmarc_socketperms} ${opendmarc_socketspec##unix:} > /dev/null 2>&1
fi
This might not be the best way to do it but I don't have much experience creating unix sockets with user and permissions, but it works and would be good to implement so opendmarc can run as user opendmarc and postfix can write to the socket.
Thanks, John