View | Details | Raw Unified | Return to bug 208056 | Differences between
and this patch

Collapse All | Expand All

(-)mail/opendkim.new/files/milter-opendkim.in 2016-03-25 12:44:18.553548627 +0100 (+26 lines)
Lines 16-21 Link Here
16
# milteropendkim_enable (bool):   Set to "NO" by default.
16
# milteropendkim_enable (bool):   Set to "NO" by default.
17
#                             Set it to "YES" to enable dkim-milter
17
#                             Set it to "YES" to enable dkim-milter
18
# milteropendkim_uid (str):       Set username to run milter.
18
# milteropendkim_uid (str):       Set username to run milter.
19
# milteropendkim_gid (str):       Set group to run milter.
19
# milteropendkim_profiles (list): Set to "" by default.
20
# milteropendkim_profiles (list): Set to "" by default.
20
#                             Define your profiles here.
21
#                             Define your profiles here.
21
# milteropendkim_cfgfile (str):   Configuration file. See opendkim.conf(5)
22
# milteropendkim_cfgfile (str):   Configuration file. See opendkim.conf(5)
Lines 38-46 Link Here
38
extra_commands="reload"
39
extra_commands="reload"
39
start_precmd="dkim_prepcmd"
40
start_precmd="dkim_prepcmd"
41
start_postcmd="dkim_start_postcmd"
40
stop_postcmd="dkim_postcmd"
42
stop_postcmd="dkim_postcmd"
41
command="%%PREFIX%%/sbin/opendkim"
43
command="%%PREFIX%%/sbin/opendkim"
42
_piddir="/var/run/milteropendkim"
44
_piddir="/var/run/milteropendkim"
45
_piddir_perms="0755"
43
pidfile="${_piddir}/pid"
46
pidfile="${_piddir}/pid"
44
sig_reload="USR1"
47
sig_reload="USR1"
Lines 51-56 Link Here
51
#
54
#
52
: ${milteropendkim_enable="NO"}
55
: ${milteropendkim_enable="NO"}
53
: ${milteropendkim_uid="mailnull"}
56
: ${milteropendkim_uid="mailnull"}
57
: ${milteropendkim_gid="mailnull"}
54
: ${milteropendkim_cfgfile="%%PREFIX%%/etc/mail/opendkim.conf"}
58
: ${milteropendkim_cfgfile="%%PREFIX%%/etc/mail/opendkim.conf"}
55
# Options other than above can be set with $milteropendkim_flags.
59
# Options other than above can be set with $milteropendkim_flags.
Lines 82-87 Link Here
82
       fi
86
       fi
83
       if [ "x${milteropendkim_uid}" != "x" ];then
87
       if [ "x${milteropendkim_uid}" != "x" ];then
84
           _uid_prefix="-u"
88
           _uid_prefix="-u"
89
           if [ "x${milteropendkim_gid}" != "x" ];then
90
               milteropendkim_uid=${milteropendkim_uid}:${milteropendkim_gid}
91
           fi
85
       fi
92
       fi
86
       if [ "x${milteropendkim_domain}" != "x" ];then
93
       if [ "x${milteropendkim_domain}" != "x" ];then
87
           milteropendkim_domain="-d ${milteropendkim_domain}"
94
           milteropendkim_domain="-d ${milteropendkim_domain}"
Lines 127-132 Link Here
127
       fi
134
       fi
128
       if [ "x${milteropendkim_uid}" != "x" ];then
135
       if [ "x${milteropendkim_uid}" != "x" ];then
129
           _uid_prefix="-u"
136
           _uid_prefix="-u"
137
           if [ "x${milteropendkim_gid}" != "x" ];then
138
               milteropendkim_uid=${milteropendkim_uid}:${milteropendkim_gid}
139
           fi
130
       fi
140
       fi
131
       if [ "x${milteropendkim_domain}" != "x" ];then
141
       if [ "x${milteropendkim_domain}" != "x" ];then
132
           milteropendkim_domain="-d ${milteropendkim_domain}"
142
           milteropendkim_domain="-d ${milteropendkim_domain}"
Lines 157-162 Link Here
157
    if [ -n "${milteropendkim_uid}" ] ; then
167
    if [ -n "${milteropendkim_uid}" ] ; then
158
       chown ${milteropendkim_uid} ${_piddir}
168
       chown ${milteropendkim_uid} ${_piddir}
159
    fi
169
    fi
170
    if [ -n "${milteropendkim_gid}" ] ; then
171
       chgrp ${milteropendkim_gid} ${_piddir}
172
       _piddir_perms="0775"
173
    fi
174
    chmod ${_piddir_perms} ${_piddir}
175
}
176
177
dkim_start_postcmd ()
178
{
179
    # postcmd is executed too fast and socket is not created before checking...
180
    sleep 1
181
    if [ -S ${milteropendkim_socket##local:} ] ; then
182
        chmod ${_piddir_perms} ${milteropendkim_socket##local:}
183
    elif [ -S ${milteropendkim_socket##unix:} ] ; then
184
        chmod ${_piddir_perms} ${milteropendkim_socket##unix:}
185
    fi
160
}
186
}

Return to bug 208056