Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Email failed / SMTP

  • wtebbens
  • wtebbens's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
6 years 6 months ago #158716 by wtebbens
Email failed / SMTP was created by wtebbens
Dear all,

first of all thanks for the great project!
Here's my situation:
  • I installed the latest stable version on a clean Ubuntu virtual machine
  • the server seems to work and I can login with the admin account, create other accounts etc
  • as our email server is on another machine, I configured the email with SMTP, the 587 port number, TLS and with smtp debugging mode
  • there's however no emails being sent and everytime I try to recover a password the "Email failed" message appears on the screen

I've been looking at the server but couldn't find the log files. Where are they stored? Or is there other config required for any logs to be kept?
And to solve the smtp issue, is there anything you would recommend me to check?

thanks in advance,
Wouter
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 6 months ago #158730 by DenisChenu
Replied by DenisChenu on topic Email failed / SMTP
Look at global settings , no need log files to debug SMTP issue : just set SMTP debug to always.

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
  • wtebbens
  • wtebbens's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
6 years 6 months ago #158755 by wtebbens
Replied by wtebbens on topic Email failed / SMTP
Thanks, Denis, for your reply. Yes I did just that: in global settings I selected "debug always"

But it doesn't help in any way. Still there's no email notifications nor does the password recovery service work, and neither do I find any error info / logs. Any help would be appreciated.
The topic has been locked.
  • wtebbens
  • wtebbens's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
6 years 6 months ago #158770 by wtebbens
Replied by wtebbens on topic Email failed / SMTP
I did also try with a google email account and their smtp server just to check that it wasn't a problem on the side of the smtp server. It wasn't: google smtp also let's LS come with "Email Failed" messages.

Then I dived into the server to see if I could configure it directly in the config.php file (from the email.php example settings) which I did, but it didn't change anything for the better.

Hmm no clue how this thing can send emails so far ...
The topic has been locked.
  • wtebbens
  • wtebbens's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
6 years 6 months ago - 6 years 6 months ago #158781 by wtebbens
Replied by wtebbens on topic Email failed / SMTP
After long searching I came to find out that PHP as from version PHP 5.65.6 and onwards checks for SSL certificates. Given that our LS is using PHP 7.0 it must be discovering that our email server uses self-signed certificates and has no clue whether to accept them or not. Debug info:
Code:
stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages:
error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed

This is at least what I learnt in the PHPmailer forums, like here , where they suggest to add:
Code:
$mail->SMTPOptions = array(
'ssl' => array(
    'verify_peer' => false,
    'verify_peer_name' => false,
    'allow_self_signed' => true
));

Now that brings me to the following questions:
  1. Does LS have an option to disable certificate checks?
  2. Or: where could I insert the above code to adapt it myself? Should be at the place where the phpmailer is called
  3. Or, ideally: how could I tell the server to download the certificates and make sure they're recognised whenever LS wants to mail?
Last edit: 6 years 6 months ago by wtebbens.
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 6 months ago #158820 by DenisChenu
Replied by DenisChenu on topic Email failed / SMTP
Patch is here : github.com/SondagesPro/LimeSurvey-Sondag...mon_helper.php#L4068

I must make it for master too …

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
  • wtebbens
  • wtebbens's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
6 years 6 months ago #158855 by wtebbens
Replied by wtebbens on topic Email failed / SMTP
Thanks Denis! I have replaced de common_helper.php file as you suggest and tested the installation again. We're advancing, but now the error message (when sending a group message) is as follows:
Code:
2017-09-20 16:16:40  SERVER -> CLIENT: 220 mail.freeknowledge.eu ESMTP Postfix (Debian/GNU)
2017-09-20 16:16:40  CLIENT -> SERVER: EHLO laco.freeknowledge.eu
2017-09-20 16:16:40  SERVER -> CLIENT: 250-mail.freeknowledge.eu
                                       250-PIPELINING
                                       250-SIZE 10240000
                                       250-ETRN
                                       250-STARTTLS
                                       250-ENHANCEDSTATUSCODES
                                       250-8BITMIME
                                       250 DSN
2017-09-20 16:16:40  CLIENT -> SERVER: STARTTLS
2017-09-20 16:16:40  SERVER -> CLIENT: 220 2.0.0 Ready to start TLS
2017-09-20 16:16:40  SMTP Error: Could not connect to SMTP host.
2017-09-20 16:16:40  CLIENT -> SERVER: QUIT
2017-09-20 16:16:40  SERVER -> CLIENT: MIA

I don't understand why it can't connect to SMTP host. Will check with our mail server admin, but if you have a clue, let me know. At the same time I can confirm that with the same credentials I can receive and send emails from a regular email client (Thunderbird).
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 6 months ago #158856 by DenisChenu
Replied by DenisChenu on topic Email failed / SMTP
Some server have whitelisted domain for smtp connexion. OVH is an example.

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
  • wtebbens
  • wtebbens's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
6 years 6 months ago #158871 by wtebbens
Replied by wtebbens on topic Email failed / SMTP
thanks. Considering that PHP5.5 would be more suitable for LimeSurvey, and that Ubuntu 16.04 doesn't allow you to have that practically, I have decided to reinstall with ubuntu 14.04 and install PHP5.5.9. Then it worked out well. One minor observation: you'd better have the same smtp email address as for the bounces, as otherwise we were blocked by our mail server. I.e. it appears that LS is sending email messages from the bounce address but as the smtp address. Well, so it arrived at our mail server apparently.
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 6 months ago #158881 by DenisChenu
Replied by DenisChenu on topic Email failed / SMTP
We set Return-Path to the bounce adress (is Survey settings is set for bounce).

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose