mirror of
https://github.com/mailcow/mailcow-dockerized.git
synced 2026-11-08 18:13:37 +00:00
[Web][Postfix][Dovecot] Mail policies: compare addresses like Postfix, close bypasses via alias forms, temporary aliases, Sieve and cross-domain groups
This commit is contained in:
22 files changed
+614
-141
No files matched your search
@@ -199,6 +199,8 @@ plugin {
|
||||
sieve_plugins = sieve_imapsieve sieve_extprograms
|
||||
sieve_vacation_send_from_recipient = yes
|
||||
sieve_redirect_envelope_from = recipient
|
||||
# Notifications are sent with the address of the mailbox (not :from or postmaster), so mail policies apply
|
||||
sieve_notify_mailto_envelope_from = recipient
|
||||
# From elsewhere to Spam folder
|
||||
imapsieve_mailbox1_name = Junk
|
||||
imapsieve_mailbox1_causes = COPY
|
||||
|
||||
@@ -175,7 +175,7 @@ lmtp_destination_recipient_limit=1
|
||||
# Mail policies: while policies or internal aliases exist, mysql_mail_policy_maps.cf returns this class and smtpd
|
||||
# asks the policy service for every recipient (mailcow-policy in master.cf); no answer defers the recipient
|
||||
smtpd_restriction_classes = mailcow_mail_policy
|
||||
mailcow_mail_policy = check_policy_service { unix:private/mailcow-policy, timeout=10s, default_action=DEFER_IF_PERMIT }
|
||||
mailcow_mail_policy = check_policy_service { unix:private/mailcow-policy, timeout=10s, try_limit=1, default_action=DEFER_IF_PERMIT }
|
||||
mailcow-policy_time_limit = 3600s
|
||||
|
||||
# DO NOT EDIT ANYTHING BELOW #
|
||||
|
||||
@@ -30,7 +30,7 @@ $value = fn(string $key): string => is_string($_POST[$key] ?? null) ? $_POST[$ke
|
||||
|
||||
try {
|
||||
$policy = \Mailcow\MailPolicy\MailPolicyModule::create($pdo, \Mailcow\Core\Context::system());
|
||||
echo $policy->api->check($value('sender'), $value('recipient'), $value('sasl_username'), (int)$value('server_port'));
|
||||
echo $policy->api->check($value('sender'), $value('recipient'), $value('sasl_username'), (int)$value('server_port'), $value('helo_name'));
|
||||
}
|
||||
catch (Throwable $e) {
|
||||
// the policy service answers with a temporary error
|
||||
|
||||
Reference in new issue
Block a user