rseichter / automx2

Mail User Agent (email client) configuration made easy
GNU General Public License v3.0
61 stars 19 forks source link

contrib/sqlite-generate.sh is only good for one domain #23

Closed realkinetix closed 3 months ago

realkinetix commented 3 months ago

In trying to get automx2 setup for several domains, I quickly noticed that sqlite-generate.sh wipes each table as it goes to add each entry.

DELETE FROM provider; DELETE FROM ldapserver; DELETE FROM server; DELETE FROM domain; DELETE FROM server_domain;

As I was only doing this for a very few domains, I changed around the deletes to be specific to the domain and server it rows at hand:

ie: DELETE FROM domain where name = '${DOMAIN}';

rseichter commented 3 months ago

The script works as designed, and it is not the preferred method of seeding automx2 with data anyway. The documentation shows how JSON can be used to populate the database without knowledge of the underlying structure.