2023-07-12 10:06:46 +02:00
|
|
|
#!/usr/bin/perl -w
|
|
|
|
|
|
|
|
use esmith::Build::CreateLinks qw(:all);
|
|
|
|
use File::Basename;
|
|
|
|
use File::Path;
|
|
|
|
|
|
|
|
# email-conf - console-save, bootstrap-console-save, domain-create, domain-delete,
|
|
|
|
# ip-change, email-update, host-create, host-delete, host-modify, post-upgrade
|
2024-09-25 04:29:24 +02:00
|
|
|
# rcpthosts template was in smeserver qpsmtpd, and not used if qpsmtpd in use anymore
|
2023-07-12 10:06:46 +02:00
|
|
|
|
|
|
|
foreach (qw(
|
2024-04-25 20:40:38 +02:00
|
|
|
badmailfrom
|
|
|
|
badrcptto
|
2023-07-12 10:06:46 +02:00
|
|
|
bouncefrom
|
|
|
|
bouncehost
|
|
|
|
concurrencylocal
|
|
|
|
concurrencyremote
|
|
|
|
databytes
|
|
|
|
defaultdomain
|
|
|
|
defaulthost
|
|
|
|
doublebounceto
|
|
|
|
envnoathost
|
|
|
|
helohost
|
|
|
|
locals
|
|
|
|
me
|
|
|
|
plusdomain
|
|
|
|
rcpthosts
|
|
|
|
smtproutes
|
|
|
|
virtualdomains
|
|
|
|
))
|
|
|
|
{
|
2024-09-25 04:29:24 +02:00
|
|
|
templates2events("/var/qmail/control/$_", qw(
|
|
|
|
console-save
|
|
|
|
bootstrap-console-save
|
|
|
|
domain-create
|
|
|
|
domain-delete
|
|
|
|
ip-change
|
|
|
|
email-update
|
|
|
|
host-create
|
|
|
|
host-delete
|
|
|
|
host-modify
|
|
|
|
post-upgrade
|
2024-12-03 22:12:25 +01:00
|
|
|
smeserver-mini-qmail-update
|
2024-09-25 04:29:24 +02:00
|
|
|
));
|
|
|
|
|
2024-10-15 19:59:06 +02:00
|
|
|
}
|
2023-07-12 10:06:46 +02:00
|
|
|
|
2024-10-15 19:59:06 +02:00
|
|
|
templates2events("/var/qmail/control/badrcptto", qw(
|
2024-09-25 04:29:24 +02:00
|
|
|
user-create
|
|
|
|
user-delete
|
|
|
|
user-modify
|
|
|
|
group-create
|
|
|
|
group-delete
|
|
|
|
group-modify
|
|
|
|
pseudonym-create
|
|
|
|
pseudonym-delete
|
|
|
|
pseudonym-modify
|
2024-04-25 20:40:38 +02:00
|
|
|
));
|
2024-10-15 19:59:06 +02:00
|
|
|
|
2024-04-25 20:40:38 +02:00
|
|
|
|
|
|
|
|
2023-07-12 10:06:46 +02:00
|
|
|
foreach (qw(
|
|
|
|
/var/qmail/alias/.qmail-default
|
|
|
|
/var/qmail/alias/.qmail-localdelivery-default
|
|
|
|
))
|
|
|
|
{
|
|
|
|
templates2events($_, qw(
|
|
|
|
console-save
|
|
|
|
bootstrap-console-save
|
|
|
|
domain-create
|
|
|
|
domain-delete
|
|
|
|
ip-change
|
|
|
|
email-update
|
|
|
|
host-create
|
|
|
|
host-delete
|
|
|
|
host-modify
|
|
|
|
post-upgrade
|
2024-12-03 22:12:25 +01:00
|
|
|
smeserver-mini-qmail-update
|
2023-07-12 10:06:46 +02:00
|
|
|
));
|
|
|
|
}
|
|
|
|
|
|
|
|
templates2events("/var/qmail/alias/.qmail-shared" , qw(bootstrap-console-save user-create user-modify user-delete));
|
|
|
|
|
|
|
|
#--------------------------------------------------
|
|
|
|
# actions for console-save event:
|
|
|
|
# write config files and create startup link
|
|
|
|
#--------------------------------------------------
|
|
|
|
$event = "console-save";
|
|
|
|
|
|
|
|
# If qmail-send is running, it will receive the SIGHUP and ignore the
|
|
|
|
# start command. If it is not running then the signal will be ignored
|
|
|
|
# and qmail-send will read its new configuration files anyway.
|
|
|
|
|
|
|
|
safe_symlink("sighup", "root/etc/e-smith/events/$event/services2adjust/qmail");
|
|
|
|
|
|
|
|
#--------------------------------------------------
|
|
|
|
# actions for bootstrap-console-save event:
|
|
|
|
# write config files and create startup link
|
|
|
|
#--------------------------------------------------
|
|
|
|
$event = "bootstrap-console-save";
|
|
|
|
|
|
|
|
event_link("pseudonym-cleanup", $event, "03");
|
|
|
|
event_link("qmail-update-group", $event, "20");
|
|
|
|
event_link("qmail-update-user", $event, "55");
|
|
|
|
templates2events("/var/qmail/users/assign", $event);
|
|
|
|
safe_symlink("/var/qmail/bin/qmail-newu", "root/etc/e-smith/events/$event/S55email-assign");
|
|
|
|
|
|
|
|
#--------------------------------------------------
|
|
|
|
# actions for domain-create event:
|
|
|
|
# rewrite config files and restart server
|
|
|
|
#--------------------------------------------------
|
|
|
|
$event = "domain-create";
|
|
|
|
|
|
|
|
# If qmail-send is running, it will receive the SIGHUP and ignore the
|
|
|
|
# start command. If it is not running then the signal will be ignored
|
|
|
|
# and qmail-send will read its new configuration files anyway.
|
|
|
|
|
|
|
|
safe_symlink("sighup", "root/etc/e-smith/events/$event/services2adjust/qmail");
|
|
|
|
|
|
|
|
#--------------------------------------------------
|
|
|
|
# actions for domain-delete event:
|
|
|
|
# rewrite config files and restart server
|
|
|
|
#--------------------------------------------------
|
|
|
|
$event = "domain-delete";
|
|
|
|
|
|
|
|
|
|
|
|
# If qmail-send is running, it will receive the SIGHUP and ignore the
|
|
|
|
# start command. If it is not running then the signal will be ignored
|
|
|
|
# and qmail-send will read its new configuration files anyway.
|
|
|
|
|
|
|
|
safe_symlink("sighup", "root/etc/e-smith/events/$event/services2adjust/qmail");
|
|
|
|
|
|
|
|
#--------------------------------------------------
|
|
|
|
# actions for email-update event:
|
|
|
|
# email parameters have been changed in the e-smith
|
|
|
|
# manager; update system security, rewrite email config
|
|
|
|
# files, configure other system files (crontab is the
|
|
|
|
# important one), and restart server
|
|
|
|
#--------------------------------------------------
|
|
|
|
$event = "email-update";
|
|
|
|
|
|
|
|
event_link("qmail-update-user", $event, "03");
|
|
|
|
event_link("pseudonym-cleanup", $event, "30");
|
|
|
|
|
|
|
|
# If qmail-send is running, it will receive the SIGHUP and ignore the
|
|
|
|
# start command. If it is not running then the signal will be ignored
|
|
|
|
# and qmail-send will read its new configuration files anyway.
|
|
|
|
|
|
|
|
safe_symlink("sighup", "root/etc/e-smith/events/$event/services2adjust/qmail");
|
|
|
|
safe_symlink("adjust", "root/etc/e-smith/events/$event/services2adjust/masq");
|
|
|
|
safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/smtp-auth-proxy");
|
|
|
|
|
|
|
|
#--------------------------------------------------
|
|
|
|
# actions for group-create event:
|
|
|
|
#--------------------------------------------------
|
|
|
|
$event = "group-create";
|
|
|
|
|
|
|
|
event_link("pseudonym-cleanup", $event, "03");
|
|
|
|
event_link("qmail-update-group", $event, "20");
|
|
|
|
templates2events("/var/qmail/users/assign", $event);
|
|
|
|
safe_symlink("/var/qmail/bin/qmail-newu", "root/etc/e-smith/events/$event/S55email-assign");
|
|
|
|
safe_symlink("sighup", "root/etc/e-smith/events/$event/services2adjust/qmail");
|
|
|
|
|
|
|
|
#--------------------------------------------------
|
|
|
|
# actions for group-delete event:
|
|
|
|
#--------------------------------------------------
|
|
|
|
$event = "group-delete";
|
|
|
|
|
|
|
|
event_link("pseudonym-cleanup", $event, "03");
|
|
|
|
event_link("qmail-delete-group", $event, "20");
|
|
|
|
templates2events("/var/qmail/users/assign", $event);
|
|
|
|
safe_symlink("/var/qmail/bin/qmail-newu", "root/etc/e-smith/events/$event/S55email-assign");
|
|
|
|
safe_symlink("sighup", "root/etc/e-smith/events/$event/services2adjust/qmail");
|
|
|
|
|
|
|
|
#--------------------------------------------------
|
|
|
|
# actions for group-modify event:
|
|
|
|
#--------------------------------------------------
|
|
|
|
$event = "group-modify";
|
|
|
|
|
|
|
|
event_link("pseudonym-cleanup", $event, "03");
|
|
|
|
event_link("qmail-update-group", $event, "20");
|
|
|
|
templates2events("/var/qmail/users/assign", $event);
|
|
|
|
safe_symlink("/var/qmail/bin/qmail-newu", "root/etc/e-smith/events/$event/S55email-assign");
|
|
|
|
safe_symlink("sighup", "root/etc/e-smith/events/$event/services2adjust/qmail");
|
|
|
|
|
|
|
|
#--------------------------------------------------
|
|
|
|
# actions for user-create event:
|
|
|
|
#--------------------------------------------------
|
|
|
|
$event = "user-create";
|
|
|
|
|
|
|
|
event_link("qmail-update-user", $event, "20");
|
|
|
|
event_link("qmail-update-group", $event, "20");
|
|
|
|
|
|
|
|
#--------------------------------------------------
|
|
|
|
# actions for user-modify event
|
|
|
|
#--------------------------------------------------
|
|
|
|
$event = "user-modify";
|
|
|
|
|
|
|
|
event_link("qmail-update-user", $event, "20");
|
|
|
|
event_link("qmail-update-group", $event, "20");
|
|
|
|
|
|
|
|
#--------------------------------------------------
|
|
|
|
# actions for user-modify-admin event
|
|
|
|
#--------------------------------------------------
|
|
|
|
$event = "user-modify-admin";
|
|
|
|
|
|
|
|
event_link("qmail-update-user", $event, "20");
|
|
|
|
|
|
|
|
#--------------------------------------------------
|
|
|
|
# actions for user-delete event
|
|
|
|
#--------------------------------------------------
|
|
|
|
$event = "user-delete";
|
|
|
|
|
|
|
|
event_link("qmail-update-group", $event, "25");
|
|
|
|
|
|
|
|
#--------------------------------------------------
|
|
|
|
# actions for ip-up event:
|
|
|
|
#--------------------------------------------------
|
|
|
|
$event = "ip-up";
|
|
|
|
|
|
|
|
event_link("qmail-ipup", $event, "20");
|
|
|
|
|
|
|
|
#--------------------------------------------------
|
|
|
|
# actions for ip-change event:
|
|
|
|
#--------------------------------------------------
|
|
|
|
$event = "ip-change";
|
|
|
|
|
|
|
|
safe_symlink("sighup", "root/etc/e-smith/events/$event/services2adjust/qmail");
|
|
|
|
|
|
|
|
#--------------------------------------------------
|
2024-12-03 22:12:25 +01:00
|
|
|
# actions for smeserver-mini-qmail-update event:
|
2023-07-12 10:06:46 +02:00
|
|
|
#--------------------------------------------------
|
2024-12-03 22:12:25 +01:00
|
|
|
$event = "smeserver-mini-qmail-update";
|
2023-07-12 10:06:46 +02:00
|
|
|
|
|
|
|
safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/qmail");
|
|
|
|
event_link("systemd-reload", $event, "89");
|
|
|
|
event_link("systemd-default", $event, "88");
|
|
|
|
event_link("pseudonym-cleanup", $event, "03");
|
|
|
|
|
|
|
|
#--------------------------------------------------
|
|
|
|
# actions for pseudonym-{create,delete,modify}
|
|
|
|
#--------------------------------------------------
|
|
|
|
foreach $event ( qw(pseudonym-create pseudonym-modify pseudonym-delete
|
|
|
|
user-create user-modify user-delete
|
|
|
|
))
|
|
|
|
{
|
|
|
|
event_link("pseudonym-cleanup", $event, "03");
|
|
|
|
templates2events("/var/qmail/control/virtualdomains", $event);
|
|
|
|
templates2events("/var/qmail/users/assign", $event);
|
|
|
|
safe_symlink("/var/qmail/bin/qmail-newu", "root/etc/e-smith/events/$event/S55email-assign");
|
|
|
|
safe_symlink("sighup", "root/etc/e-smith/events/$event/services2adjust/qmail");
|
|
|
|
}
|
|
|
|
|
|
|
|
safe_symlink(".qmail", "root/home/e-smith/.qmail-default");
|
|
|
|
safe_symlink(".qmail-shared", "root/var/qmail/alias/.qmail-shared-default");
|
|
|
|
|