Infrared regularization of Yang-Mills theories