On Thursday 10 July 2003 12:11 pm, Jesse Norell wrote:
> Hello,
>
>   I'm currently working on (ie. not finished) amavisd-new + virus
> scan + spamassasin - amavisd-new can do database lookups for your
> preferences (scan or not, tag or delete or ...) and supports both
> white and blacklists.  You might want to look into it (ie.
> amavisd-new - virus and/or spam scanning could be disabled if not
> desired).  Though if all you want is a simple whitelist, a quickly
> written script like you suggested may be easier.
>

I have this all working.  Here is my configuration for it.  I am using the 
dbmail tables modified to handle this stuff in amavisd-new.   You will have 
to modify the amavis script in order for this to work.  

The schema I have in my dbmail database:

--
-- Table structure for table 'aliases'
--

CREATE TABLE aliases (
  alias_idnr bigint(21) NOT NULL auto_increment,
  alias varchar(100) NOT NULL default '',
  deliver_to varchar(250) NOT NULL default '',
  client_idnr bigint(21) NOT NULL default '0',
  policy_id int(10) unsigned NOT NULL default '8',
  priority int(10) NOT NULL default '7',
  PRIMARY KEY  (alias_idnr),
  UNIQUE KEY alias_idnr_2 (alias_idnr),
  KEY alias (alias),
  KEY idx_alias (alias,deliver_to)
) TYPE=InnoDB;

--
-- Table structure for table 'mailaddr'
--

CREATE TABLE mailaddr (
  id int(10) unsigned NOT NULL auto_increment,
  priority int(10) NOT NULL default '7',
  email varchar(255) NOT NULL default '',
  PRIMARY KEY  (id),
  KEY email (email)
) TYPE=InnoDB;

--
-- Table structure for table 'policy'
--

CREATE TABLE policy (
  id int(10) unsigned NOT NULL auto_increment,
  policy_name varchar(64) default NULL,
  bypass_virus_checks char(1) default NULL,
  virus_lover char(1) default NULL,
  banned_files_lover char(1) default NULL,
  bypass_spam_checks char(1) default NULL,
  spam_modifies_subj char(1) default NULL,
  spam_tag_level float default NULL,
  spam_tag2_level float default NULL,
  spam_kill_level float default NULL,
  PRIMARY KEY  (id)
) TYPE=InnoDB;

--
-- Table structure for table 'wblist'
--

CREATE TABLE wblist (
  rid int(10) unsigned NOT NULL default '0',
  sid int(10) unsigned NOT NULL default '0',
  wb char(1) NOT NULL default '',
  PRIMARY KEY  (rid,sid)
) TYPE=InnoDB;


SQL lookups to add in amavisd.conf:

$sql_select_policy = 'SELECT * FROM aliases,policy'.
   ' WHERE (aliases.policy_id=policy.id) AND (aliases.alias IN (%k))'.
   ' ORDER BY aliases.priority DESC';

$sql_select_white_black_list = 'SELECT wb FROM wblist,mailaddr'.
   ' WHERE (rid=?) AND (sid=mailaddr.id) AND (mailaddr.email IN (%k))'.
   ' ORDER BY mailaddr.priority DESC';



Changes to amavisd-new script:

Around line 4580:
my $nf = sub {Amavis::Lookup::SQLfield->new($sql_policy,@_)}; #shorthand
$user_id_sql            = $nf->('alias_idnr',         'N');
$virus_lovers_sql       = $nf->('virus_lover',        'B0');

Line changed is the middle one.


You still have to configure all the rest of amavisd-new to do the virus and 
spam scanning, this will just get you the framework to get going.


-- 
Bret Baptist
Systems and Technical Support Specialist
[EMAIL PROTECTED]
Internet Exposure, Inc.
http://www.iexposure.com
 
(612)676-1946 x17
Web Development-Web Marketing-ISP Services
------------------------------------------


Today is the tomorrow you worried about yesterday.

Reply via email to