Body: <p>After finding my bounce messages were seemingly <a href="https://civicrm.stackexchange.com/questions/35700/bounce-messages-disappearing-on-g-suite">disappearing into the ether</a> when sending mail with mail(), I'm trying to configure CiviCRM to send using G Suite's SMTP relay.</p>
  
  <p>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:</p>
  
  <pre><code>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 &lt;somnolentsurfer@example.net&gt;; Wed, 20 May 2020 09:26:24 -0700 (PDT)
  </code></pre>
  
  <p>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:</p>
  
  <pre><code>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
  </code></pre>
  
  <p>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?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-05-20T17:40:08.317Z
Comments.Text: 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 = +".
Comments.UserDisplayName: BobS
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-05-22T16:05:31.930Z
Comments.Text: @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.
Comments.UserDisplayName: somnolentsurfer
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-05-22T21:46:18.013Z
Comments.Text: 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? https://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)?
Comments.UserDisplayName: BobS
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-05-26T11:38:15.480Z
Comments.Text: @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.
Comments.UserDisplayName: somnolentsurfer
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-05-26T15:59:06.127Z
Comments.Text: Well, that's an unexpected reason for the issue! Glad it's working. Any reason you can't use the GSuite "Require SMTP Authentication" option rather than whitelisting the full IP range?
Comments.UserDisplayName: BobS
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-05-29T16:31:30.117Z
Comments.Text: @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.
Comments.UserDisplayName: somnolentsurfer
Tags: <civimail><mailing><smtp><g-suite>
Title: View full syntax bounces
ThreadText: # View full syntax bounces
  
  (Asked by: username_0 on 2020-05-20)
  
  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 ; 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?
  
  **Tags:** civimail, mailing, smtp, g-suite
  
  > **Comments:**
  > **username_1**: 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 = +".  
  > **username_0**: @username_1 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.  
  > **username_1**: 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? https://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)?  
  > **username_0**: @username_1 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.  
  > **username_1**: Well, that's an unexpected reason for the issue! Glad it's working. Any reason you can't use the GSuite "Require SMTP Authentication" option rather than whitelisting the full IP range?  
  > **username_0**: @username_1 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.  
  
  ---
  
  ## 0 answers
  
  