Metal detector for bulk materials with flap rejection