Hi Bret. I'm using amavis-new to do virus checking and I want to use ther
spamassassin component to check for spam. But I don't think is correct to
modified dbmail database to provied support for this functions, because it
will be a real nightmare when dbmail schemas changes.

I think the better approach will be to create a separate database to
manage the amavis-new lookups and use scripts to maintain in sync your
dbmail aliases database and amavis-new support table.

> On Thursday 10 July 2003 2:53 pm, Bret Baptist wrote:
>> 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.
>
> One thing to keep in mind with this, in wblist you need to put the
> 'aliases.alias_idnr' in for the 'rid'.  I am not sure if that is obvious
> or
> not.
>
>
>
> --
> 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.
>
> _______________________________________________
> Dbmail mailing list
> [email protected]
> https://mailman.fastxs.nl/mailman/listinfo/dbmail
>

Reply via email to