Body: <p>Using  Drupal  7.63
  Using  CiviCRM 5.9.1</p>
  
  <p>My system had been working fine and I'm not sure what happened except that something in server updates may have broken SMTP. My last bulk mailing went fine and nothing has been changed in CiviCRM since then but SMTP is not working either in CiviCRM or in Drupal (although Drupal is able to send me a message about needed updates).</p>
  
  <p>Here are the log entries from CiviCRM:</p>
  
  <blockquote>
    <blockquote>
      <p>1407    Mar 08 13:43:13 [info] $backTrace = #0 /var/www/html/sites/all/modules/civicrm/CRM/Core/Error.php(232):
      CRM_Core_Error::backtrace("backTrace", TRUE) 1389 Mar 08
      13:43:13  [info] $Fatal Error Details = Array 1367    Mar 08
      13:43:13  [info] $backTrace = #0
      /var/www/html/sites/all/modules/civicrm/CRM/Core/Error.php(962):
      CRM_Core_Error::backtrace("backTrace", TRUE) 1365 Mar 08
      13:43:13  [info] Ignoring exception thrown by nullHandler: 10001,
      Failed to connect to ssl://smtp-relay.gmail.com:465 [SMTP: Failed to
      connect socket: Connection timed out (code: -1, response: )] 1342 Mar
      08 13:43:13   [info] $backTrace = #0
      /var/www/html/sites/all/modules/civicrm/CRM/Core/Error.php(962):
      CRM_Core_Error::backtrace("backTrace", TRUE) 1340 Mar 08
      13:43:13  [info] Ignoring exception thrown by nullHandler: , Failed to
      connect socket: Connection timed out 1316 Mar 08 13:43:13 [info]
      $backTrace = #0
      /var/www/html/sites/all/modules/civicrm/CRM/Core/Error.php(962):
      CRM_Core_Error::backtrace("backTrace", TRUE) 1314 Mar 08
      13:43:13  [info] Ignoring exception thrown by nullHandler: 110,
      Connection timed out</p>
    </blockquote>
    
    <p>Drupal says:    phpmailerException: SMTP Error: Could not connect to SMTP host. in PHPMailer->SmtpConnect() (line 810 of /var/www/html/sites/all/modules/smtp/smtp.phpmailer.inc).</p>
  </blockquote>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-03-08T20:01:22.667Z
Comments.Text: If you're using google's smtp-relay service are you exceeding the limits?
Comments.UserDisplayName: Demerit
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-03-08T20:36:31.187Z
Comments.Text: Haven't sent anything recently (since January) but yes, I'm using smtp-relay.gmail.com as the SMTP server. I've confirmed using a different application that all is set up correctly to use the relay service. I haven't made any changes to the configuration from what worked perfectly in January. I've also noticed that the email I'm using for bounce processing is unable to access the GMail IMAP server.
Comments.UserDisplayName: Stephen Sloan
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-03-08T20:37:11.807Z
Comments.Text: Here's another log entry that could be relevant: Notice: Only variable references should be returned by reference in Mail_smtp->getSMTPObject() (line 377 of /var/www/html/sites/all/modules/civicrm/packages/Mail/smtp.php).
Comments.UserDisplayName: Stephen Sloan
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-03-08T20:42:01.980Z
Comments.Text: Maybe a firewall change? Can you `telnet smtp-relay.gmail.com 465` from the server?
Comments.UserDisplayName: Demerit
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-03-08T22:56:18.600Z
Comments.Text: Thanks, it wasn't the firewall, it was IPv6. I must have disabled it from the command line before but it didn't stay off. I tried your suggestion of telnet from the server and it failed since it was trying an IPv6 address which isn't supported in my setup. Once I disabled IPv6 everything was fine. I also had prior to your message setup Postfix on my server using Google's relay service following a fine recipe here: https://www.linode.com/docs/email/postfix/configure-postfix-to-send-mail-using-gmail-and-google-apps-on-debian-or-ubuntu/ This worked using mail() on the outbound email settings.
Comments.UserDisplayName: Stephen Sloan
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-03-08T23:04:39.253Z
Comments.Text: Great!
  .   .   .            .             .                         .                   .             .
