File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -111,6 +111,25 @@ public function configure_amavis() {
111111
112112 removeLine ('/etc/sysconfig/freshclam ' , 'FRESHCLAM_DELAY=disabled-warn # REMOVE ME ' , 1 );
113113 replaceLine ('/etc/freshclam.conf ' , 'Example ' , '# Example ' , 1 );
114+
115+ // get shell-group for amavis
116+ $ amavis_group =exec ('grep -o "^amavis:\|^vscan:" /etc/group ' );
117+ if (!empty ($ amavis_group )) {
118+ $ amavis_group =rtrim ($ amavis_group , ": " );
119+ }
120+ // get shell-user for amavis
121+ $ amavis_user =exec ('grep -o "^amavis:\|^vscan:" /etc/passwd ' );
122+ if (!empty ($ amavis_user )) {
123+ $ amavis_user =rtrim ($ amavis_user , ": " );
124+ }
125+
126+ // Create the director for DKIM-Keys
127+ if (!is_dir ('/var/lib/amavis ' )) mkdir ('/var/lib/amavis ' , 0750 , true );
128+ if (!empty ($ amavis_user )) exec ('chown ' .$ amavis_user .' /var/lib/amavis ' );
129+ if (!empty ($ amavis_group )) exec ('chgrp ' .$ amavis_group .' /var/lib/amavis ' );
130+ if (!is_dir ('/var/lib/amavis/dkim ' )) mkdir ('/var/lib/amavis/dkim ' , 0750 );
131+ if (!empty ($ amavis_user )) exec ('chown -R ' .$ amavis_user .' /var/lib/amavis/dkim ' );
132+ if (!empty ($ amavis_group )) exec ('chgrp -R ' .$ amavis_group .' /var/lib/amavis/dkim ' );
114133
115134
116135 }
You can’t perform that action at this time.
0 commit comments