Amavisd question

Benedict White via amavis-users amavis-users at amavis.org
Tue Sep 3 10:43:53 CEST 2013


-----Original Message-----
From: Alan Davies [mailto:adavies at itcs.co.uk] 
Sent: 03 September 2013 09:19
To: Benedict White; amavis-users at amavis.org
Subject: RE: Amavisd question

Hi Benedict, 
>
>conf file no comments:
>
>use strict;
>
...
>$sql_select_policy =
 >'SELECT *,users.id'.
 >' FROM users LEFT JOIN policy ON users.policy_id=policy.id'.
>' WHERE users.email IN (%k) ORDER BY users.priority DESC';  $sql_select_white_black_list =  'SELECT wb'.
> ' FROM wblist JOIN mailaddr ON wblist.sid=mailaddr.id'.
> ' WHERE wblist.rid=? AND mailaddr.email IN (%k)'.
 >' ORDER BY mailaddr.priority DESC';
> %sql_clause = (
> 'sel_policy' => \$sql_select_policy,
> 'sel_wblist' => \$sql_select_white_black_list,  'sel_adr' =>  'SELECT id FROM maddr WHERE partition_tag=? AND email=?',  'ins_adr' =>  'INSERT INTO maddr (partition_tag, email, domain) VALUES (?,?,?)',  'ins_msg' =>  'INSERT >INTO msgs (partition_tag, mail_id, secret_id, am_id,'.
> ' time_num, time_iso, sid, policy, client_addr, size, host)'.
> ' VALUES (?,?,?,?,?,?,?,?,?,?,?)',
> 'upd_msg' =>
> 'UPDATE msgs SET content=?, quar_type=?, quar_loc=?, dsn_sent=?,'.
> ' spam_level=?, message_id=?, from_addr=?, subject=?, client_addr=?,'.
> ' originating=?'.
> ' WHERE partition_tag=? AND mail_id=?',  'ins_rcp' =>  'INSERT INTO msgrcpt (partition_tag, mail_id, rseqnum, rid, is_local,'.
> ' content, ds, rs, bl, wl, bspam_level, smtp_resp)'.
> ' VALUES (?,?,?,?,?,?,?,?,?,?,?,?)',
> 'ins_quar' =>
> 'INSERT INTO quarantine (partition_tag, mail_id, chunk_ind, mail_text)'.
> ' VALUES (?,?,?,?)',
> 'SELECT partition_tag FROM msgs WHERE mail_id=?',  'sel_quar' =>  'SELECT mail_text FROM quarantine'.
> ' WHERE partition_tag=? AND mail_id=?'.
> ' ORDER BY chunk_ind',
> "SELECT msgs.time_num, msgs.mail_id, subject".
> " FROM msgs JOIN msgrcpt USING (partition_tag,mail_id)".
> " WHERE sid=? AND rid=? AND msgs.content!='V' AND ds='P'".
> "SELECT msgs.time_num, msgs.mail_id, subject, message_id, rid".
> " FROM msgs JOIN msgrcpt USING (partition_tag,mail_id)".
> " WHERE sid=? AND msgs.content!='V' AND ds='P' AND message_id IN (%m)".
> " AND rid!=sid".
> );




I do not have this whole section in my conf file, I just have the dsn settings.

In that sense, I use sql lookups and quarantine but I leave the queries as default, which leads me to suspect that your issue lies in the queries somewhere.

Can you try commenting them out and seeing what that changes?

Kind regards

Benedict White



More information about the amavis-users mailing list