Page 1 of 1

How To Mass Import Whitelists and Blacklists

Posted: 21 Sep 2014 19:40
by shawniverson
Mass import script is now available here:

https://raw.githubusercontent.com/E-F-A ... timport.sh

To download:

Code: Select all

wget https://raw.githubusercontent.com/E-F-A/v3/master/tools/listimport.sh 
chmod ugo+x userimport.sh
EFA Mass Whitelist and Blacklist Import Help

listimport.sh Copyright (C) 2014 efa-project.org
Licened GNU GPL v3. This program comes with ABSOLUTELY NO WARRANTY
This is free software, and you are welcome to redistribute it under
certain conditions. See http://www.gnu.org/licenses for more details

Usage: listimport.sh -f mylist -b|-w [-a|-o [-q]]
-f Whitelist or Blacklist File
-a append to existing list
-b File is a Blacklist
-q force overwrite database tables without prompting
-o overwrite existing list
-w File is a Whitelist

Whitelist and Blacklist is newline separated list with each
line in either of the following formats:

<From Address Domain or IP>, <To Address Domain or IP>
<From Address Domain or IP>
Examples:

Code: Select all

sudo /path/to/listimport.sh -f /path/to/mywhitelist.txt -a -w

Code: Select all

sudo /path/to/listimport.sh -f /path/to/myblacklist.txt -a -b
Use the overwrite feature with caution. Always back up prior to executing your mass import.

Re: How To Mass Import Whitelists and Blacklists

Posted: 17 Feb 2017 15:19
by SupportOU
Hola!

Is there also a mass export functionality??

Grtz,
Ronald

Re: How To Mass Import Whitelists and Blacklists

Posted: 17 Feb 2017 23:33
by shawniverson
Should be pretty straightforward.

Re: How To Mass Import Whitelists and Blacklists

Posted: 17 Feb 2017 23:33
by shawniverson

Re: How To Mass Import Whitelists and Blacklists

Posted: 29 Mar 2018 12:08
by enricosx
thanks for yours hard work.

what is the correct syntax?

domain.com
or
*domain.com
or
*@domain.com

Re: How To Mass Import Whitelists and Blacklists

Posted: 05 Jan 2019 18:48
by shawniverson
Wildcards should not be used.

Re: How To Mass Import Whitelists and Blacklists

Posted: 14 Feb 2020 20:26
by liam87
If you would like to use this script with eFa 4.0 just replace the line

Code: Select all

MAILWATCHSQLPWD=`grep MAILWATCHSQLPWD /etc/EFA-Config | sed 's/.*://'`
with

Code: Select all

MAILWATCHSQLPWD="`grep MAILWATCHSQLPWD /etc/eFa/MailWatch-Config | sed 's/.*://'`"