Welcome to the LimeSurvey Community Forum

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

SMTP configuration without SSL / TLS is using TLS

More
7 years 6 months ago #142776 by accsa
I have configured the SMTP options using my mail server.
In the encoding SMTP options I selected the "disabled" option (I use the spanish version so the name may be different).
The connection to the mailserver is fine and I'm able see the communication logs, but I can't send mails, I'm having this error:

SMTP connect() failed. github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
  • Trazado de la salida del SMTP:
  • 2016-10-06 18:32:30
    SERVER -> CLIENT: 220 Cas1 Microsoft ESMTP MAIL Service ready at Thu, 6 Oct 2016 15:32:30 -0300 2016-10-06 18:32:30
    CLIENT -> SERVER: EHLO feedback.arnaldocastro.com.uy 2016-10-06 18:32:30
    SERVER -> CLIENT:
    250-Cas1 Hello [10.100.100.30]
    250-SIZE 36700160
    250-PIPELINING
    250-DSN
    250-ENHANCEDSTATUSCODES
    250-STARTTLS
    250-X-ANONYMOUSTLS
    250-AUTH NTLM LOGIN
    250-X-EXPS GSSAPI NTLM
    250-8BITMIME
    250-BINARYMIME
    250-CHUNKING
    250 XRDST 2016-10-06 18:32:30
    CLIENT -> SERVER: STARTTLS 2016-10-06 18:32:30
    SERVER -> CLIENT: 220 2.0.0 SMTP server ready 2016-10-06 18:32:30 SMTP Error: Could not connect to SMTP host. 2016-10-06 18:32:30 CLIENT -> SERVER: QUIT 2016-10-06 18:32:30
    SERVER -> CLIENT: 2016-10-06 18:32:30
    SMTP ERROR: QUIT command failed: 2016-10-06 18:32:30
    SMTP connect() failed. github.com/PHPMailer/PHPMailer/wiki/Troubleshooting


    As you can see I've remarked the line which I believe is the problem, the client (limesurvey) is starting the communication with TLS despite I have not selected SMTP TLS encode option.
    Any ideas of how can I resolve this problem?, thanks in advance.
    The topic has been locked.
    More
    7 years 6 months ago #142778 by jelo

    accsa wrote: As you can see I've remarked the line which I believe is the problem, the client (limesurvey) is starting the communication with TLS despite I have not selected SMTP TLS encode option.

    This looks like an issue in the PHPMailer library.

    Opportunistic TLS
    PHPMailer 5.2.10 introduced opportunistic TLS - if it sees that the server is advertising TLS encryption (after you have connected to the server), it enables encryption automatically, even if you have not set SMTPSecure. This might cause issues if the server is advertising TLS with an invalid certificate, but you can turn it off with $mail->SMTPAutoTLS = false;.

    What version/build of LimeSurvey is used? What version of PHP is used?

    I wonder why you want to deactivate TLS. The used mailserver supports TLS encryption as my tests showed.
    You might need to change the hostname or the port. Normally I would go for TLS and 465. StartTLS is a bit wacky, since it can be tricked into not encrypting at all. StartTLS is on Port 25.

    The meaning of the word "stable" for users
    www.limesurvey.org/forum/development/117...ord-stable-for-users
    The topic has been locked.
    More
    7 years 6 months ago #142783 by accsa
    Thanks for answering.
    Now I'm using the last version of Limesurvey 2.53+161004. I was using Versión 2.06+ with the same configuration and it was working OK.
    I have installed a new server and I updated the version, so I don't know if is something with the new server or with the new version. At the moment I still having the old server (Windows 2012) with version 2.06 working OK just for test, and the new server (CentOS 7).
    The PHP version on my new server is PHP 5.6.26 (cli) (built: Sep 17 2016 09:53:52)

    I've tried TLS and SSL configurations with port 25, 587 and 465 with no success, now I don't use TLS in order to simplify things avoiding to have certificates problems, on the other hand the communication is internal, so I don't need to encrypt it.

    I agree with you, it sounds like a PHPMailer or similar problem but I'm stuck.
    The topic has been locked.
    More
    7 years 6 months ago #142785 by jelo
    Please check if SELinux is active on CentOS 7. If yes, disable it.
    blog.zwiegnet.com/linux-server/disable-selinux-centos-7/

    Since PHP 5.6 certificates get checked on names. If the mailservers hostname and certificate aren't matching it can be the issue too.
    You can deactivate this behavior in PHP. Not a good idea.
    php.net/manual/en/migration56.openssl.php
    Sometimes the CentOS CA bundle is not having all CAs. So even a valid certificate isn't validated by CentOS OpenSSL correctly.

    I still don't get how you use the mailserver internally. You state "communication is internal". Is the mailserver under you control too?
    How can you be sure with the routing when using the hostname, which I can reach too?

    I currently cannot recommend a way to config the phpmailer in the LimeSurvey installation.

    The meaning of the word "stable" for users
    www.limesurvey.org/forum/development/117...ord-stable-for-users
    The topic has been locked.
    More
    7 years 6 months ago #142811 by jelo
    Asked the developers how to change the configuration of the phpmailer.
    Answer from LouisGac was, that i should read the code. So, feel free to open a bugreport or read the code.

    The meaning of the word "stable" for users
    www.limesurvey.org/forum/development/117...ord-stable-for-users
    The topic has been locked.
    More
    7 years 6 months ago #142814 by jelo
    Ok, chatted a bit around.
    Next release of LS will have "Opportunistic TLS" disabled. So you might just wait for the next release and just update to fix your issue.

    The meaning of the word "stable" for users
    www.limesurvey.org/forum/development/117...ord-stable-for-users
    The topic has been locked.
    More
    7 years 6 months ago #142831 by accsa
    OK, thanks for your help, I'm trying a couple of things.
    I will post the results as soon as I can.
    The topic has been locked.
    More
    7 years 6 months ago #142840 by jelo

    accsa wrote: OK, thanks for your help, I'm trying a couple of things.

    Perhaps you first try the update.

    LimeSurvey 2.54 build 161007

    -Fixed issue: TLS handshake used even if no TLS is set in SMTP settings


    The meaning of the word "stable" for users
    www.limesurvey.org/forum/development/117...ord-stable-for-users
    The topic has been locked.
    More
    7 years 6 months ago #142843 by ibro123

    accsa wrote: I have configured the SMTP options using my mail server.
    In the encoding SMTP options I selected the "disabled" option (I use the spanish version so the name may be different).
    The connection to the mailserver is fine and I'm able see the communication logs, but I can't send mails, I'm having this error:

    SMTP connect() failed. github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

  • Trazado de la salida del SMTP:
  • 2016-10-06 18:32:30
    SERVER -> CLIENT: 220 Cas1 Microsoft ESMTP MAIL Service ready at Thu, 6 Oct 2016 15:32:30 -0300 2016-10-06 18:32:30
    CLIENT -> SERVER: EHLO feedback.arnaldocastro.com.uy 2016-10-06 18:32:30
    SERVER -> CLIENT:
    250-Cas1 Hello [10.100.100.30]
    250-SIZE 36700160
    250-PIPELINING
    250-DSN
    250-ENHANCEDSTATUSCODES
    250-STARTTLS
    250-X-ANONYMOUSTLS
    250-AUTH NTLM LOGIN
    250-X-EXPS GSSAPI NTLM
    250-8BITMIME
    250-BINARYMIME
    250-CHUNKING
    250 XRDST 2016-10-06 18:32:30
    CLIENT -> SERVER: STARTTLS 2016-10-06 18:32:30
    SERVER -> CLIENT: 220 2.0.0 SMTP server ready 2016-10-06 18:32:30 SMTP Error: Could not connect to SMTP host. 2016-10-06 18:32:30 CLIENT -> SERVER: QUIT 2016-10-06 18:32:30
    SERVER -> CLIENT: 2016-10-06 18:32:30
    SMTP ERROR: QUIT command failed: 2016-10-06 18:32:30
    SMTP connect() failed. github.com/PHPMailer/PHPMailer/wiki/Troubleshooting


    As you can see I've remarked the line which I believe is the problem, the client (limesurvey) is starting the communication with TLS despite I have not selected SMTP TLS encode option.
    Any ideas of how can I resolve this problem?, thanks in advance.

    The topic has been locked.
    More
    7 years 6 months ago #142844 by ibro123
    i have problem with mail sender unable to send any mail..Please help me!
    I use version 2.53+161004.
    Unable to send with smtp, crone, of any kind i try...
    The topic has been locked.
    More
    7 years 6 months ago #142957 by accsa
    Excelent!! it works like a charm! with the same configuration now it works perfectly.
    To be honest I didn't expect an update so quick, that why I'd said I was going to test a couple of things.
    It's good to have this formu, thanks again for your help.
    The topic has been locked.
    More
    7 years 6 months ago - 7 years 6 months ago #142958 by accsa
    ibro123:
    Do you have any log of the error? what are you using to send mails, your own mail server or an account from other parties?
    Last edit: 7 years 6 months ago by accsa. Reason: I didn't know how to reference another post.
    The topic has been locked.

    Lime-years ahead

    Online-surveys for every purse and purpose