4

I have some issues with sending out mailings (used to work, now it doesn't anymore). My mailing is failing 100% with a combination of the following errors:

  1. authentication failure [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 Administer CiviCRM >> Global Settings >> Outbound Ema
  2. Failed to set sender: [email protected] [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 Admi

Regarding the Administer CiviCRM >> Global Settings >> Outbound Ema settings, I have checked these copious times and have verified that they work using the "Save & Send Test Email" function. This for both the mail() and SMTP settings.

I have also tested the actual mailing settings by sending a test to one of my email addresses. This works 100% - which would indicate that the mailing test function uses a different approach to the actual mailing component (this does not make sense for me as it will result in inconsistent results).

Now more to the actual errors:

  1. No idea what's wrong, as the tests pass.
  2. I thought this was a part of the VERP option (server changes the email address) - the SMTP does not recognise the email address and does not allow sending.

When using mail(), the mailing is successfully sent, but most of the emails fall into the very dark hole of the internet - and the ones that get delivered are mostly sent to spam. This is because the reverse DNS look up for my domain is not the same as the IP of my server.

When using SMTP the SMTP server does not recognise the email address I am sending from. And yes, I have switched off the VERP function (I think).

Any ideas what else I can do to get closer to fixing this?

1
  • I'm seeing something similar. What version of CiviCRM are you using? Commented Feb 25, 2019 at 19:05

1 Answer 1

5

I experienced this problem when I was running different versions of PHP in the website and my command line interface (CLI). You can check your PHP version for the web at Administer menu » Administration Console » System Status. You can find your CLI PHP version by running php -v. I was running 7.0 and 7.2 respectively.

Since PHP 7.2 has deprecated the php-mcrypt module, CiviCRM was expecting my mail password to be unencrypted when run from CLI, and encrypted when run from the web interface. So all web-based testing works - but CLI gets authentication errors. The solution is to match your PHP version on web and CLI.

Note that if you move from some lower version to PHP 7.2+, you'll need to re-enter your mail password for things to work.

5
  • Yup, that was the problem. I've upgraded my site to 7.2 - now both Apache2 and CLI are using that and the mailing executes correctly.
    – roland
    Commented Feb 26, 2019 at 8:53
  • 1
    This was also our problem, thank you! Commented Jul 5, 2019 at 7:20
  • I've recently upgraded to PHP 7.2 and am running into this (web-based testing works including running cron from web link, but not cron/scheduled jobs via CLI). Both CLI and web are now on PHP 7.2 and I've resaved my SMTP settings, but still have this issue. Is there another step?
    – Laryn
    Commented Nov 14, 2019 at 17:13
  • @Laryn-CEDC.org Is it possible that the mcrypt extension is being loaded via web SAPI but not CLI, or vice versa? If you look in civicrm_settings do you see the password saved as plaintext or encrypted? Commented Nov 14, 2019 at 18:19
  • @JonG-MegaphoneTech It is encrypted in the database. I will have a server tech make sure the extension is loaded for CLI. Thanks.
    – Laryn
    Commented Nov 14, 2019 at 19:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.