Giter VIP home page Giter VIP logo

Comments (7)

tyzion avatar tyzion commented on June 2, 2024 1

I was able to catch it! I don't know why the first time i couldn't see it! but the catch on the pop3().connect works!
Sorry to have bothered you guys and thanks for the answers!
Don't know if it is in fact the frequency the problem, but today it hasn't given me any activity problem since now!
Anyway, thanks again :)
I think we can close this issue 👍

from node-pop3.

tyzion avatar tyzion commented on June 2, 2024 1

Ok, this time I really got the problem!
It was the fact that after I caught the error, I wasn't QUITting the POP3 session.
It took me 2 months figuring it out, but finally, I got it. Hope this will be helpful to others :)

from node-pop3.

brettz9 avatar brettz9 commented on June 2, 2024

@lianxh do you know about this?

from node-pop3.

tyzion avatar tyzion commented on June 2, 2024

Also, i don't know if this is related to the frequency of the polling, but sometimes it stucks on AUTH error and keeps on for every call to pop3, and then the "Disconnected for inactivity message"

` Error: [AUTH] Authentication failed.
at Socket. (/Users/.../src/server/node_modules/node-pop3/lib/Connection.js:176:24)
at Socket.emit (events.js:315:20)
at Socket.EventEmitter.emit (domain.js:467:12)
at addChunk (internal/streams/readable.js:309:12)
at readableAddChunk (internal/streams/readable.js:284:9)
at Socket.Readable.push (internal/streams/readable.js:223:10)
at TCP.onStreamRead (internal/stream_base_commons.js:188:23) {
eventName: 'error',
command: 'PASS password'
}
events.js:292
throw er; // Unhandled 'error' event
^

Error: Disconnected for inactivity.
...`

from node-pop3.

lianxh avatar lianxh commented on June 2, 2024

@tyzion it seems that the pop3 server has rejected your frequent requests. Maybe you should reduce the frequency of requests.

from node-pop3.

tyzion avatar tyzion commented on June 2, 2024

I think i tried that, but I don't remember, i'll try again

@lianxh In the meantime can i ask you if you know how to handle this kind of error?
Here's my code:

const DELAY = 60000;

async function run(){

    try{
        const pop3 = new Pop3Command({host: process.env.HOST});

        // this is how I tried to catch the unhandled event, but didn't give me any result
        await pop3.connect().catch(err => console.log('this is an err: ', err));
        await pop3.command('USER', process.env.POP3_USER);
        await pop3.command('PASS', process.env.POP3_PASS);

        }

        const [quitInfo, stream] = await pop3.command('QUIT')
        console.log(quitInfo)
    
        setTimeout(run, DELAY)

    } catch(err) {
        console.log('\n\n\n', err)
        setTimeout(run, DELAY)
    }
};
setTimeout(run, DELAY);

from node-pop3.

tyzion avatar tyzion commented on June 2, 2024

Hi, sorry to bother you again
I stopped working on my project for a while. I thought I was through with this problem, but I was wrong, I hadn't caught anything, I just consolled it.
Once I came back to my project I got the same error, no matter how frequent the poll was.
I tried to debug your project a little, but couldn't get anywhere.
What's different from before now is that now it gets disconnected not on the connect commands, but on the others.
@lianxh if you could help me again with this issue, that would be very much appreciated, thanks :)

from node-pop3.

Related Issues (14)

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.