Job exception in mail receiver

AI-generated summary

In a Bug category discussion titled ‘Job exception in mail receiver’, carlokok reported a Job exception caused by an invalid byte sequence in UTF-8. The error occurred within the email receiver’s trim_discourse_markers method during the processing of incoming mail via POP3. Carlokok noted they would share the problematic email privately with zogstrip. zogstrip subsequently confirmed that, with the help of the provided email, they were able to reproduce and fix the issue. A commit addressing the bug was shared: 79329c8.

Job exception: invalid byte sequence in UTF-8

/var/www/discourse/lib/email/receiver.rb:181:in `split'
/var/www/discourse/lib/email/receiver.rb:181:in `trim_discourse_markers'
/var/www/discourse/lib/email/receiver.rb:140:in `select_body'
/var/www/discourse/lib/email/receiver.rb:62:in `process_internal'
/var/www/discourse/lib/email/receiver.rb:39:in `process!'
/var/www/discourse/app/jobs/scheduled/poll_mailbox.rb:27:in `process_popmail'
/var/www/discourse/app/jobs/scheduled/poll_mailbox.rb:96:in `block (2 levels) in poll_pop3'
/usr/local/lib/ruby/2.0.0/net/pop.rb:688:in `block in delete_all'
/usr/local/lib/ruby/2.0.0/net/pop.rb:687:in `each'
/usr/local/lib/ruby/2.0.0/net/pop.rb:687:in `delete_all'
/var/www/discourse/app/jobs/scheduled/poll_mailbox.rb:95:in `block in poll_pop3'
/usr/local/lib/ruby/2.0.0/net/pop.rb:531:in `start'
/var/www/discourse/app/jobs/scheduled/poll_mailbox.rb:94:in `poll_pop3'
/var/www/discourse/app/jobs/scheduled/poll_mailbox.rb:15:in `execute'
/var/www/discourse/app/jobs/base.rb:154:in `block (2 levels) in perform'

(I’ll post the mail privately @zogstrip)

1 curtida

Thanks @carlokok, with the help of the incoming email I was able to reproduce and fix the issue :apple:

https://github.com/discourse/discourse/commit/79329c8e85a2e1bc9b3abb6f65fe4afdadec2d9e

4 curtidas