It depends. I think mail gem will not break the API in 2.7.x so I think is safe to use ~> 2.5