This definitely rocks. I was just tying to keep the example simple to show the logic flow but I actually need this routine for an unrelated project, thanks! Anyone have pointers to the best implementation of the SQL userpref's for SpamAssassin and MimeDefang? KAM