1

Currently i have working setup of postfix with virtual users which uses amavis (with SA and clamav) to filter messages.

The problem is, i need to allow every user to be able to adjust their SA settings. So i need to store SA settings in a database. Its quite simple to do when SA runs without amavis, but is it ever possible to force SA and amavis to use database?

If not, what will be performace influence when i drop amavis and use SA directly with postfix?

WombaT
  • 157
  • 1
  • 9
  • where exactly is your trouble for database-stored settings with amavisd-new? @sa_userconf_maps is available since 2.7.0, I have never used it myself, but suppose since 2.7.0 has been released for over a year now that it would do the job. – the-wabbit Dec 07 '12 at 08:12
  • Trouble is: i have to pass user to spamc daemon to be able to retrieve right settings - i cant find where amavis calls spamc to change it settings. – WombaT Dec 07 '12 at 08:23
  • Amavisd-new is not calling spamc or addressing spamd in any other way - it invokes the relevant Perl functionality directly from its own code. Thus, functionality unique to spamd is not available in Amavisd-new. But as I have noted in my answer, using @sa_userconf_maps should give you the ability to load per-user-configurations from a database. – the-wabbit Dec 07 '12 at 08:45

1 Answers1

1

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, ...

the-wabbit
  • 40,737
  • 13
  • 111
  • 174
  • actually, amavis is installed just because it was recommended to handle SA and clamav in one of howtos for postfix. I dont think i will ever need any more functionality. – WombaT Dec 07 '12 at 09:21
  • i have placed in `/etc/amavis/conf.d/50-user` this: `@sa_userconf_maps = ( { '.*' => 'sql:', } ); @sa_username_maps = new_RE ( [ qr'^([^@]+@.*)'i => '${1}' ] );` but i cant see any use of sql in debug log, and user options are ignored (defaults used) – WombaT Dec 07 '12 at 09:54