So, i want to create a custom (lets call it "SPAM") folder in root (next to inbox, junk, tresh...) and set up a custom filter that will file mail in that folder directly.
Is there any way to do it for multiple users at once, or do I have to go user by user and set it up manually?
Any way to bulk create custom folders and filters?
- ccelis5215
- Outstanding Member
- Posts: 632
- Joined: Sat Sep 13, 2014 2:04 am
- Location: Caracas - Venezuela
- ZCS/ZD Version: 8.8.15.GA.3869.UBUNTU18.64 P12
Re: Any way to bulk create custom folders and filters?
Look in https://imanudin.net/2014/12/20/how-to- ... archiving/crnjaz wrote:So, i want to create a custom (lets call it "SPAM") folder in root (next to inbox, junk, tresh...) and set up a custom filter that will file mail in that folder directly.
Is there any way to do it for multiple users at once, or do I have to go user by user and set it up manually?
ccelis
Re: Any way to bulk create custom folders and filters?
ok, so i managed to scrap up something like this code:
and I get the
error, while running it as a zimbra user. (im runninng it from a scripts folder in /opt/zimbra)
what am I doing wrong?
Code: Select all
# !/bin/bash
# How to use : ./filter-set
MAIL="$(< mails.txt)" #mails from mails.txt file
for MAIL in $MAILS; do
zmmailbox -z -m $MAILS cf -c red "/SPAM"
zmmailbox -z -m $MAILS afrl "Spam" active any header "subject" contains "your account" fileinto "SPAM" stop
done
Code: Select all
syntax error near unexpected token `do
what am I doing wrong?
Re: Any way to bulk create custom folders and filters?
ok, i figured it had to be some copy/pasting problem, so i typed the file manually, but now im getting the following error:
what am i doing wrong?
edit: i also edited the mail loading line to load it from scripts/mails.txt so i could run it from root zimbra's folder, but still....
Code: Select all
./fillter-set.sh: line 5: syntax error near unexpected token `zmmailbox'
./fillter-set.sh: line 5: `zmmailbox -z -m $MAILS cf -c red "/SPAM"'
edit: i also edited the mail loading line to load it from scripts/mails.txt so i could run it from root zimbra's folder, but still....