Skip to content

Commit 9234cc8

Browse files
committed
Reload postfix configuration when a transport is changed.
1 parent 403e4b9 commit 9234cc8

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

server/plugins-available/mail_plugin.inc.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,11 @@ function onLoad() {
6868
//$app->plugins->registerEvent('mail_domain_update',$this->plugin_name,'domain_update');
6969
$app->plugins->registerEvent('mail_domain_delete',$this->plugin_name,'domain_delete');
7070

71+
//* Mail transports
72+
$app->plugins->registerEvent('mail_transport_insert',$this->plugin_name,'transport_update');
73+
$app->plugins->registerEvent('mail_transport_update',$this->plugin_name,'transport_update');
74+
$app->plugins->registerEvent('mail_transport_delete',$this->plugin_name,'transport_update');
75+
7176
}
7277

7378

@@ -164,6 +169,14 @@ function domain_delete($event_name,$data) {
164169
}
165170
}
166171

172+
function transport_update($event_name,$data) {
173+
global $app, $conf;
174+
175+
exec('/etc/init.d/postfix reload &> /dev/null');
176+
$app->log('Postfix config reloaded ',LOGLEVEL_DEBUG);
177+
178+
}
179+
167180

168181

169182

0 commit comments

Comments
 (0)