is it ever possible to force SA and amavis to use database?
It should be since the 2.7.0 version of Amavisd-new which introduces the @sa_userconf_maps
configuration parameter. From the Amavisd-new release notes:
SpamAssassin will be requested to load a user preferences configuration
through its read_scoreonly_config() or load_scoreonly_sql() method, which
otherwise (in spamd) serves to load user's .spamassassin/user_prefs file
or SQL preferences when switching users. See SpamAssassin documentation
file sql/README for SQL details.
[...]
Example:
@sa_userconf_maps = (
{ 'user1@example.com' =>
'/etc/mail/spamassassin/special_user_config',
'.example.org' => 'sql:',
}
);
If not, what will be performace influence when i drop amavis and use SA directly with postfix?
Spamassassin/spamd would be able to filter mail, but Amavisd-new does a lot more than that. Your impact would not be not so much performance-wise (since Amavisd-new does just invoke the appropriate SpamAssassin functions, similar to what spamd is doing too) but you would lose Amavisd-new specific functionality like the lovers maps, the destiny configurations, the antivirus scanner integration, the attachment file type recognition, ...