Comments.UserDisplayName: Demerit
Tags: <drupal><smtp>
Title: SMTP Problem - CiviCRM and Drupal
ThreadText: # SMTP Problem - CiviCRM and Drupal
  
  (Asked by: username_0 on 2019-03-08)
  
  Using Drupal 7.63
  Using CiviCRM 5.9.1
  
  My system had been working fine and I'm not sure what happened except that something in server updates may have broken SMTP. My last bulk mailing went fine and nothing has been changed in CiviCRM since then but SMTP is not working either in CiviCRM or in Drupal (although Drupal is able to send me a message about needed updates).
  
  Here are the log entries from CiviCRM:
  
  > > 1407 Mar 08 13:43:13 [info] $backTrace = #0 /var/www/html/sites/all/modules/civicrm/CRM/Core/Error.php(232):
  > > CRM\_Core\_Error::backtrace("backTrace", TRUE) 1389 Mar 08
  > > 13:43:13 [info] $Fatal Error Details = Array 1367 Mar 08
  > > 13:43:13 [info] $backTrace = #0
  > > /var/www/html/sites/all/modules/civicrm/CRM/Core/Error.php(962):
  > > CRM\_Core\_Error::backtrace("backTrace", TRUE) 1365 Mar 08
  > > 13:43:13 [info] Ignoring exception thrown by nullHandler: 10001,
  > > Failed to connect to ssl://smtp-relay.gmail.com:465 [SMTP: Failed to
  > > connect socket: Connection timed out (code: -1, response: )] 1342 Mar
  > > 08 13:43:13 [info] $backTrace = #0
  > > /var/www/html/sites/all/modules/civicrm/CRM/Core/Error.php(962):
  > > CRM\_Core\_Error::backtrace("backTrace", TRUE) 1340 Mar 08
  > > 13:43:13 [info] Ignoring exception thrown by nullHandler: , Failed to
  > > connect socket: Connection timed out 1316 Mar 08 13:43:13 [info]
  > > $backTrace = #0
  > > /var/www/html/sites/all/modules/civicrm/CRM/Core/Error.php(962):
  > > CRM\_Core\_Error::backtrace("backTrace", TRUE) 1314 Mar 08
  > > 13:43:13 [info] Ignoring exception thrown by nullHandler: 110,
  > > Connection timed out
  >
  > Drupal says: phpmailerException: SMTP Error: Could not connect to SMTP host. in PHPMailer->SmtpConnect() (line 810 of /var/www/html/sites/all/modules/smtp/smtp.phpmailer.inc).
  
  **Tags:** drupal, smtp
  
  > **Comments:**
  > **username_1**: If you're using google's smtp-relay service are you exceeding the limits?  
  > **username_0**: Haven't sent anything recently (since January) but yes, I'm using smtp-relay.gmail.com as the SMTP server. I've confirmed using a different application that all is set up correctly to use the relay service. I haven't made any changes to the configuration from what worked perfectly in January. I've also noticed that the email I'm using for bounce processing is unable to access the GMail IMAP server.  
  > **username_0**: Here's another log entry that could be relevant: Notice: Only variable references should be returned by reference in Mail_smtp->getSMTPObject() (line 377 of /var/www/html/sites/all/modules/civicrm/packages/Mail/smtp.php).  
  > **username_1**: Maybe a firewall change? Can you `telnet smtp-relay.gmail.com 465` from the server?  
  > **username_0**: Thanks, it wasn't the firewall, it was IPv6. I must have disabled it from the command line before but it didn't stay off. I tried your suggestion of telnet from the server and it failed since it was trying an IPv6 address which isn't supported in my setup. Once I disabled IPv6 everything was fine. I also had prior to your message setup Postfix on my server using Google's relay service following a fine recipe here: https://www.linode.com/docs/email/postfix/configure-postfix-to-send-mail-using-gmail-and-google-apps-on-debian-or-ubuntu/ This worked using mail() on the outbound email settings.  
  > **username_1**: Great! .   .   .            .             .                         .                   .             .  
  
  ---
  
  ## 0 answers
  
  