Exporting blacklist/whitelist

Bugs in eFa 4
Post Reply
Justin
Posts: 111
Joined: 18 Sep 2014 13:00
Location: The Netherlands
Contact:

Exporting blacklist/whitelist

Post by Justin »

Hi there,

Our backup EFA MX crashed, which wasnt used a lot anyway.
So i would like to setup a new one with v4.

How can i Export the blacklist/whitelist from my primary EFA MX v3 and import them in my clean EFA MX v4?
Found this topic, but i only want the two lists instead of the whole system.

Kind regards,
Justin
User avatar
shawniverson
Posts: 3644
Joined: 13 Jan 2014 23:30
Location: Indianapolis, Indiana USA
Contact:

Re: Exporting blacklist/whitelist

Post by shawniverson »

Yes, you can.

At a high level, you need to:

  • Export the whitelist and blacklists from the mailscanner database in mysql
  • Import the whitelist and blacklist into the new mailscanner database in mariadb

If this is a lot for you to do, hang in there. I probably can make a smaller import tool that can just grab these lists for you instead from a v3 backup.
User avatar
shawniverson
Posts: 3644
Joined: 13 Jan 2014 23:30
Location: Indianapolis, Indiana USA
Contact:

Re: Exporting blacklist/whitelist

Post by shawniverson »

Actually, this is so simple, it is probably easier just to make a little howto...

Step 1

Run these commands on the v3 as root

Code: Select all

MYSQLPWD=$(grep MYSQLROOTPWD /etc/EFA-Config | sed -e 's/^.*://')
mysqldump --user=root --password=$MYSQLPWD mailscanner blacklist > list.sql
mysqldump --user=root --password=$MYSQLPWD mailscanner whitelist >> list.sql
MYSQLPWD=
Step 2

Copy the list.sql from your v3 to v4 using whatever means

Step 3

Run this on the v4 as root

Code: Select all

MYSQLPWD=$(grep MYSQLROOTPWD /etc/eFa/MySQL-Config | sed -e 's/^.*://')
mysql --user=root --password=$MYSQLPWD mailscanner < list.sql
MYSQLPWD=
Justin
Posts: 111
Joined: 18 Sep 2014 13:00
Location: The Netherlands
Contact:

Re: Exporting blacklist/whitelist

Post by Justin »

shawniverson wrote: 10 Feb 2019 16:10 Actually, this is so simple, it is probably easier just to make a little howto...

Step 1

Run these commands on the v3 as root

Code: Select all

MYSQLPWD=$(grep MYSQLROOTPWD /etc/EFA-Config | sed -e 's/^.*://')
mysqldump --user=root --password=$MYSQLPWD mailscanner blacklist > list.sql
mysqldump --user=root --password=$MYSQLPWD mailscanner whitelist >> list.sql
MYSQLPWD=
Step 2

Copy the list.sql from your v3 to v4 using whatever means

Step 3

Run this on the v4 as root

Code: Select all

MYSQLPWD=$(grep MYSQLROOTPWD /etc/eFa/MySQL-Config | sed -e 's/^.*://')
mysql --user=root --password=$MYSQLPWD mailscanner < list.sql
MYSQLPWD=
Thank you!
Had no idea where to begin, but this works perfectly!
Post Reply