We won't say that creating the Edu email this way is totally legal. But doing so is also not totally wrong. So it is somewhere between legal and illegal.