I have a Google Apps Script attached to a spreadsheet, and it uses MailApp.SendMail().
MailApp.sendEmail(recipient, subject, body, {
noReply: true,
htmlBody: htmlBody,
name: emailFromName,
replyTo: replyToEmailAddress,
cc: ccEmailAddress
});
I am running this from an account under my own domain myowndomain.com I'm using gmail to manage the email from this domain.
I have SPF and DKIM configured and they work in general. My DMARC is currently set to Quarantine, but I want to move it to Reject.
If I send mail from my personal outbox, either through gmail or another mail client through IMAP, everything is fine. SPF, DKIM and DMARC all pass.
However, any mail that is sent from the script passes SPF but fails DMARC. I don't think that DKIM is being triggered. From what I've read it's because the SPF check is from google's domain and the DMARC is from myowndomain.com.
Received-SPF: pass (google.com: domain of blahblah@maestro.bounces.google.com designates xxx.xxx.xxx.xxx as permitted sender)
dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=QUARANTINE) header.from=myowndomain.com
I have to believe that other people have done this and that there's a solution.
Is there a way to configure either the script or my DMARC/DKIM/SPF records so that they pass and my script-generated messages don't end up in spam?