Osticket: Email sending issues.

Created on 6 Oct 2015  ·  78Comments  ·  Source: osTicket/osTicket

Unable to log in. Check SMTP settings.

Sending Email via SMTP
authentication failure [SMTP: STARTTLS failed (code: 220, response: 2.0.0 Ready to start TLS)]

[deprecated] Email bug

Most helpful comment

Try to use port 465 for SMTP and add "ssl://" before the server entry:

smtp

All 78 comments

version of osTicket?
Your mail server is failing your credentials.

1.9.12

I am using gmail and the fetching is working fine just a problem with the sending. I moved osTicket from an old windows server to a new one and the issue is only on the new server.

I seem to recall someone else mentioning that there was a bug with php 5.6, what version are you running?

5.6

Should i try removing 5.6 and installing 5.5

I'd try that first.

It worked. Thanks

I think we should keep this open and work to address the issue on PHP 5.6. As it becomes more widely used, the issue is going to become a larger issue

I not have SMTP problem with PHP 5.6 @ linux host. Look like it's windows specific problem.

just to keep in mind. I am using Windows Server 2008 R2 64bit. Currently I am running 3 different versions of PHP 5.4, 5.5 and 5.6 on this server and have different websites use different versions because some web apps have issues with things on one version of PHP over another. While this could be an application issue it is also possible that the issue is with PHP 5.6 for Windows.

@greezybacon this sounds the same as #2604. I believe that I have narrowed down the problem to this http://php.net/manual/en/migration56.openssl.php

Would anyone have the opportunity to test again with the tip of the develop-next branch? The SMTP library was upgraded and I'm wondering if the new version has any bearing on the issue.

Not sure about everyone else but we use osticket in a live environment and also use the eticket app that requires us to use only compatible versions.

Sincerely,

Nicholas Ruebel

Sent from my iPhone 6 Plus

On Oct 20, 2015, at 7:45 AM, Jared Hancock [email protected] wrote:

Would anyone have the opportunity to test again with the tip of the develop-next branch? The SMTP library was upgraded and I'm wondering if the new version has any bearing on the issue.


Reply to this email directly or view it on GitHub.

I use upgraded SMTP library (Net_SMTP v1.7.1) and not hava any problem.

Which version of php are you using?

Sincerely,

Nicholas Ruebel

Sent from my iPhone 6 Plus

On Oct 20, 2015, at 9:34 AM, infectormp [email protected] wrote:

I use upgraded SMTP library (Net_SMTP v1.7.1) and not hava any problem.


Reply to this email directly or view it on GitHub.

i use 5.6.14 and openssl 1.02d

@infectormp could you just verify that you're using Windows with PHP 5.6 and you had an issue before the upgrade to SMTP 1.7.1?

@greezybacon sorry, i see this is windows related bug. I not using Windows at my server enviroment and can't verify issue.

We have maintainance scheduled for this weekend. I will try and boot a duplicate virtual server machine and test it.

Sincerely,

Nicholas Ruebel

Sent from my iPhone 6 Plus

On Oct 20, 2015, at 11:20 AM, infectormp [email protected] wrote:

@greezybacon sorry, i see this is windows related bug. I not using Windows at my server enviroment and can't verify issue.


Reply to this email directly or view it on GitHub.

@greezybacon I have a windows environment with php 5.6.14 I receive authentication failure [SMTP: STARTTLS failed (code: 220, response: 2.0.0 SMTP server ready)] as an error message. If I use php 5.5.28 it works fine.

I use upgraded SMTP library (Net_SMTP v1.7.1) and not hava any problem.

So this then has absolutely nothing to do with the issue at hand?

@greezybacon As I stated earlier I think it has something to do with the changes made in the php code http://php.net/manual/en/migration56.openssl.php

PHP now requires peer verification and I have tried a lot of thing but can not figure out how to get it setup on my Windows system.

This seems not to be only a windows problem. I had a similar problem with some of my osticket 1.9.12 instances when I switch to php 5.6.

They are running on a hosted server with debian squeeze. The used SMTP Port is 587. First I didn't noticed that because osticket seems to have a workaround sending the emails in this case instead via the php mailer.

In the system logs of osticket were a lots of this errrors:
SMTP: Invalid response code received from server (code: 550, response: relay not permitted)

When I tried to save the mail server credentials again I got this error in the gui:
authentication failure [SMTP: STARTTLS failed (code: 220, response: TLS go ahead)]

Switching back to php 5.5 solves this issue.

Disabling the peer verification seems also to solve the problem (using php 5.6):

https://github.com/pear/Net_SMTP/issues/14

This issue also occurs in osticket 1.10 (latest tip).

@mfelber
Nope not for me.
So I recognized this Problem now, too. Quiet late, but anway.
We can recieve/fetch email fine and sending in domain, too. but out of that not.

