Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

osTicket v1.10 (stable) and Maintenance Release v1.9.15 are now available! Go get it now

[resolved] Authenticated SMTP Error in OSTicket 1.10.1

Hello,

I am having an issue with using authenticated SMTP to send ticket email in OS ticket.
I have tested multiple accounts across multiple different email servers and all result with the same error message.
I know that these SMTP details are correct as I have been able to use them to authenticate SMTP on another Wordpress site that I run.

image
image

I am unsure how to resolve this and it causing a large degree of frustration throughout the organisation. 

Comments

  • First I notice that you haven't provided us with the username that you are using to do this.

    Secondly have you tried prefixing the server name with tls:// or ssl://?

    Lastly have you setup a connector?  (see Option 3)
    https://support.office.com/en-us/article/How-to-set-up-a-multifunction-device-or-application-to-send-email-using-Office-365-69f58e99-c550-4274-ad18-c805d654b4c4
  • Hello,

    I am using email address + Password as the credentials to authenticate.
    I have tried both SSL and TLS they provide different errors.

    Why do I need to setup a connector? I can already send email using this account from other services over authenticated SMTP without one.

    As described about no matter what account/email platform is used the error message is always the same.

    A test using smtp.mail.me.com:587 just now rended the same 535 error.
  • When using:

    tls://smtp.office365.com

    I get the following error:

    Failed to connect to tls://smtp.office365.com:587 [SMTP: Failed to connect socket: stream_socket_client(): unable to connect to tls://smtp.office365.com:587 (Unknown error) (code: -1, response: )]

  • edited November 9
    Is that port open on your server? Also do you have PHP's openssl extension installed?
  • Are you running mod_security or SELinux?  Have you allowed the connection?
  • KevinTheJedi - I know that the port is open as I am able to Authenticate with the SMTP.Office365.com on another website hosted on this server. Open SSL is installed by default on our server.

    Ntozier I am not sure it is a shared server and I am unsure of the setup of mod_security or SELinux


  • edited November 10

    Mostly I have no problems with sending or receiving mails with osTicket. My experience is when such an problem occurs is that something has changed or prevents access to the mail server:

    1) Hoster switches PHP version because of end of life, new PHP version behaves different with software code, email setup settings must be adjusted

    2) Hoster has setup a security rule that prevents access to the mail server (could depend on how the software is working) and hoster must allow access

    3) Firewall or SELinux rule prevents access to the mail server and must be adjusted to allow the used software to connect

    4) Missing PHP extensions, extensions must be installed and activated

    5) Hosted mail services like gmail or office 365 or iCloud could have higher security conditions, conditions must be lowered via their webinterface or special conditions must be fulfilled like a connector, or a application aware password

  • 1) Hoster switches PHP version because of end of life, new PHP version behaves different with software code, email setup settings must be adjusted

    The PHP version has not changed in quite some time and OSticket has only just recently been installed. I have other apps such as wordpress on this same server that authenticate fine with the O365 mail and send via smtp the problem seems to be localised in OS ticket.

    2) Hoster has setup a security rule that prevents access to the mail server (could depend on how the software is working) and hoster must allow access

    As described above I have others apps on the same server under the same root user that work with SMTP authentication.

    3) Firewall or SELinux rule prevents access to the mail server and must be adjusted to allow the used software to connect

    See above points for 1 & 2

    4) Missing PHP extensions, extensions must be installed and activated

    OS ticket had no errors or recommendations when it was installed indicating that it was missing a php extension.

    5) Hosted mail services like gmail or office 365 or iCloud could have higher security conditions, conditions must be lowered via their webinterface or special conditions must be fulfilled like a connector, or a application aware password

    As described above there are other apps that work with these mail configurations and I have not made any changes to the hosting platforms themselves. 


    There seems to be an issue localised to OSticket 1.10.1 that is preventing it from authenticating. We have been able to determine via our Cpanel logs that OSTicket is foregoing using the SMTP server and is attempting to authenticate against the local mailserver with the credentials which as expected fails, the server then defaults to sending the email via the Webservers PHP mail without authentication which succeeds. See the logs below:

    image

    -------

    This is an issue localised to OSticket, because their are two other websites in which these SMTP credentials are used that are working as expected, both on the same server as OSticket.

  • The error you're getting is exactly like this: https://forums.cpanel.net/threads/rejected-rcpt-rejected-relay-attempt.599847/

    Maybe this will help as well? Cheers.
  • mfelber - I have tried this fix and it did not work i still get the same errors.
    KevinTheJedi - I do not have the same setup as this issue. We have a single domain authenticating a single mailserver where all emails are located. This issue relates to a user who has two separate MX records for a single domain.
  • This issue is resolved.

    Download newer versions of the pear package and replace temporarily the two files of osticket with the newer ones:
    http://download.pear.php.net/package/Net_SMTP-1.8.0.tgz
    http://download.pear.php.net/package/Net_Socket-1.2.2.tgz

    Replace SMTP.php and Socket.php from "include/pear/Net/" with the ones from the downloaded archives. Maybe for Office 365 is some special treatment necessary which is better handled with the newer versions of the files.


    Mfelber solved this here: https://github.com/osTicket/osTicket/issues/3726#issuecomment-344383132

This discussion has been closed.