Hi Filippo!
I´ve travelled in Mosambique and Malawi in 99. I don´t think you can obtained visas on the boarder.
The easiest way I think is obtained visa in some other African countries. E.g. Cape Town is pretty easy and cheap to obtaine visa for Mosambique. Visa for Malawi took me almost 3 weeks!!!
Premek