I'm using also PHP 5.6 and STMP/587 with authentication.

Would be pleased to see a wordaround because none of them helped here.
I'm not sure if a downgrade makes so much sense as 1.10 is close, same as PHP7.

CHEERS!

@Hannibal226 In my case the workaround with replacing

$this->_socket_options =$socket_options;

to

$this->_socket_options = array('ssl' => array('verify_peer_name' => false));

in /include/pear/Net/SMTP.php works fine.

But I heared from somebody else that this workaround doesn't help him too (like in your case).

Do you still get the same error? What OS do you use?

Why do you mention 1.10 and PHP7? 1.10 has the same problem yet and PHP 7 seems not be recommended soon..

@mfelber
It's windows and afaik it's a windows+PHP 5.6 problem, so...

I mentioned because I don't know if maybe 1.10 will have an inbuild workaround, but more it's a one time maintance break, so installing PHP+new osticket, than once PHP and after some weeks 1.10 (just lazyness :P )

And PHP7 is not recommended, but I reading a lot of trying to make it compatible and I don't think it will prot the problem from 5.6, that why I thought about.

CHEERS!

@Hannibal226
The person that I mentioned who also has problems with the workaround uses windows too.

I use for my production systems only hosted debian squeeze server.

So I were a little bit curious and tested the workaround in my windows xampp test environment (Apache/2.4.17 (Win32) OpenSSL/1.0.2d PHP/5.6.14): the workaround works fine there too.
Maybe it's a little bit more than only a windows thing...

Disabling the peer verification seems also to solve the problem (using php 5.6):

pear/Net_SMTP#14

@mfelber Thanks I was looking for a way to disable, this worked for me [IIS 8 and php 5.6.14]

@jdelhome3578 I'm glad I could help.

@mfelber I just hope there is a permanent solution

@jdelhome3578 I'm confident that this issue will be addressed by the developers sometime as Jared said:

I think we should keep this open and work to address the issue on PHP 5.6. As it becomes more widely used, the issue is going to become a larger issue

For Windows server users the easiest solution is to install php 5.5 as well and set php 5.5 as the active version for your osticket site.

Sent from my iPhone 6 Plus

On Oct 30, 2015, at 7:50 AM, jdelhome3578 [email protected] wrote:

@mfelber I just hope there is a permanent solution


Reply to this email directly or view it on GitHub.

Just to let u know guys, I made a think-misstake and there is a lot easier solution:

I just said IP of ticketsystem is trusted send relay for exchange.
So I just can send mails to exchange without authentication.

But anyway I hadn't recognize the bug before, as we had PHP 5.5 aber after Update no one reported problems.

CHEERS!

Bug is present on Debian jessie PHP 5.6.14-0+deb8u1

Can confirm the temp fix from @mfelber works.

Hi Guys,

I just found this thread because I had the same problem with my osticket-installation on big european hoster HOSTEUROPE. In the last week, I just changed my main php installation from php 5.5 to php5.6. At my hoster, it's just a klick to to this. I didn't recognize any changes because everything seemed to work fine: My Ticketing-Mails were received by pop from all my three accounts as it should be and the mails seemed to be received by my customers.

BUT:

The only thing that was wrong was the Error 550 Relaying not permitted that was displayed in the log of OST.

I tried around with the smtp-settings and I found out, that OST didn't manage to connect to the configured smtp-server at another provider. (I'm using version v1.10-rc.2 (231f11e)) but instead it tried to send mails out via php-mail-function (even if I forbid this in the settings). My Webserver doesn't know the outgoing mail adress and warns by saing "relaying not permitted" (with which he is right!).

When I changed back to PHP5.5 or PHP5.3, everything works perfect again without complains!

Is there a solution in progress? It's not urgent but in 2016, my provider will set 5.6 as standard-php and in late 2016 the ability to use 5.5 will end completely...

What now?

Hello,
OsTicket is using a local copy of pear and it is outdated.
Donwload
https://pear.php.net/package/Net_SMTP/download
http://pear.php.net/package/Net_Socket/download

replace SMTP.php and Socket.php from "include/pear/Net/" with the ones from the downloaded archives.

