We noticed a wrong behaviour on Reject Action filtered tickets both in RC3 and in RC4 (not tested previous RC versions).

We have Apache2 + php 8.0
We have setup accounts, remote mailbox and fetching configuration and everything is working fine (email fetched, tickets created, email deleted as per configuration)

We have setup a filter as follow
Filter Name -> Undelivered Reject
Execution Order -> 1
Stop processing further on match
Filter status -> Active
Target channel -> Email

Filter Rules
Ticket/Issue Summary Contains "Undelivered Mail Returned to Sender"
Filter Actions
Reject Ticket

We sent an email with "Undelivered Mail Returned to Sender" as subject to the above email account already configured and tested.

The Filter works as expected as the ticket is not created and the System Logs dashboard reports the following message:
Ticket denied Ticket rejected (....@....) by filter "Undelivered Reject"
So far so good ...

Issues are:

  • one more message appears in the System Logs (and also in the cron error logs sent to local mail user www-data)
    API Error (403) Ticket denied
  • the email in the mailbox results as "seen" but is not deleted
  • following cron executions (every 5 minutes as per our configuration) then continue to process the same email showing the same messages until the email is deleted from mailbox "by hand"

We reproduced the same configuration and steps on a 1.15.8 installation and the behaviour is as expected (only first warning message in System Logs dashboard, email correctly deleted from mailbox, ...)
Here we have apache2 + php 7.4
Hope to have been clear ... and somehow useful to improve the excellent work the community is doing here.

Thanks

    fnasti

    So you're basically saying when a ticket is rejected it's not deleted? Can you post a screenshot of your Fetch settings for the system email?

    Cheers.

    Yes, when a ticket by email is rejected by a Filter the relative email is not deleted from the mailbox and some warnings/errors appears

    As I said other tickets, even with others filters active (to set Department based on email address for example), are working as expected and the emails are deleted from the mailbox.

      fnasti

      I think it's because we aren't catching an error somewhere. We'll take a look.

      Cheers.

      As an added information:

      The following is the cron log when the API error (403) appears in the System Logs Dashboard

      (403) Ticket denied
      PHP Fatal error: Uncaught Error: Call to undefined method osTicket\Mail\Fetcher::getHost() in /var/www/html/include/class.mailfetch.php:105

      So we've tried to comment out the above line and then the cron log only reports
      (403) Ticket denied

      and the following message appears in the System Logs Dashboard
      Mail Fetcher Excessive errors processing emails for 1/2. Please manually check the inbox.

      I guess the point is:
      why this Mail Fetcher Error occurs only when the Reject filter is applied?

      Thank you

        fnasti

        Thank you for reporting this error. We can confirm that it is an error in how we are handling rejections. We will work to provide a patch and it will be included in the next release.

        Cheers.

        25 days later

        Hello,

        I updated our system to the new version 1.17 on Friday and the same problem. Email are not retrieved unfortunately. We also use PHP8.0 because PHP8.1 does not work with the LDAP plugin yet.

          a month later

          Hello there,

          Unfortunately, the problem still exists with the API error 403. For us, the error occurs when certain e-mails are in the mailbox ready for pickup. Does anyone have an idea what to do?

            IT-Wizard

            We did address this however it appears certain cases still make logs for some reason. We will look into this.

            Cheers.

              KevinTheJedi

              Thank you very much! I hope the problem can be solved. If there is anything you want me to test, feel free to let me know.

              UPDATE:
              When I remove certain email from the mailbox (manually), retrieving the email works again. Is this possibly related to the Ban Filter system? If I delete the filters, it works. However, these filters are needed.

              i hope that can help you:

                KevinTheJedi Thank you for the information! 🙂

                UPDATE:
                Unfortunately it does not work with POP3 either. As soon as the one email address is in the block list.

                  IT-Wizard

                  You need to apply the above changes. We applied this in our hosting platform and the issues were resolved.

                  Cheers.

                  What changes are you talking about? I changed it from IMAP to POP3 and the problem persists. I do not know what else to do? Can you maybe explain it to me in short points?

                    IT-Wizard

                    The change I linked above is not included with v1.17.2 so you have to manually apply the changes I linked above.

                    Cheers.

                    a month later

                    Kevin,

                    I was able to apply the php updates manually (hoping I did them correctly)
                    The email fetch still doesn't seem to be working.
                    I'm wondering what I could've missed? I've rebooted the server, as well as manually run the cron (we use auto)
                    It's entirely possible that I missed something or performed a task 'out of order'
                    There are a few emails stuck in the inbox, but no longer any errors with incorrect addresses or banlist problems.
                    Any suggestions?

                      tnolan

                      I would recommend moving the mail out of the folder and test some new mail. Do you see anything in your system logs? Can you run cron manually to see if it spits out any errors?

                      Cheers.