0

After finding my bounce messages were seemingly disappearing into the ether when sending mail with mail(), I'm trying to configure CiviCRM to send using G Suite's SMTP relay.

I've configured the SMTP settings in Administer > System Settings > Outbound E-mail and the test button on that screen sends an e-mail that is successfully delivered, seemingly correctly through G Suite as indicated by this line in the e-mail headers:

Received: from example.net ([192.0.2.1]) by smtp-relay.gmail.com with ESMTP id g185sm57996wmg.25.2020.05.20.09.26.24 for <somnolentsurfer@example.net>; Wed, 20 May 2020 09:26:24 -0700 (PDT)

When I try and send an actual mailing using CiviMail, though, I get a 100% bounce rate, all with a bounce of type 'syntax'. In the bounces report I can see bounce reasons given in the format:

Failed to set sender: bounces+b.42.989.322af0d715439c1d@example.net [SMTP: Invalid response code received from SMTP server while sending email. This is often caused by a misconfiguration in Outbound Email settings. Please verify the settings at

That message is obviously truncated. If I log in to the bounce handling account there don't seem to be any messages there that might show me the full error, either in the inbox, or in INBOX/CiviMail/ignored or INBOX/CiviMail/processed. Is there any way to see the rest of the message so I can diagnose what's going on?

  • Do you have access to the server mail log, typically /var/log/mail.log? Is your mail server configured to use "+" as a username separator? In postfix, for example, that requires in main.cf: "recipient_delimiter = +". – BobS May 20 at 17:40
  • @BobS Do I have access to the full log of smtp-relay.gmail.com? No, I don't. And yes, Gmail allows "+" as a username separator. – somnolentsurfer May 22 at 16:05
  • OK. Thought you were using some primary server which relays to Gsuite. Now I understand you're using GSuite directly as your server. Did you set Gsuite to allow all senders from your domain? support.google.com/a/answer/2956491?hl=en. Did you check the Gsuite email log (in Admin console, search for "Email log search")? Did you check the CiviCRM log file? Did you check the CMS log (e.g. for Drupal: Reports | Recent log messages)? – BobS May 22 at 21:46
  • @BobS Thanks. Eventually found the error recorded in G Suite's own logs was different to the one it seemed to be passing to CiviCRM and did imply it wasn't allowing the IP address. I contacted my host and it turns out their cron process runs on a different IP to the one the site presents as, hence the test working but not CiviMail. I got the full possible range from them, whitelisted that, and so far it seems to be working. I don't love whitelisting a range that could include quite a lot of other sites but there we go. – somnolentsurfer May 26 at 11:38
  • 1
    @BobS When I tested that it seemed to send all mail as the G Suite user that authenticated, and I'm hoping to get to the point that users can send as their own G Suite account. The 'Allow mail from logged in contact' option in Settings - Outbound Mail doesn't seem to make much difference so far, but that's a later question when I get to it. – somnolentsurfer May 29 at 16:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.