Skip to content

Conversation

@unitythemaker
Copy link
Contributor

Summary

  • Added configurable timeout option for SMTP connections and commands
  • Improved error handling with specific authentication failure messages
  • Enhanced cleanup of socket event listeners to prevent memory leaks

Fixes #19

Changes

  • Added timeout property to SmtpConfig interface for configurable connection/command timeouts
  • Implemented timeout handling in sendSmtpCommand function with proper cleanup
  • Enhanced authentication error messages to provide specific failure reasons for OAuth2, CRAM-MD5, LOGIN, and PLAIN methods
  • Added cleanup function to properly remove event listeners and clear timeouts
  • Added test suite for authentication timeout scenarios

Test Plan

  • Added unit tests for authentication timeout scenarios
  • Tests verify proper timeout behavior with incorrect credentials
  • Tests ensure graceful error handling for authentication failures

…uthentication

- Added configurable timeout option to SmtpConfig interface
- Implemented timeout handling for SMTP commands and connections
- Enhanced authentication error messages with specific failure reasons
- Added cleanup function to properly remove event listeners
- Improved error handling for OAuth2, CRAM-MD5, LOGIN, and PLAIN auth methods
- Added tests for authentication timeout scenarios
@pkg-pr-new
Copy link

pkg-pr-new bot commented Aug 7, 2025

Open in StackBlitz

npm i https://pkg.pr.new/productdevbook/unemail@20

commit: cdc62ad

@unitythemaker
Copy link
Contributor Author

Open in StackBlitz

npm i https://pkg.pr.new/productdevbook/unemail@20

commit: 050b841

@calebeaires Could you try this and report if this solves your problem?

npm i https://pkg.pr.new/productdevbook/unemail@20

@calebeaires
Copy link

👍🏼 totally worked! can't wait to the pull request!

@productdevbook
Copy link
Owner

@unitythemaker If you fix the lint errors, I can merge. Thank you for your contribution.

@luisvinicius09
Copy link

Lint errors are only complaining about a line of code inside README.md file.

I would be glad to see this feature working as soon as possible @unitythemaker

@unitythemaker
Copy link
Contributor Author

@productdevbook lint error is now fixed.

Lowered the SMTP authentication timeout from 5s to 2s and reduced overall test timeouts to speed up test execution and improve reliability.
@productdevbook productdevbook merged commit 4b1d654 into productdevbook:main Aug 9, 2025
5 checks passed
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

Successfully merging this pull request may close these issues.

## Bug Report: sendEmail Does Not Return Error on Wrong Password (createEmailService)

4 participants