User the command below: example user is testsharedmbox@example.com
as zimbra user at cli, execute:
zmprov ga testsharedmbox@example.com zimbraMailSieveScript
Output below:
# name testsharedmbox@example.com
zimbraMailSieveScript: require ["fileinto", "reject", "tag", "flag"];
# Redirect
if anyof (header :matches ["subject"] "*") {
redirect "user1@yahoo.com";
redirect "user2@gmail.com";
redirect "user3@linux.com";
keep;
stop;
}
So just imagine if you have 1000 redirect, so just use a little bash. Convert the above output to become like below as bash executable.
####
zmprov ma testsharedmbox@example.com zimbraMailSieveScript 'require ["fileinto", "reject", "tag", "flag"];
# Redirect
if anyof (header :matches ["subject"] "*") {
redirect "user1@yahoo.com";
redirect "user2@gmail.com";
redirect "user3@linux.com";
keep;
stop;
}'
# Redirect
if anyof (header :matches ["subject"] "*") {
redirect "user1@yahoo.com";
redirect "user2@gmail.com";
redirect "user3@linux.com";
keep;
stop;
}'
####