Grant, 29, made 24 appearances for Vale this season, but moves to the ABAX Stadium on a two-and-a-half-year deal.
Striker Mackail-Smith, 32, has scored only five goals in 40 games for Luton since joining the club in August 2015.
He scored 99 goals in 212 games for Posh from 2007-2011, before returning for a one-month loan spell in 2014.
The Scotland international has made six appearances this season, with three of those coming in the EFL Trophy.
"Unfortunately we haven't seen the best of Craig due to his injuries, but with a prolonged run of games I'm sure he'll be an asset," Luton manager Nathan Jones said.
Posh chairman Darragh MacAnthony said on Twitter that Mackail-Smith had insisted that he would pay back his wages if he was not fit to play whilst on loan.
Find all the latest football transfers on our dedicated page or visit our Premier League tracker here.
Peterborough have signed Port Vale midfielder Anthony Grant for a "six-figure fee" and Luton's Craig Mackail-Smith on loan to the end of the term.