Jernej, > >> I was wondering whether there is a way to find out with SQL query from > >> amavis database, which emails were sent through SA and which were not. > >> I know that it depends on the policy, but is there a way to combine > >> policy with msgs table?
> I am looking for emails that were sent through spam scanner in amavis (SA), > not just amavis. This means that I need to find out which emails were spam > scanned and which weren't (by setting bypass_spam in policy). > > I could do analyze logs for this, but it would be way more appropriate > using SQL, but I dont know whether this information is actually stored in > SQL or not. This information is currently not stored in msgs or msgrcpt tables. There is a msgs.policy (a policy bank path), but this is not what you are asking for. If you look in 'sub save_info_final' in a call to $conn_h->execute($ins_rcp, there is a commented-out argument: untaint($r->user_policy_id), which may help your needs. Uncommenting it, along with adding another '?' dummy arg and a field name to %sql_clause 'ins_rcp' may provide that information, but only if bypass_spam setting is coming from an SQL lookup. Other than that, a hack would be required. Mark ------------------------------------------------------------------------------ _______________________________________________ AMaViS-user mailing list AMaViS-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/amavis-user Please visit http://www.ijs.si/software/amavisd/ regularly For administrativa requests please send email to rainer at openantivirus dot org