[GH-ISSUE #130] blacklist.conf disable multiple addesses #102

Closed
opened 2026-02-27 08:14:21 +03:00 by kerem · 1 comment
Owner

Originally created by @antonzhelyazkov on GitHub (Mar 1, 2019).
Original GitHub issue: https://github.com/lucascbeyeler/zmbackup/issues/130

Originally assigned to: @lucascbeyeler on GitHub.

ISSUE TYPE:
  • Question
ENVIRONMENT VERSION:
  • Zmbackup Version: 1.2.3
  • Zimbra Version: 8.8.9
  • Linux Distribution & Version: Centos 7
SUMMARY:

-blacklist.conf multiple addresses

Hi, we have a lot of email boxes which begins with prefix old_ . Could I create entry in blacklist.conf like old_* which should mean to skip all boxes with prefix old_ or I should create entry for all mail boxes ?

Originally created by @antonzhelyazkov on GitHub (Mar 1, 2019). Original GitHub issue: https://github.com/lucascbeyeler/zmbackup/issues/130 Originally assigned to: @lucascbeyeler on GitHub. ##### ISSUE TYPE: - Question ##### ENVIRONMENT VERSION: - Zmbackup Version: 1.2.3 - Zimbra Version: 8.8.9 - Linux Distribution & Version: Centos 7 ##### SUMMARY: -blacklist.conf multiple addresses Hi, we have a lot of email boxes which begins with prefix old_ . Could I create entry in blacklist.conf like old_* which should mean to skip all boxes with prefix old_ or I should create entry for all mail boxes ?
kerem 2026-02-27 08:14:21 +03:00
  • closed this issue
  • added the
    Question
    label
Author
Owner

@ananiasfilho commented on GitHub (Jul 28, 2019):

Its not possible.
To make your process little easy, please, try it:

zmprov -l gaa|grep "old_"
copy all accounts that have old_ and join on /etc/zmbackup/blacklist.conf

Ok?
I have spent 2 minutes and created a script for tests purposes:
!!!Run script as zimbra user - not sudo or root!!!

#!/bin/bash
BLACKLIST_FILE="/etc/zmbackup/blacklist.conf"
COUNT_TOTAL=0
clear
echo ""
### ATENTION!!!!
### Change -> grep -E '^old_' on line bellow and add any prefix that you want. The ^ in line is 'start with old_ dont remove ^ just change old_
for accounts in `zmprov -l gaa|grep -E '^old_'`; do
        accounts_count=`grep $accounts $BLACKLIST_FILE|wc -l`
        if [ $accounts_count -eq 0 ] ; then
                COUNT_TOTAL=$((COUNT_TOTAL+1))
                echo $accounts >> $BLACKLIST_FILE
                if [ $? -eq 0 ] ; then
                        echo ">> $accounts add into Blacklist file $BLACKLIST_FILE [SUCCESS]"
                else
                    	echo "!! $accounts add into Blacklist file $BLACKLIST_FILE [FAIL]"
                fi
        fi
done
echo ""
echo "###########################################################################"
echo "# "
if [ $COUNT_TOTAL -lt 1 ]; then
        echo "#  No new accounts to add into Blacklist file $BLACKLIST_FILE"
else
    	echo "#  Accounts include into Blacklist file $BLACKLIST_FILE: $COUNT_TOTAL accounts"
fi
echo ""
echo ""


<!-- gh-comment-id:515768095 --> @ananiasfilho commented on GitHub (Jul 28, 2019): Its not possible. To make your process little easy, please, try it: zmprov -l gaa|grep "old_" copy all accounts that have old_ and join on /etc/zmbackup/blacklist.conf Ok? I have spent 2 minutes and created a script for tests purposes: **!!!Run script as zimbra user - not sudo or root!!!** ``` #!/bin/bash BLACKLIST_FILE="/etc/zmbackup/blacklist.conf" COUNT_TOTAL=0 clear echo "" ### ATENTION!!!! ### Change -> grep -E '^old_' on line bellow and add any prefix that you want. The ^ in line is 'start with old_ dont remove ^ just change old_ for accounts in `zmprov -l gaa|grep -E '^old_'`; do accounts_count=`grep $accounts $BLACKLIST_FILE|wc -l` if [ $accounts_count -eq 0 ] ; then COUNT_TOTAL=$((COUNT_TOTAL+1)) echo $accounts >> $BLACKLIST_FILE if [ $? -eq 0 ] ; then echo ">> $accounts add into Blacklist file $BLACKLIST_FILE [SUCCESS]" else echo "!! $accounts add into Blacklist file $BLACKLIST_FILE [FAIL]" fi fi done echo "" echo "###########################################################################" echo "# " if [ $COUNT_TOTAL -lt 1 ]; then echo "# No new accounts to add into Blacklist file $BLACKLIST_FILE" else echo "# Accounts include into Blacklist file $BLACKLIST_FILE: $COUNT_TOTAL accounts" fi echo "" echo "" ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/zmbackup#102
No description provided.