Handle forwards as aliases with local copy
This commit is contained in:
@@ -34,17 +34,3 @@ map {
|
|||||||
username_field = email
|
username_field = email
|
||||||
value_field = reply_body
|
value_field = reply_body
|
||||||
}
|
}
|
||||||
|
|
||||||
map {
|
|
||||||
pattern = priv/forward_enabled
|
|
||||||
table = user
|
|
||||||
username_field = email
|
|
||||||
value_field = forward_enabled
|
|
||||||
}
|
|
||||||
|
|
||||||
map {
|
|
||||||
pattern = priv/forward_destination
|
|
||||||
table = user
|
|
||||||
username_field = email
|
|
||||||
value_field = forward_destination
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -22,8 +22,3 @@ if allof (string :is "${extdata.spam_enabled}" "1",
|
|||||||
if string :is "${extdata.reply_enabled}" "1" {
|
if string :is "${extdata.reply_enabled}" "1" {
|
||||||
vacation :days 1 :subject "${extdata.reply_subject}" "${extdata.reply_body}";
|
vacation :days 1 :subject "${extdata.reply_subject}" "${extdata.reply_body}";
|
||||||
}
|
}
|
||||||
|
|
||||||
if string :is "${extdata.forward_enabled}" "1" {
|
|
||||||
execute :pipe "forward" "${extdata.forward_destination}";
|
|
||||||
keep;
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,13 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# Get the mail content
|
|
||||||
FILENAME=/tmp/forward-$$
|
|
||||||
cat > $FILENAME <&0
|
|
||||||
|
|
||||||
# Actually send the emails
|
|
||||||
IFS=',' read -ra RECIPIENTS <<< "$1"
|
|
||||||
for RECIPIENT in "${RECIPIENTS[@]}"; do
|
|
||||||
sendmail -S smtp $RECIPIENT < $FILENAME
|
|
||||||
done
|
|
||||||
|
|
||||||
rm $FILENAME
|
|
||||||
@@ -4,7 +4,7 @@ query =
|
|||||||
FROM
|
FROM
|
||||||
(SELECT destination, email, wildcard, localpart FROM alias
|
(SELECT destination, email, wildcard, localpart FROM alias
|
||||||
UNION
|
UNION
|
||||||
SELECT email AS destination, email, 0 as wildcard, localpart FROM user)
|
SELECT email||(CASE WHEN forward_enabled=1 THEN ','||forward_destination ELSE '' END) AS destination, email, 0 as wildcard, localpart FROM user)
|
||||||
WHERE
|
WHERE
|
||||||
(
|
(
|
||||||
wildcard = 0
|
wildcard = 0
|
||||||
|
|||||||
Reference in New Issue
Block a user