Ok, so after googling a little bit, seems like I found a solution for this problem.
There is a possibility to make amavis check the database for the list of local domains.
This works by adding $sql_select_policy and @lookup_sql_dsn with the DB connection info.
Possibly this would be a good change for 0.6.0.
The following changes have been done by myself:
@local_domains_maps commented out, select added.
Please be aware, that my current query assumes all of my domains beeing local. It would be an option to extend the SQL schema to have a real "local" flag per domain.
#@local_domains_maps = ( [".$mydomain","mail.mydomain.de"] ); # list of all local domains
$sql_select_policy = 'SELECT "Y" AS local FROM domain WHERE CONCAT("@", domain) IN (%k)';
Second required change was to add DSN information for DB to amavis
@lookup_sql_dsn = ( ['DBI:mysql:database=vmail;host=127.0.0.1;port=3306', 'vmail', 'your password comes here'] );
# @lookup_sql_dsn =
# ( ['DBI:mysql:database=mail;host=127.0.0.1;port=3306', 'user1', 'passwd1'],
# ['DBI:mysql:database=mail;host=host2', 'username2', 'password2'],
# ["DBI:SQLite:dbname=$MYHOME/sql/mail_prefs.sqlite", '', ''] );
Hopefully this helps others.
This was very critical to myself, as I have other ppl having access to postfixAdmin but not to the physical machine.
This way they are able to add new domains with spam filtering activated.
Regards,
Phil