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

"New Message Alert" never sends email

I have a new installation that I'm testing before go-live. Having an issue where I, the agent, as not receiving a New Message Alert email. Steps to reproduce:

Prerequisite: No agents logged into SCP
1. User "john@gmail.com" sends email to "help@company.com"
2. Cron runs, retrieves email, User and Agent get New Ticket Email.
3. Agent logs in and assigns to himself -> this step isn't necessary as the ticket is auto-assigned to agent's team.
4. User replies to New Ticket Email with "here's some more information...."
5. Cron runs, retrieves email, Agent (still not logged into SCP), never receives a New Message Alert email.

System Logs: nothing about this -> running in Debug

osTicket 1.10.1
Apache 2.4.25 running behind Nginx reverse proxy
MySQL 5.7.17
PHP 7.2.3

PHP Extensions: All checked except APCu

I have also ensured that the New Message Alert is enabled in Settings > Tickets > Alerts and Notices > New Message Alert (enabled, Last Respondent checked, Assigned Agent / Team checked).

I have also ensured that the New Message autoresponder for the department that this ticket belongs to is not disabled in Agent > Departments > Autoresponder Settings > New Message (not checked).

Comments

  • Your PHP version might be a little too high, I think 7.0ish is ok.

    There are some PRs floating about which may fix some of this, however, I've just stuck with PHP 5.6 for now.
  • @pcjkollmorgen is correct. osTicket does not support over PHP 7.0, and some 7.0 users have reported some "wonkiness" to borrow a term from ntozier :-)

    Also Nginx is not supported because it does not work out of the box without alot of extra configuation changes. A search of github will point you toward some of those threads as well.


  • I made a fix to class.ostsessions.php for php7.2 already. Wasn't aware of any others. I definitely won't be going back to 5.6. Is there a solid version of 7.0.x that's been proved?
  • I've downgraded to 7.0 and then to 5.6 and still the same result. I cleared out all old tickets by deleting them and retested from scratch. I know this functionality works, I've seen it in other installs of osT, but it's not working in my new install.

    Can I get some more help please? I'm presently running this on PHP 5.6
  • @blueyeguy, nginx is used as a reverse proxy in front of Apache. It's working just fine as a web proxy, no issue there. Only issue presently is with sending email upon receipt of a new message to an existing ticket.
  • Q: Is there a solid version of 7.0.x that's been proved?
    A: I run v1.10.1 under PHP 7.0.  I made a few (3) minor changes to my installation but they weren't related to the version of PHP (iirc).

    Q:Can I get some more help please? 
    A: Sure.  First thing I would do is ask how you have email setup.  And I would use the email diagnostic test in the admin panel.
    Admin panel -> Emails -> Diagnostic

    Then if that didn't help, I would check my mail servers logs to see if what was being logged for messages.

    I've never setup a reverse proxy personally and do not use nginx so I dont know if this would have any effect on mail.  I guess it would depend on if you were running a mail exchange on the localhost or using a web connection to a mailserver to send email.
  • @ntozier, first, I want to personally thank you for your many years of service towards osTicket. I remember seeing you diligently helping users years ago in this forum.

    I decided to drop all the tables and start from scratch (with the exception of the local files). I copied back the setup/ folder and re-installed.

    I setup all settings again, re-tested - same result :(

    I didn't see any issue with PHP7.0. I had to apply a code change for PHP7.2. I'm fully running the site now on PHP5.6

    I use two email accounts: help@company.com and billing@company.com. Each of these have their own paid Office365 account. Both accounts are configured to fetch directly from O365 using IMAP+SSL on port 993. Both accounts are configured to send SMTP to our internal relay server, mailrelay.company.com on port 26 with no authentication. I have incite into this mailrelay and can see if any attempts for SMTP were made - there were none for these "New Message Alert" emails. 

    Using the Email Diagnostic, I can successfully send emails to an external account (john@gmail.com) from both email accounts.

    I'm really at a loss.
  • I assume you have checked your "Alerts and Notices" settings? 

    Admin Panel > Settings > Tickets > Alerts and Notices
  • Yup... from first post...

    "I have also ensured that the New Message Alert is enabled in Settings > Tickets > Alerts and Notices > New Message Alert (enabled, Last Respondent checked, Assigned Agent / Team checked)."

    I've scoured the entire Admin panel, and believing that I understand what all the options do, feel confident that I have this properly configured to send this type of email.
  • @umuzidan You're very welcome. :)  And yes I've been here for years trying to help people. 

    "Both accounts are configured to send SMTP to our internal relay server, mailrelay.company.com on port 26 with no authentication."

    Out of curiosity, are you using the SMTP service on a windows server?  We use that internally here (server 2012 r2).  And I've noticed that nothing sends through it out to non-domain addresses. [Which I'm okay with since our ticket system is really for employees anyway.] But it got me to wondering if maybe you were seeing the same thing, and that the reason your not seeing anything in the logs is that the message is just being rejected since its off domain.
  • We run Xeams on Server 2016 in HA. This doesn't perform any filtering. Xeams is configured to pass the data through our Amazon SES mail relay service. All emails sent from osTicket will use @company.com. Inside of Amazon SES, @company.com is an authenticated domain with DKIM and will send any word@company.com. If an email is passed to Xeams (internal relay) from a domain name that's not authenticated with Amazon SES, it will sit in the outbound queue and email me as the admin with a notification. Our mail relay has not received any SMTP attempt from osTicket for the "New Message Alert" email.
  • Okay then well that's really weird.  Especially since I use new message alerts to prompt me to log into the ticket system a lot (but a lot I mean mean a few times a day mon-fri).

    Question.  Step 3 of your summary of actions.
    Does the Agent actually update the ticket with a reply?  I'm wondering is maybe it doesn't send the mail because there hasn't been an agent update so the system figures that the agent will see it when they log in to service the ticket.  Which if that's the case then i learned something new today, and I dont think that I like it.
  • I've tried all those variations. Not even once was I able to produce this email. Which is very weird. I'm actually very sure that an agent doesn't need to login first. Once a customer sends the first email, any replies to the "New Ticket Autoresponder" should continue producing a "New Message Alert". 

    Let's go down the debug route. Can you help me find the file and function / or hook that's called once a message has been posted to a ticket? Perhaps we can add a little code to have the function printed and see what's going on. 

    Let me be clear though - I absolutely acknowledge that this is 100% my issue and specific to my hosting system. I'm sure if I went the very traditional route and setup hosting with cPanel, it would work fine. I developed my own web hosting platform that has been a huge success. My Apache container has all the necessary PHP modules, configurations, etc that serves dozens of my customers without any issue. Only I am experiencing this issue as I attempt to implement osTicket on this platform.
  • edited March 8
    Could you provide me a list of the PHP modules you have loaded on your system? php -m

  • Are there any variables in the New Message Alert Template that's not supposed to be there?

    It should look like below:

    image
  • Yes, it looks exactly like yours, except I didn't have ticket.email in your FROM: line. To take it one step further, I removed all variables leaving only text. Still nothing. I'm going to wipe it all clean, files and DB, then configure the absolute minimum to see this work.
  • Update: Ok I've wiped the entire file directory clean, dropped all tables, and started completely from scratch using PHP5.6. What I found if "New Message Alerts" are being sent IF 1) the customer created the ticket from the web interface or if 2) the customer creates the ticket through email AND an agent replies from the web interface.

    There is definitely no "New Message Alert" being sent if the customer replies to the original "New Ticket Opened" auto-responder before an agent logs into the web interface and also posts a comment.

    I've read through class.ticket.php and can't find the exact snippet of code controlling this, though I did experiment with several changes which were all unsuccessful. Here's some that stood out to me but I couldn't confirm through testing:

    (from includes/class.ticket.php)
    1) Section about skipping to log the status if there aren't any comments:
          // Log status change b4 reload — if currently has a status. (On new
            // ticket, the ticket is opened and thereafter the status is set to
            // the requested status).
            if ($hadStatus) {
                $alert = false;
                if ($comments = ThreadEntryBody::clean($comments)) {
                    // Send out alerts if comments are included
                    $alert = true;
                    $this->logNote(__('Status Changed'), $comments, $thisstaff, $alert);
                }
            }

    2) Section about auto-reply but not to respond to bounces and other auto-replies. I wonder if a reply by the customer to the "New Ticket Opened" email is considered an auto-reply, but I couldn't find from grep "auto-reply" what osTicket is considering an auto-reply.
          // Do not auto-respond to bounces and other auto-replies
            $autorespond = isset($vars['mailflags'])
                    ? !$vars['mailflags']['bounce'] && !$vars['mailflags']['auto-reply']
                    : true;
            $reopen = $autorespond; // Do not reopen bounces
            if ($autorespond && $message->isBounceOrAutoReply())
                $autorespond = $reopen= false;
            elseif ($autorespond && isset($vars['autorespond']))
                $autorespond = $vars['autorespond'];

            $this->onMessage($message, ($autorespond && $alerts), $reopen); //must be called b4 sending alerts to staff.

            if ($autorespond && $alerts && $cfg && $cfg->notifyCollabsONNewMessage())
                $this->notifyCollaborators($message, array('signature' => ''));

            if (!($alerts && $autorespond))
                return $message; //Our work is done...
  • @umuzidan

    Ahhh, then this is how it works by default. If you look at the Admin Panel > Settings > Tickets > Alerts & Notices > New Message Alert it says it gets sent to the Last Respondent (the last agent who responded), Assigned Agent/Team, Department Manager, Organization Account Manager. So you either have to have an Agent respond to the ticket, have an Agent assigned to the ticket, have a Manager on that Department, or have an Account Manager on the Organization of the User.

    image

    I hope this helps. Cheers.
  • @KevinTheJedi, thanks. Yeah, I looked very carefully at that and made absolutely sure that all of those were met except the Last Respondent. Still nada, so that's definitely how it works.

    Open-source is all about control, right? So I've taken a further look into class.ticket.php and found a whole section where the autoresponse would be skipped if it met a whole list of criteria, such as an out-of-office reply, if the email was received from an internal address, etc (all for good reasons). I strategically commented out each section to see if I could get it to produce the results I want, but still nothing. I even commented out the entire section, still nothing.

    At this point, I am truly at a sad loss that I can't get this working the way I want. :( I put a lot of time into testing this. I'll still use the product, but was hoping to make it better "for me".
  • @umuzidan

    So the ticket has an Assigned Agent, the ticket's Department has a Manager, or the User's Org has an Account Manager and none of them are getting the New Message Alert? If so something isn't right as it works just fine on all 8 of my installs and works on all @ntozier 's installs as well. Are you seeing any errors in your Apache/PHP error logs?

    Cheers.
  • @KevinTheJedi, that's right, I ensured ALL criteria was met. Not a single error in Apache or PHP, I have all logging turned on.

    Do a test for me please:
    1. Create a new ticket through email
    2. Verify the agent gets an email for the new customer ticket - Expected to work
    3. Verify the customer get an email for the new ticket - Expected to work
    4. Don't log into the site and do anything with the ticket.
    5. Have the customer reply to the new ticket email with some text.
    6. Verify the agent gets an email of a new message appended to the ticket - This is what's not working for me. I have to actually comment on the ticket through the web interface before this email auto-reply starts working.
  • It sounds to me like cron is not running (but you say it is), or maybe that you have (Admin panel -> Emails -> Settings) Fetch on auto-cron enabled and cron isn't actually running...  
  • I monitor the email inbox and can see the email be fetched and deleted. All emails are fetched and imported into the osT DB. New tickets are created, replies are created, only exception is this one scenario instance, very repeatable. 

    Again, I would be very grateful if someone could run the above steps I posted on their own 1.10 instance.
  • This is what's not working for me. I have to actually comment on the ticket through the web interface before this email auto-reply starts working.

    This is because once you respond, you become the "Last Respondent" and "Last Respondent" is one of the four people who get the New Message Alert. Are you the Assigned Agent, Department Manager, or the Organization's Account Manager? If not that's why you aren't getting the alerts.

    In the meantime I'll try your replication steps.

    Cheers.
  • I'm the ONLY user of this helpdesk, so I"m the auto-assigned agent, member of the team, manager of the team, and department manager.
Sign In or Register to comment.