What should I use for SPF record for my domain?

I have example1.com hosted on host.example2.com. Typical cpanel scenario. And:

  1. And example1.com is installed with Magento which sends many sorts of emails to the users from host.example2.com.
  2. And I also set up example1.com with Google Apps with its MX entries as required by them.

Very typical. So I came up with this SPF record for example1.com:

v=spf1 a mx include:host.example2.com include:_spf.google.com -all

Is this correct?

It seems not because when I used the on-site contact form on example1.com to send a test visitor message (which was sent to my Google Apps email from host.example2.com), the email I received in Google Apps inbox was still with a ‘via’ field (via host.example2.com). I figure this means Google email takes this message to be not sent by example1.com ITSELF?

This record has been created since 2 days ago and the ‘via’ field was still present when example1.com tries to send a message from the server of host.example2.com.

If anyone could enlighten me on this that’d be really appreciated! Thanks!

The SPF entry itself looks ok to me. I would assume Google will always show a ‘via’ for an email that has domain1.com but the server is called host.domain2.com

One thing you could check with Magento, is its using an actual SMTP server to send mail via, rather than just using the simple mail() function in PHP - this allows slightly more control over how the email goes out from the system.