I have a Ubuntu LAMP server in virtual box. I want to install postfix for sending and receiving mail using the server.
Is it compulsory to have a domain name to my ip address for installing postfix and using it for mailing purposes?
You should be able to set up Postfix for local forwarding/exchange with just an IP address - that should be no problem. Sending email to other email servers, however, probably won't work as many email servers do reverse DNS lookup on the FQDN to verify the server isn't on a blacklist somewhere.