GithubHelp home page GithubHelp logo

emailjs-imap-handler's People

Contributors

andris9 avatar asutherland avatar austein avatar felixhammerl avatar greenkeeper[bot] avatar gudmundurg74 avatar ltgorm avatar mcav avatar nifgraup avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

emailjs-imap-handler's Issues

An in-range update of nodemon is breaking the build 🚨

The devDependency nodemon was updated from 1.18.5 to 1.18.6.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

nodemon is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

Release Notes for v1.18.6

1.18.6 (2018-11-05)

Bug Fixes

Commits

The new version differs by 1 commits.

  • 521eb1e fix: restart on change for non-default signals (#1409) (#1430)

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

HELP WANTED

HELP WANTED

Felix is not actively maintaining this library anymore. But this is the only IMAP client for JS that I am aware of, so I feel this library still has its value. Please let me know if you're interested in helping out, either via email or open an issue about that.

The work that's on the horizon is:

  • Adding features as per requests
  • Stay up to date with developments in the IMAP protocol
  • Maintenance of the other related emailjs libraries
  • Maintenance and update of emailjs.org

Handling Errors

My app is crashing every time the handler meets an unexpected character. Is there something I'm missing about handling errors? Here's the error stack:

/home/alex/poste/node_modules/wo-imap-handler/src/imap-parser.js:86
                throw new Error("Unexpected char at position " + (this.pos + e
                      ^
Error: Unexpected char at position 4
    at ParserInstance.getElement (/home/alex/poste/node_modules/wo-imap-handler/src/imap-parser.js:86:23)
    at ParserInstance.getTag (/home/alex/poste/node_modules/wo-imap-handler/src/imap-parser.js:44:29)
    at Object.parser (/home/alex/poste/node_modules/wo-imap-handler/src/imap-parser.js:590:31)
    at parse (/home/alex/poste/lib/commands.js:11:18)
    at Object.exports.process (/home/alex/poste/lib/commands.js:21:2)
    at CleartextStream.<anonymous> (/home/alex/poste/lib/imap.js:23:14)
    at CleartextStream.emit (events.js:95:17)
    at CleartextStream.<anonymous> (_stream_readable.js:765:14)
    at CleartextStream.emit (events.js:92:17)
    at emitReadable_ (_stream_readable.js:427:10)

Error when parsing PERMANENTFLAGS?

Hi there,

using the browserbox package I get the following error when I execute client.selectMailbox('INBOX', function(err, mailbox) { ... }:

[2014-10-03T20:11:36.088Z][browserbox IMAP] error parsing imap response: Error: Unexpected end of input at position 202[PERMANENTFLAGS (\Answered \Flagged \Draft \Deleted \Seen reading $has_cal NonJunk Junk de:hacking $label2 $Phishing $Forwarded easter $label1 tagit $MDNSent followup kt-evalution ostern [css3-page]
Error: Unexpected end of input at position 202
    at TokenParser.<anonymous> (/Some/Path/node_modules/browserbox/node_modules/wo-imap-handler/src/imap-parser.js:153:23)
    at /Some/Path/node_modules/browserbox/node_modules/wo-imap-handler/src/imap-parser.js:195:17
    at Array.forEach (native)
    at TokenParser.<anonymous> (/Some/Path/node_modules/browserbox/node_modules/wo-imap-handler/src/imap-parser.js:194:29)
    at /Some/Path/node_modules/browserbox/node_modules/wo-imap-handler/src/imap-parser.js:195:17
    at Array.forEach (native)
    at TokenParser.<anonymous> (/Some/Path/node_modules/browserbox/node_modules/wo-imap-handler/src/imap-parser.js:194:29)
    at TokenParser.getAttributes (/Some/Path/node_modules/browserbox/node_modules/wo-imap-handler/src/imap-parser.js:200:9)
    at ParserInstance.getAttributes (/Some/Path/node_modules/browserbox/node_modules/wo-imap-handler/src/imap-parser.js:120:78)
    at Object.parser (/Some/Path/node_modules/browserbox/node_modules/wo-imap-handler/src/imap-parser.js:605:42)
raw:* OK [PERMANENTFLAGS (\Answered \Flagged \Draft \Deleted \Seen reading $has_cal NonJunk Junk de:hacking $label2 $Phishing $Forwarded easter $label1 tagit $MDNSent followup kt-evalution ostern [css3-page] JunkRecorded $NotJunk NotJunk $NotPhishing $Junk \*)] Flags permitted.

From a guess I would say the [css3-page] screws up the parser as it is expecting to find the closing ] at the very end of the message, could that be?

Any idea how this could be fixed?


For completeness, this is the complete code I execute to get the above error:

var BrowserBox = require('browserbox');
var login = require('./login.js');

var client = new BrowserBox('imap.gmail.com', 993, {
    auth: login,
    id: {
        name: 'My Client',
        version: '0.1'
    }
});

client.onerror = function(err){ console.error(err); }
client.onclose = function(err){ console.error(err); }

client.onauth = function() {
  client.selectMailbox('INBOX', function(err, mailbox) {
    console.log(err || mailbox);
  });
}

// Connect to the server.
client.connect();

Parsing a Single String results in error

If I only send a tag, such as "asdf", through the parser, it results in an error:

Unexpected char at position 4

I am triming my strings and removing all bad characters.

Instead of throwing an error, the parser should return an Object as it does if I include a command ("asdf LOGIN"), such as {"tag": "asdf"}.

Parser fails on [Airmail] folder

When using Airmail account the root folder name is enclosed in brackets: "[Airmail]".
Trying to connect to such an account gives error:
Unexpected section start char [ at position 7 at emailjs-imap-parser.js (422)

Putting in a debug log to log out the command that is failing reveals:
(\HasChildren) "." Trash.[Airmail]

Error parsing IMAP server response

I am issuing a query for multiple body parts, basically something like this:

t uid fetch 585599 (body.peek[1.1] body.peek[1.2])

This results in a response like this:

* 126015 FETCH (UID 585599 BODY[1.2] {0}
 BODY[1.1] {0}
)
t OK Success

This is the correct response, since the message has two alternative message bodies, both of which are empty. But imapHandler.parser() throws a parsing error when passing it the following string:

* 126015 FETCH (UID 585599 BODY[1.2] {0}\r\n BODY[1.1] {0}

I have not dug any deeper at this point.

Encoding issues - garbled japanese characters results after 'parse' function

Hi, I am having issues with my email client. Some users report garbled characters on their ends. Most of these users have non-standard text values. I have managed to reproduce the issue, but not sure how to tackle it. I saw some other tickets suggesting to use different methods, but they did not provide an example.

Here is a git with my issue:

https://github.com/maksimlya/emailjs-imap-handler-garbled-example

Can:
git clone
npm i
npm start

put a breakpoint at
console.log(res);

and see the 'Subject' text is garbled, altho I could read it correctly using TextDecoder.

This is the result I get from 'TextDecoder().decode(testVal):

* 17 FETCH (UID 27 BODY[HEADER.FIELDS (FROM TO CC BCC SUBJECT REPLY-TO MESSAGE-ID REFERENCES IN-REPLY-TO X-WELCOME X-WELCOME-EMAIL X-SSHIDE X-SSSINGLEHIDE DISPOSITION-NOTIFICATION-TO X-CONFIRM-READING-TO RETURN-RECEIPT-TO X-PRIORITY IMPORTANCE)] {81}\r\nFrom: [email protected]\nTo: [email protected]\nSubject: テストメール\n\r\n)

And this is the counter-part of that value after using parse function from this lib:

From: [email protected]\nTo: [email protected]\nSubject: ã��ã�¹ã��ã�¡ã�¼ã�«\n\r\n

Screenshot 2024-05-19 at 15 03 40

Any advice / solution?

I've tried to convert the Uint8Array to string, then converting it back with the 'suggested' method of using 'fromCharCode(0)', but that resulted with other errors of 'Unexpected char at position x', so I'm not quite sure what to do.

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.