Rspamd user settings: don't print all email addresses of a domain
The ucl_rcpts function can already deal with domains, so lets use this capability.
This commit is contained in:
parent
93a092e627
commit
fcd8cfa4f4
@ -83,7 +83,7 @@ function ucl_rcpts($object, $type) {
|
|||||||
$rcpt[] = '/.*@' . $object . '/i';
|
$rcpt[] = '/.*@' . $object . '/i';
|
||||||
$stmt = $pdo->prepare("SELECT `alias_domain` FROM `alias_domain`
|
$stmt = $pdo->prepare("SELECT `alias_domain` FROM `alias_domain`
|
||||||
WHERE `target_domain` = :object");
|
WHERE `target_domain` = :object");
|
||||||
$stmt->execute(array(':object' => $row['object']));
|
$stmt->execute(array(':object' => $object));
|
||||||
$alias_domains = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
$alias_domains = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||||
array_filter($alias_domains);
|
array_filter($alias_domains);
|
||||||
while ($row = array_shift($alias_domains)) {
|
while ($row = array_shift($alias_domains)) {
|
||||||
@ -112,7 +112,7 @@ while ($row = array_shift($rows)) {
|
|||||||
score_<?=$username_sane;?> {
|
score_<?=$username_sane;?> {
|
||||||
priority = 4;
|
priority = 4;
|
||||||
<?php
|
<?php
|
||||||
foreach (ucl_rcpts($row['object'], 'mailbox') as $rcpt) {
|
foreach (ucl_rcpts($row['object'], strpos($row['object'], '@') === FALSE ? 'domain' : 'mailbox') as $rcpt) {
|
||||||
?>
|
?>
|
||||||
rcpt = "<?=$rcpt;?>";
|
rcpt = "<?=$rcpt;?>";
|
||||||
<?php
|
<?php
|
||||||
@ -158,7 +158,7 @@ while ($row = array_shift($rows)) {
|
|||||||
?>
|
?>
|
||||||
priority = 5;
|
priority = 5;
|
||||||
<?php
|
<?php
|
||||||
foreach (ucl_rcpts($row['object'], 'mailbox') as $rcpt) {
|
foreach (ucl_rcpts($row['object'], strpos($row['object'], '@') === FALSE ? 'domain' : 'mailbox') as $rcpt) {
|
||||||
?>
|
?>
|
||||||
rcpt = "<?=$rcpt;?>";
|
rcpt = "<?=$rcpt;?>";
|
||||||
<?php
|
<?php
|
||||||
@ -168,7 +168,7 @@ while ($row = array_shift($rows)) {
|
|||||||
?>
|
?>
|
||||||
priority = 6;
|
priority = 6;
|
||||||
<?php
|
<?php
|
||||||
foreach (ucl_rcpts($row['object'], 'mailbox') as $rcpt) {
|
foreach (ucl_rcpts($row['object'], strpos($row['object'], '@') === FALSE ? 'domain' : 'mailbox') as $rcpt) {
|
||||||
?>
|
?>
|
||||||
rcpt = "<?=$rcpt;?>";
|
rcpt = "<?=$rcpt;?>";
|
||||||
<?php
|
<?php
|
||||||
@ -199,7 +199,7 @@ while ($row = array_shift($rows)) {
|
|||||||
?>
|
?>
|
||||||
priority = 5;
|
priority = 5;
|
||||||
<?php
|
<?php
|
||||||
foreach (ucl_rcpts($row['object'], 'mailbox') as $rcpt) {
|
foreach (ucl_rcpts($row['object'], strpos($row['object'], '@') === FALSE ? 'domain' : 'mailbox') as $rcpt) {
|
||||||
?>
|
?>
|
||||||
rcpt = "<?=$rcpt;?>";
|
rcpt = "<?=$rcpt;?>";
|
||||||
<?php
|
<?php
|
||||||
@ -209,7 +209,7 @@ while ($row = array_shift($rows)) {
|
|||||||
?>
|
?>
|
||||||
priority = 6;
|
priority = 6;
|
||||||
<?php
|
<?php
|
||||||
foreach (ucl_rcpts($row['object'], 'mailbox') as $rcpt) {
|
foreach (ucl_rcpts($row['object'], strpos($row['object'], '@') === FALSE ? 'domain' : 'mailbox') as $rcpt) {
|
||||||
?>
|
?>
|
||||||
rcpt = "<?=$rcpt;?>";
|
rcpt = "<?=$rcpt;?>";
|
||||||
<?php
|
<?php
|
||||||
@ -250,7 +250,7 @@ while ($row = array_shift($rows)) {
|
|||||||
?>
|
?>
|
||||||
priority = 5;
|
priority = 5;
|
||||||
<?php
|
<?php
|
||||||
foreach (ucl_rcpts($row['object'], 'mailbox') as $rcpt) {
|
foreach (ucl_rcpts($row['object'], strpos($row['object'], '@') === FALSE ? 'domain' : 'mailbox') as $rcpt) {
|
||||||
?>
|
?>
|
||||||
rcpt = "<?=$rcpt;?>";
|
rcpt = "<?=$rcpt;?>";
|
||||||
<?php
|
<?php
|
||||||
@ -260,7 +260,7 @@ while ($row = array_shift($rows)) {
|
|||||||
?>
|
?>
|
||||||
priority = 6;
|
priority = 6;
|
||||||
<?php
|
<?php
|
||||||
foreach (ucl_rcpts($row['object'], 'mailbox') as $rcpt) {
|
foreach (ucl_rcpts($row['object'], strpos($row['object'], '@') === FALSE ? 'domain' : 'mailbox') as $rcpt) {
|
||||||
?>
|
?>
|
||||||
rcpt = "<?=$rcpt;?>";
|
rcpt = "<?=$rcpt;?>";
|
||||||
<?php
|
<?php
|
||||||
@ -291,7 +291,7 @@ while ($row = array_shift($rows)) {
|
|||||||
?>
|
?>
|
||||||
priority = 5;
|
priority = 5;
|
||||||
<?php
|
<?php
|
||||||
foreach (ucl_rcpts($row['object'], 'mailbox') as $rcpt) {
|
foreach (ucl_rcpts($row['object'], strpos($row['object'], '@') === FALSE ? 'domain' : 'mailbox') as $rcpt) {
|
||||||
?>
|
?>
|
||||||
rcpt = "<?=$rcpt;?>";
|
rcpt = "<?=$rcpt;?>";
|
||||||
<?php
|
<?php
|
||||||
@ -301,7 +301,7 @@ while ($row = array_shift($rows)) {
|
|||||||
?>
|
?>
|
||||||
priority = 6;
|
priority = 6;
|
||||||
<?php
|
<?php
|
||||||
foreach (ucl_rcpts($row['object'], 'mailbox') as $rcpt) {
|
foreach (ucl_rcpts($row['object'], strpos($row['object'], '@') === FALSE ? 'domain' : 'mailbox') as $rcpt) {
|
||||||
?>
|
?>
|
||||||
rcpt = "<?=$rcpt;?>";
|
rcpt = "<?=$rcpt;?>";
|
||||||
<?php
|
<?php
|
||||||
|
Loading…
Reference in New Issue
Block a user