The first is straightforward and works well for all but the biggest sites. The other thing you do is to block spams from traversing your system. This is more difficult because older mailers don't give you a good way to look at the originating address. The Transport Security Initiative is also part of the MAPS project . The listed packages are believed to be available without charge.
Commercial packages are available on a separate page .
You block your SMTP port by turning off your mailers SMTP daemon mode and run it out of inetd instead. This is a sample, your exact paths would vary. Be aware, though, that this could load your mail server down . It will run a separate process for each incoming mail message. If your server is small relative to your load, you should investigate one of the other techniques listed here.