Git Product home page Git Product logo

Comments (1)

phil8900 avatar phil8900 commented on September 26, 2024

As I ran into the same issue I tried to dig a bit deeper, and the conditions.rb file doesn't seem to be the culprit. For testing purposes and to rule it out, I commented out the line containing @matcher.match(message.body.decoded), but the error still ocurred after that.

Still looking for a solution I looked for occurrences of the keyword "multipart" and stumbled across the following lines of code in the imap_processor.rb in the helpy_imap folder:
def get_content_from_mail if mail_is_mail @email.multipart? ? (@email.text_part ? @email.text_part.body.decoded : nil) : @email.body.decoded else MailExtract.new(@email.body).body end end

Curious as I am, I wanted to know if the email.body could be nil, although by looking at the code this should never be the case. After testing, I was sure that this is not the case.

As of now, I haven't found a solution, but I'll try to figure it out and I will keep the community updated.

Best regards,
Phil

EDIT: I figured it out! The problem lies in the imap_processor.rb, because a plain-text mail doesn't seem to have a text_part.body, just a .body. The following lines of code will fix this problem:

def raw_body_from_mail if @email.multipart? mail_is_mail ? @email.text_part.body.decoded : @email.raw_body else mail_is_mail ? @email.body.decoded : @email.raw_body end end

from helpy_imap.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.