mirror of
https://github.com/Mailu/Mailu.git
synced 2025-04-13 11:40:41 +02:00
Allow forward to multiple destinations, fixes #34
This commit is contained in:
parent
f2ff1eb955
commit
692bcda868
@ -8,6 +8,7 @@ require "regex";
|
||||
require "relational";
|
||||
require "comparator-i;ascii-numeric";
|
||||
require "vnd.dovecot.extdata";
|
||||
require "vnd.dovecot.execute";
|
||||
require "spamtestplus";
|
||||
|
||||
if allof (string :is "${extdata.spam_enabled}" "1",
|
||||
@ -23,6 +24,6 @@ if string :is "${extdata.reply_enabled}" "1" {
|
||||
}
|
||||
|
||||
if string :is "${extdata.forward_enabled}" "1" {
|
||||
redirect "${extdata.forward_destination}";
|
||||
execute :pipe "forward" "${extdata.forward_destination}";
|
||||
keep;
|
||||
}
|
||||
|
13
dovecot/sieve/bin/forward
Executable file
13
dovecot/sieve/bin/forward
Executable file
@ -0,0 +1,13 @@
|
||||
#!/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
|
Loading…
x
Reference in New Issue
Block a user