My little developer mind never really managed to understand how to do it, so maybe you can help me.
I'm using Google Apps for Domains and MyDomain as DNS external service.
Edit: Tough crowd, in Google apps says:
Change the SPF record to fight SPAM (optional)
You may define the SPF record to authorize only certain IP addresses to send email for your domain. This will prevent spammers from sending unauthorized email under a forged address from your domain.