Best way to start amavisd-snmp-subagent?

Deeztek Support via amavis-users amavis-users at
Mon Aug 26 11:12:05 CEST 2013

> On 8/25/2013 9:51 AM, Benedict White wrote:
>>> Benedict White
>>> I don't have a user's table. I have a recipients table but I'm not
>>> referencing that table in the query. I would have to do a join 
>>> statement
>>> wouldn't I?
>> Has the problem been fixed now?
>> Kind regards
>> Benedict White
> Yes I figured it out. Since I had to have a recipients table due to a 
> custom application that relies on a recipients table and I didn't want 
> to change a bunch of code, I created a mysql users view that linked to 
> the recipients table. I put the following two queries in the 
> /etc/amavis/conf.d/50-users file (both from the amavis docs):
> $sql_select_policy = 'SELECT *, FROM users,policy'.
> ' WHERE ( AND ( IN (%k))';
> $sql_select_white_black_list = 'SELECT wb FROM wblist,mailaddr WHERE 
> (wblist.rid=?) AND ( AND ( IN 
> (%k)) ORDER BY mailaddr.priority DESC';
> then I determined the recipients from the users view which in 
> this case was 400.  Then I inserted the sender to be whitelisted in 
> the mailaddr table and I took note of the id of the sender which in 
> this case was 1. In the wblist table, I entered it as follows where 
> rid is 400, sid is 1 and W is whitelisted:
> rid        sid        wb
> 400        1          W
> However that still didn't work the test message was still getting 
> blocked. After looking at the amavis log closer I noticed that when it 
> was getting the from the first query it was actually getting a 
> value of 7 for the Now, 7 just happened to be the policy_id. 
> I ran the sql_select_policy query manually in mysql and I got back the 
> correct but there was also an id1 in the results that was 
> showing up which also equaled 7. So I figured for some strange reason 
> amavis was getting the id1 from the result and using that as the 
> So I adjusted the sql_select_policy query as follows:
> $sql_select_policy = 'SELECT, users.policy_id, 
> FROM users,policy'.
> ' WHERE ( AND ( IN (%k))';
> As you can see instead of using SELECT *,, users.policy_id I 
> specified each field to be selected instead of *. When I ran that 
> query manually it didn't show an id1 result so when I tested it with 
> amavis it worked like a charm. Amavis whitelisted the message. I also 
> verified in the email headers that amavis whitelisted.
> Hopefully this helps someone.
> Now next question. I'm getting this error in my amavis logs concerning 
> razor2.
> razor2: razor2 check failed: No such file or directory razor2: Can't 
> read conf file: /root/.razor/razor-agent.conf at 
> /usr/share/perl5/Mail/SpamAssassin/Plugin/ line 325.
> The razor-agent.conf file exists in that location so I'm not 
> understanding why it doesn't work.
> Thanks in advance

More information about the amavis-users mailing list