Changelog for SMTP

  • Add TLSv1.1 and TLSv1.2 support for STARTTLS connections. (#22)

Once you do this, osticket should work.

This does not work on debian jessie with php 5.6.14. Any ideas? osTicket and mailserver are different servers.

Any errors in log?
1 янв. 2016 г. 4:41 PM пользователь "Sebastian Binder" <
[email protected]> написал:

This does not work on debian jessie with php 5.6.14. Any ideas?


Reply to this email directly or view it on GitHub
https://github.com/osTicket/osTicket-1.8/issues/2628#issuecomment-168306839
.

Unable to email via SMTP:mail.consored-domain.com:587 [[email protected]]
Failed to set sender: [email protected] [SMTP: Invalid response code received from server (code: 530, response: 5.7.0 Must issue a STARTTLS command first)]

I also have same Problem.

Clean install with:
Debian 3.16.7-ckt20-1+deb8u3 (2016-01-17) i686 (Jessie), Linux 3.16.0-4-686-pae,
Apache 2.4.10,
PHP 5.6.14-0+deb8u1,
MySQL 5.5.46,
osTicket v1.9.12 (19292ad),
external IMAP and SMTP with STARTTLS

When i enable IMAP on port 143 it seems to have no problem and fetches "new" Mails. Setting SMTP to enable, server-port to 587 and authentication to yes i get this error "authentication failure [SMTP: STARTTLS failed (code: 220, response: TLS go ahead)]"

Even while debug-level is "debug" there is no entry in OS-System-Log.

Anybody any idea to get it work?

Andreas

This is also happening for me on CentOS 7.2 PHP 5.6.

I'm going to see if I can fix this and stick in a pull request.

Hello,
OsTicket is using a local copy of pear and it is outdated.
Donwload
pear.php.net/package/Net_SMTP/download
pear.php.net/package/Net_Socket/download

replace SMTP.php and Socket.php from "include/pear/Net/" with the ones from the downloaded archives.

Changelog for SMTP

Add TLSv1.1 and TLSv1.2 support for STARTTLS connections. (#22)

Once you do this, osticket should work.

/var/www/osticket/osticket/include/pear/Net

-rw-r--r-- 1 www-data --> SMTP.php
-rw-r--r-- 1 www-data --> Socket.php

@UkaLee That didn't work for me, have a look at this diff to see what I did (in case anyone else has similar issues):

https://github.com/johnhunt/osTicket-1.8/commit/d48499b66e3ce9950bdccb7d9b8689a5acaa359f

Can we please bump up the priority on this bug? Seems like a serious issue to me especially if the support is unable to receive the email alerts. In some circumstance the tech support may not be even aware of undelivered emails.

This worked for me as suggested by @mfelber

Change

$this->_socket_options =$socket_options;

to

$this->_socket_options = array('ssl' => array('verify_peer_name' => false));

@joelrb sure it works but the next osTicket update may replace the file and cause no emails until you tweak it again.

If it were PHPMailer could use the following..

    $mail->SMTPOptions = array(
        'ssl' => array(
            'verify_peer' => false,
            'verify_peer_name' => false,
            'allow_self_signed' => true
        )
    );

I was also getting
authentication failure [SMTP: STARTTLS failed (code: 220, response: 2.0.0 Ready to start TLS)]

I've updated my SMTP.php and Socket.php /include/pear/Net - to the latest versions.
pear.php.net/package/Net_SMTP/download
pear.php.net/package/Net_Socket/download

Now I'm getting another error
authentication failure [SMTP: Invalid response code received from server (code: 535, response: 5.7.3 Authentication unsuccessful)]

osTicket Core, v1.9.14
PHP Version 5.6.19

Try to use port 465 for SMTP and add "ssl://" before the server entry:

smtp

I've tried a different email with Authentication Required: yes
this works fine. For some reason the other email doesn't authenticate and therefore fails.
Strange - but using an office 365 liscenced email works fine.

This:
authentication failure [SMTP: Invalid response code received from server (code: 535, response: 5.7.3 Authentication unsuccessful)]

usually indicates that authentication was unsuccessful. I would think that this would be at the remote end personally.

You have two ways of getting this to work from an administration point of view....

  1. You use authentication
  2. You remove authentication like we did and restrict access to your SMTP server via IP address and sending domain.
    smtp settings

As I was posting @Pooleyy I noticed you talk about Office 365.

You say a licensed mailbox works??
Are you trying to use a "Shared Mailbox" ??

Ahh @robintoy it could be Shared yes.
But... I have the same email address set up on an old osTickets and it works fine. With no Authentication like you have suggested above.

Hi @Pooleyy
you will not be able to use Office 365 like our configuration as you do not have access to Microsoft's Exchange cluster directly to add the right rules as required.

With a shared mailbox MS did an update a while ago stopping authentication to it, the only way to auth against a shared mailbox is with one of the users that has access to the mail box

Hi @robintoy
I see, thanks for your input - appreciated.
I've solved it by using another email now. It's just odd how it still works on my old osTickets.
Cheers! Sam

I'm having the same problems with PHP 5.6 and v1.9.14.

This problem makes osTicket unusable for me. Almost every email provider is enforcing a STARTTLS connection and I already tried Inbox.lv and Zoho.com without any success.

Also changing $this->_socket_options =$socket_options; did not help. It only created a new error message: authentication failure [SMTP: Invalid response code received from server (code: 535, response: Incorrect authentication data)]

(but username and password are correct).

I can't understand how such problem can exist for almost a year and why its still not fixed.

I use:

  • this hack from d48499b66e3ce9950bdccb7d9b8689a5acaa359f
  • change in __construct function:
$this->socket_options = array('ssl' => array(
            'verify_peer' => false,
            'verify_peer_name' => false,
            'allow_self_signed' => true
        ));
  • set ssl:// in config
  • use port for ssl

It worked.

PHP 5.6.24-0+deb8u1

I currently have 30+ emails in our mail queue that are not sending out to Google because Google is rejecting emails. Does anyone have a stable fix for this?

I'm running debian and php5.6 and had the same problem. Instead of changing the code in the Net_SMTP constructor, I changed the two calls to instantiate the Net_SMTP class in include/pear/Mail/smtpmx.php and include/pear/Mail/smtp.php to pass in the socket options. I believe that is a better fix. And this is a PEAR issue, not an osTicket issue.

i am getting same issue with latest release 1.10
unable to enable SMTP authentication, always getting STARTTLS issue.

also trying with all above suggestion, but not working :(

I agreed with @cosmospham using d48499b

His method worked on version 1.10 / 1.9.15.

If this can be pushed to the main branch, that will be great.

Server Information
osTicket Version v1.9.15 — Up to date
Web Server Software Apache/2.4.23 (Unix) OpenSSL/1.0.1e-fips mod_bwlimited/1.4
MySQL Version 5.5.52
PHP Version 5.6.27

@protich fixed this with 4f68aeb

Hi This is still not working for me. I use 1 and 1 UK hosting with TLS 587.

Any help?

I would recommend that you talk to 1and1 and ask them why its not working.

Also see:
https://github.com/osTicket/osTicket/issues/3715
and
http://osticket.com/forum/discussion/87243/resolved-smtp-connection-error-for-1and1-server

need some urgent assistance ...

i cant save smtp (gmail) at my helpdesk osticket.. below is the attachment of my version.
is it related to php ver 5.6 also ? tq

error1
error2

one more question , im using in windows server 2008 r2 standard 64bit environment .. is there any configuration must do to smtp server function (build in with windows) .. sorry im really newbie with this osticket configuration. seems im taking this from other klik ...
error3

hope someone help me. thanks

"SMTP: Failed to connect: No connection could be made because the target machine actively refused it"
The remote server is refusing the connection.

In SMTP Virtual Mail Server feature in windows the server generally needs permission to relay. Go back to that screen that you posted. Click on the Access tab. Click Relay, and add the IP address of the webserver. Also make sure that the firewall allows connection on the port that you are using.

dear ntozier ,

seems im newbie.. sorry... i've once open the ip... i see ip somelike this 127.0.0.1 .. i don know where its come..

like this right?

error1

I do not know what your IP addresses are, so I can't really answer as to if it's correct. I presume that your webserver is 172.21.9.40, and that you are running the SMTP Virtual Server on the same machine? Also check your firewall. :)

yes , osticket all in this server .. yes smtp virtual server also same machine... oracle sun blade machine.. running windows server 2008 r2 standard 64bit... after i include the server(machine) ip in relay and test save the smtp setting for [email protected] also failed.. use 4 diff port , 465 , 443 , 25 , 587

i can see SMTP tick in firewall windowss.. but this machine also installed with kaspersky. i don know whether firewall being control by kaspersky as well..

error2

I was having the same problem (STARTTLS error) connecting to smtp.gmail.com on osTicket 1.10.1.
Host: Windows Server 2012 (IIS 8.5), PHP 7, MySQL (5.7).

Adding the option 'verify_peer' => false to 'ssl' socket options fixed it.
In the file include/pear/Net/SMTP.php, in the construct function change:

// Turn off peer name verification by default\n
if (!$socket_options)
    $socket_options = array(
        'ssl' => array('verify_peer_name' => false)
    );

for

// Turn off peer name verification by default\n
if (!$socket_options)
    $socket_options = array(
        'ssl' => array('verify_peer_name' => false, 'verify_peer' => false)
    );

Nothings works for me

Sending Email via SMTP
Failed to connect to smtp.gmail.com:465 [SMTP: Failed to connect socket: Connection timed out (code: -1, response: )]

Failed to connect to smtp.gmail.com:587 [SMTP: Failed to connect socket: Connection refused (code: -1, response: )]

Server Information

osTicket Version | v1.15 (d5ee0df) —  Up to date
Web Server Software | Apache
MySQL Version | 5.6.49
PHP Version | 7.3.23

Please help for resolving this issue

Was this page helpful?
0 / 5 - 0 ratings