On what cabling to connect the transformer? On RS-232 standard cabling there are signals on every one of the 9 cables. So this is a little risky.

A 12V could do OK I supppose on short length. But on the 7805 a heat sink should also be used, and depending on the load, maybe a large one. That's why I suggest a cheap and easy switch mode regulator.

Ioannis