The more I think about it from Boston's side, the more this deal seems solid for them. I personally think Korpisalo is ass and have been adamant about that, but I don't think it's a stretch to say that they can get a good performance out of him like they've gotten good performances out of so many other goalies in the past. The term is the part that really sucks, but the $3 million AAV isn't all that bad for a 1B goalie.
Before Ullmark played for Buffalo, he had a career 3.1 GSAA, he was basically the definition of an average goalie. On Boston? He had a 72.8 GSAA in just 13 more games played. If they can improve Korpisalo by a similar amount as they improved Ullmark (so not make him a Vezina goalie, just have his improvement total be similar), Korpisalo seems like he'd be a good 1B goalie.
I think Boston actually wants Korpisalo as their backup/1B goalie. They have a terrific track record of getting great results out of goalies, so it's hard to criticize their thinking.