Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

URGENT | Breaking Change | Cannot set property errored of #<Readable> which has only a getter #35

Closed
palmtown opened this issue Oct 17, 2022 · 7 comments

Comments

@palmtown
Copy link

Hello Community,

Please note that there is a breaking change when using this package with Node.js 18+. In short, it works as expected with Node.js 16.7.x, however, will throw an uncaught error message: 'Cannot set property errored of # which has only a getter' on Node.js 18+.

I traced this error to node_modules/mailsplit/lib/message-splitter.js line 24. In short, the mailsplit package is required by mailparse, in which mailparse is required by node-mailin. It seems mailparse has not been updated in 5 years.

Can you take a look into this issue? Notice to anyone using 18+, it will simply not work any longer. You'll need to downgrade.

Thanks!

@nordluf
Copy link

nordluf commented Oct 17, 2022

@palmtown there is a fork with updated dependencies (to get rid of known vulnerabilities). Mailsplit is updated there as well.

@palmtown
Copy link
Author

Hello @nordluf,

Thanks for your response. Do you know which fork specifically? I am going through the forks now to understand which one solves the referenced issue, however, thought you might know one that has been tested and confirmed working.

Thanks.

@palmtown
Copy link
Author

Hello @nordluf,

Actually, it may be your fork at https://github.com/nordluf/node-mailin :) - Seems mailparserhas been bumped to 3.0.0. I'll give this one a try.

@nordluf
Copy link

nordluf commented Oct 18, 2022

@palmtown Since I am not the only one who wants to use this updated version, I have published an npmjs version: https://www.npmjs.com/package/@umpacken/node-mailin

If you want to do a seamless update, you can use an npm alias in your package.json like this:

-    "node-mailin": "^2.5.0",
+    "node-mailin": "npm:@umpacken/node-mailin@^2.6.1",

@palmtown
Copy link
Author

Hello @nordluf,

Please note that this fix works. Thank you so much for your time in helping to resolve this issue, much appreciated!

@hoiekim
Copy link

hoiekim commented Apr 9, 2023

Can we merge @nordluf 's fix into main branch and release officially?

@CamTosh
Copy link

CamTosh commented Oct 28, 2023

Hey, I have the same issue every time I receive an email. I've tried Node 17, 18, or 20 and node-mailin 2.5.0, 2.6.1, 2.7.0.

info: NodeMailin Smtp server listening on port 25

/mail/node_modules/smtp-server/lib/smtp-stream.js:34
this.closed = false;
            ^

TypeError: Cannot set property closed of #<Writable> which has only a getter
    at new SMTPStream (/mail/node_modules/smtp-server/lib/smtp-stream.js:34:13)
    at new SMTPConnection (/mail/node_modules/smtp-server/lib/smtp-connection.js:55:24)
    at SMTPServer.connect (/mail/node_modules/smtp-server/lib/smtp-server.js:93:26)
    at /mail/node_modules/smtp-server/lib/smtp-server.js:84:26
    at Immediate.<anonymous> (/mail/node_modules/smtp-server/lib/smtp-server.js:345:39)
    at process.processImmediate (node:internal/timers:476:21)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants