POP3 email polling stopped working

I have a suspicion: We also feed our Discourse with emails from mailing lists. If an old message held for moderation is released by the mailinglist moderator, it might be considered as too old by the Discourse filter. Because of the break the loop will be existed. Thus, a single old message could stop all further processing.

2 Likes

Oh, and due to the ordering of this POP email server, it’s going from oldest to newest.

How about this patch @gerhard ? Also, prefer Discourse.handle_job_exception if possible for proper reporting of any other errors.

-           break if mail_too_old?(mail_string)
+           next if mail_too_old?(mail_string)
2 Likes

Thanks for the explanation. That makes sense.

@riking I agree, a proper fix should use handle_job_exception. Feel free to create a PR. :wink:

1 Like

This should fix it.

https://github.com/discourse/discourse/pull/12742

5 Likes