0

I've set up some google apps mailing groups, but emails from nodemailer to the groups are always getting 'bounced' (but no bounce-back email).

Individual gmail addresses receive the same nodemail fine. The admin email log looks like this for successful email to individual gmail user address. The email headers from the successful email show no issues (eg no spf failures).

The groups do receive emails from external users (including from the same address nodemailer uses) when sent through the gmail web client, so it it isn't a group permission issue. Successful emails to the group yields an admin log like this.

The group is set to forward all spam to users.

Nodemailer is using a gmail account, and the GApps are using a Google domain hosted address, so it shouldn't be an issue with routing or conflicting servers

What am I missing here?

Dharman
  • 30,962
  • 25
  • 85
  • 135
defraggled
  • 1,014
  • 11
  • 13

1 Answers1

0

This was resolved by reconfiguring the 'from' field in the nodemailer message.

// Nodemailer ignores the bad `from` value (not a valid email)
// Nodemailer sends with from ==''
// This gets bounced by google group addresses
var msg = {
        from: "System",
        to: "usergroupaddress@gmail.com,
        subject: "Your generated email",
        text: "Hello user",
        html: "<p>Hello user</p>"
    };

I had thought 'from' would define the name displayed on the email. It didn't do that, but it didn't cause any problems either for most email recipients. But google groups was bouncing those emails.

Nodemailer was just leaving 'from' as blank (rather than using my dummy string). Apparently this field must be a valid email address. Set it to an email address, and nodemailer will include it in the message envelope, which google groups will then stop bouncing.

// Nodemailer accepts and forwards the valid `from`
// google groups address will accept the email
var msg = {
        from: "system@myserver.com",
        to: "usergroupaddress@gmail.com,
        subject: "Your generated email",
        text: "Hello user",
        html: "<p>Hello user</p>"
    };

The google apps email also hints at this: emails with an empty 'from' envelope have a blank 'sender' in the google apps email log search. But as soon as I corrected nodemailer, the 'sender' started populating in email log search, and google stopped bouncing the emails. See the email log here.

defraggled
  • 1,014
  • 11
  • 13