@something_amusing
[ignoring everything in this thread that you didn't post]

You are getting two errors.
The first says Unable to email via SMTP:smtpserveraddress:587 [email@domain.com] Failed to add recipient: @localhost [SMTP: Invalid response code received from server (code: 501, response: 5.1.3 Invalid address)]

The second says Unable to email via php mail function: mail() returned failure

osTicket tries to send an email via SMTP: from email@domain.com to @localhost. Since @localhost is not a valid email address it fails completely.

Since it failed it attempts to fail back to phpmail to send the email. Which once again fails probably for the same reason.

I'm curious why your User has an email address of @localhost instead of well an email address.

    ntozier honestly I thought the @localhost was just a mistake or part of the error. It doesn't matter what email I entered, it always showed that. And the users are successfully created and able to submit tickets. I'll run some more tests and see if I can isolate anything.

    ntozier So, in Agent > User, I can see the user's email. So the system knows their email. And when using the link the user is entering their email along with the ticket number. I can't tell where its getting @localhost from as the email address. Any logging I can turn on to see where that is coming from?

    The only ways that I can think of that might do something like this would be if someone modified the source.

      ntozier it's a fresh install on a fresh Ubuntu image. Nothing customized yet. I'm the only one with access to the server.

      Yes, I used the download from the website. What is develop-next? Is that the release candidate? Assuming so, is there something in particular in that release that would fix this?

      7 days later

      I had the same Problem.
      Error: Failed to add recipient: @localhost [SMTP: Invalid response code received from server
      (code: 550, response: Requested action not taken: mailbox unavailable)].

      So I checked the source code and saw that the $recipient Variable in the addTo- function in class.mailer.php doesn´t transfer an E-Mail-Adress over the Object(User) and the Object (Enduser). I only added the getEmail-function like this: $mime->addTo($recipient->getEmail().""); and it´s working. Could you please check if this change is correct or is there a better solution?

      osTicket-Version v1.11 (d4e240b) — Aktuell
      Server-Software Apache/2.4.18 (Ubuntu)
      MySQL-Version 5.7.25
      PHP-Version 5.6.40-6+ubuntu16.04.1+deb.sury.org+3

        Same issue
        osTicket v1.11 (d4e240b)
        Web Server Apache/2.4.6 (CentOS) PHP/7.0.33
        MySQL 5.5.60
        PHP 7.0.33

        All mail goes well, but if i send a "check status mail" i got two errors:

        • Unable to email via SMTP:mail.xxx.com:25 [user_name] Failed to add recipient: @localhost [SMTP: Invalid response code received from server (code: 501, response: 5.5.4 Invalid Address)]

        • php: mail() returned failure

        1.12 has been released, please update and see if you still have the problem. 1.11 is no longer supported because of a security issue that was found.

        Patrick_V Actually last night we made a slightly different change. It was decided that all users will login with their Active Directory login to view tickets, so we just redirected that page over to the login page and bypassed this issue altogether. Kinda wish we hadn't so I could test that. But thank you.

        Write a Reply...