Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Email processing fails and stops silently on parse errors #6690

Open
LxLasso opened this issue Apr 27, 2024 · 2 comments
Open

Email processing fails and stops silently on parse errors #6690

LxLasso opened this issue Apr 27, 2024 · 2 comments

Comments

@LxLasso
Copy link

LxLasso commented Apr 27, 2024

In Fetcher.processEmails() there is a loop in which Fetcher.processMessage() is called for each email. This retrieves the raw email and calls TicketApiController.processEmail(). Here the elseif (!is_array($data)) test leads to a call to ApiController.parseEmail() which in turn calls ApiController::parseRequest(). If the parser fails, Controller.exerror() is called which calls Controller.onFatalError(). This in turn calls an abstract function onError(), which in the ApiController´s case should lead to the error being logged and an exception being thrown and then there's an exit().

We just had an email in our IMAP mailbox that failed to parse. But we didn't get anything in the log. Email processing simply stopped silently. Based on the code I can't explain it. Perhaps there's some code path inside ApiEmailDataParser that leads to an exit() as well? I had to pull the email as it was a complete showstopper for our support so I can no longer reproduce it. The mail had a 26MB file attachment and unfortunately I can't share it.

To conclude, I see two issues:

  1. Why wasn't anything logged? I can't explain it.
  2. Even if it was logged, Controller.onFatalError() has an exit() inside. This means email processing will always abort if it encounters an unparseable e-mail. That seems pretty harsh to me?
@LxLasso
Copy link
Author

LxLasso commented Apr 27, 2024

We're running 1.17.4, so not the latest. As far as I can tell from the commits done since that shouldn't affect my analysis.

@changyy
Copy link

changyy commented May 1, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants