Friends... I have Ubuntu server 12.04 on my computer and I have installed postfix to configure mail server.I want to send and receive mail from other domain like gmail and yahoo.I have already get a free domain.what should I do for this.should I have a public IP address for this.
Yes! If I do understand you right, would you be best of with a public static IP address for your domain.
Add a mx record and a spf record to the domain dns server.
spf record could be
v=spf1 mx -all.
To set up the server i suggest you to follow the instructions in the Ubuntu serverguide.