changed the sql select for amavis

Signed-off-by: Alexander Skjolden <alex@plastboks.net>