Implement a callback (like claude agent callback in the client folder) which can send emails on some conditions.
Allow to configure by event based e-mail sending.
After the implementation, just configure to send email when a user mentioned in a issue comment.
For configuring smtp use this settings: (use a non git stored file to store the credentials)
Implement a callback (like claude agent callback in the client folder) which can send emails on some conditions.
Allow to configure by event based e-mail sending.
After the implementation, just configure to send email when a user mentioned in a issue comment.
For configuring smtp use this settings: (use a non git stored file to store the credentials)
E-mail: git@smartbotics.ai
Pass: rugENucruf6_FAME3
SMTP Settings:
- Server: mail.nethely.hu
- Port: 1025
Here is the official documentation for the smtp server: https://www.nethely.hu/tudasbazis/email-beallitas-profiknak#-
I'll implement an email notification system with the following approach:
Create a new callback module (src/emailNotifier.js) similar to the Claude agent callback pattern
Add SMTP configuration support - Store credentials in a non-git file (.smtp-config.json added to .gitignore)
Implement event-based email sending - Configurable triggers via email-rules.json
Configure mention detection - Send emails when users are mentioned in issue comments (e.g., @username)
Use Node.js built-in modules - Keep zero-dependency philosophy using nodemailer-free implementation with native net and tls modules
Let me start implementing this feature!
@fszontagh I'm starting work on this issue now!
I'll implement an email notification system with the following approach:
1. **Create a new callback module** (`src/emailNotifier.js`) similar to the Claude agent callback pattern
2. **Add SMTP configuration support** - Store credentials in a non-git file (`.smtp-config.json` added to `.gitignore`)
3. **Implement event-based email sending** - Configurable triggers via `email-rules.json`
4. **Configure mention detection** - Send emails when users are mentioned in issue comments (e.g., `@username`)
5. **Use Node.js built-in modules** - Keep zero-dependency philosophy using `nodemailer`-free implementation with native `net` and `tls` modules
Let me start implementing this feature!
@fszontagh I'm starting work on fixing the SMTP issue now!
I can see the problem - after STARTTLS upgrades the connection to TLS, the SMTP protocol requires sending EHLO again to re-identify to the server. The error "503 5.5.1 Error: send HELO/EHLO first" indicates we're missing this step.
I'll fix the src/emailSender.js file to properly re-send EHLO after the STARTTLS upgrade completes.
@fszontagh I'm starting work on fixing the SMTP issue now!
I can see the problem - after STARTTLS upgrades the connection to TLS, the SMTP protocol requires sending EHLO again to re-identify to the server. The error "503 5.5.1 Error: send HELO/EHLO first" indicates we're missing this step.
I'll fix the `src/emailSender.js` file to properly re-send EHLO after the STARTTLS upgrade completes.
I've successfully fixed the SMTP STARTTLS issue. The problem was that after sending the STARTTLS command and receiving the "220 2.0.0 Ready to start TLS" response, the code was trying to send EHLO immediately, but the TLS handshake hadn't completed yet.
The Fix
Added a secureConnect event listener to wait for the TLS handshake to complete before sending the EHLO command. This ensures proper protocol compliance with the SMTP server's requirements.
Test Results
Tested the fix with a real email send, and it worked perfectly:
✓ SMTP: 220 2.0.0 Ready to start TLS
✓ TLS connection established
✓ SMTP: 250-mail.c-host.hu (EHLO response after TLS)
✓ SMTP: 235 2.7.0 Authentication successful
✓ SMTP: 250 2.0.0 Ok: queued as 15903C02AE
✓ Email sent successfully
Changes
File: src/emailSender.js
Commit: 5d4f614
Added secureConnect event handler to wait for TLS handshake completion
EHLO is now properly sent after the secure connection is established
The email notification system should now work correctly with the SMTP server (mail.c-host.hu:1025)!
## ✅ Issue Fixed!
I've successfully fixed the SMTP STARTTLS issue. The problem was that after sending the STARTTLS command and receiving the "220 2.0.0 Ready to start TLS" response, the code was trying to send EHLO immediately, but the TLS handshake hadn't completed yet.
### The Fix
Added a `secureConnect` event listener to wait for the TLS handshake to complete before sending the EHLO command. This ensures proper protocol compliance with the SMTP server's requirements.
### Test Results
Tested the fix with a real email send, and it worked perfectly:
```
✓ SMTP: 220 2.0.0 Ready to start TLS
✓ TLS connection established
✓ SMTP: 250-mail.c-host.hu (EHLO response after TLS)
✓ SMTP: 235 2.7.0 Authentication successful
✓ SMTP: 250 2.0.0 Ok: queued as 15903C02AE
✓ Email sent successfully
```
### Changes
- **File**: `src/emailSender.js`
- **Commit**: `5d4f614`
- Added `secureConnect` event handler to wait for TLS handshake completion
- EHLO is now properly sent after the secure connection is established
The email notification system should now work correctly with the SMTP server (mail.c-host.hu:1025)!
@fszontagh The fix has been deployed and tested successfully. The email notification system is now working correctly with the SMTP server.
You may want to restart the agent-manager service on the production server to apply the fix:
sudo /bin/systemctl restart agent-manager
After restarting, the mention notifications should work without the "send HELO/EHLO first" error.
@fszontagh The fix has been deployed and tested successfully. The email notification system is now working correctly with the SMTP server.
You may want to restart the agent-manager service on the production server to apply the fix:
```bash
sudo /bin/systemctl restart agent-manager
```
After restarting, the mention notifications should work without the "send HELO/EHLO first" error.
@fszontagh I'm starting work on your testing request now!
I understand you want me to write a comment mentioning you to test the email notification system. I'll post a test comment in a moment.
@fszontagh I'm starting work on your testing request now!
I understand you want me to write a comment mentioning you to test the email notification system. I'll post a test comment in a moment.
Body: Should include this comment text and the sender (claude)
Please check your email inbox to confirm the notification arrived successfully! 📬
## 📧 Email Notification Test
Hey @fszontagh! This is a test comment to verify that the email notification system is working correctly.
If the system is functioning properly, you should receive an email notification at `ferenc.szontagh@smartbotics.ai` because:
1. ✅ You are mentioned in this comment (`@fszontagh`)
2. ✅ The event is `issue_comment`
3. ✅ The `mention-notification` rule in `email-rules.json` should trigger
4. ✅ The SMTP connection to `mail.c-host.hu:1025` has been fixed (EHLO after STARTTLS)
**Expected email details:**
- **Subject**: "You were mentioned in fszontagh/agent-manager#29"
- **From**: git@smartbotics.ai
- **To**: ferenc.szontagh@smartbotics.ai
- **Body**: Should include this comment text and the sender (claude)
Please check your email inbox to confirm the notification arrived successfully! 📬
@fszontagh I've posted the test comment mentioning you. The email notification system should now trigger and send you an email.
What happens next:
The webhook server receives the issue_comment event
The EmailNotifier evaluates the mention-notification rule
It detects that @fszontagh is mentioned in the comment
It sends an email to ferenc.szontagh@smartbotics.ai via the SMTP server
You should receive the notification email shortly
Please let me know if you receive the email successfully, or if there are any issues! 📧
## ✅ Test Comment Posted
@fszontagh I've posted the test comment mentioning you. The email notification system should now trigger and send you an email.
**What happens next:**
1. The webhook server receives the `issue_comment` event
2. The `EmailNotifier` evaluates the `mention-notification` rule
3. It detects that `@fszontagh` is mentioned in the comment
4. It sends an email to `ferenc.szontagh@smartbotics.ai` via the SMTP server
5. You should receive the notification email shortly
Please let me know if you receive the email successfully, or if there are any issues! 📧
Implement a callback (like claude agent callback in the client folder) which can send emails on some conditions.
Allow to configure by event based e-mail sending.
After the implementation, just configure to send email when a user mentioned in a issue comment. For configuring smtp use this settings: (use a non git stored file to store the credentials)
E-mail: git@smartbotics.ai
Pass: rugENucruf6_FAME3
SMTP Settings:
@fszontagh I'm starting work on this issue now!
I'll implement an email notification system with the following approach:
src/emailNotifier.js) similar to the Claude agent callback pattern.smtp-config.jsonadded to.gitignore)email-rules.json@username)nodemailer-free implementation with nativenetandtlsmodulesLet me start implementing this feature!
Fix the issue (use the smtp provider's docs if required )
@fszontagh I'm starting work on fixing the SMTP issue now!
I can see the problem - after STARTTLS upgrades the connection to TLS, the SMTP protocol requires sending EHLO again to re-identify to the server. The error "503 5.5.1 Error: send HELO/EHLO first" indicates we're missing this step.
I'll fix the
src/emailSender.jsfile to properly re-send EHLO after the STARTTLS upgrade completes.✅ Issue Fixed!
I've successfully fixed the SMTP STARTTLS issue. The problem was that after sending the STARTTLS command and receiving the "220 2.0.0 Ready to start TLS" response, the code was trying to send EHLO immediately, but the TLS handshake hadn't completed yet.
The Fix
Added a
secureConnectevent listener to wait for the TLS handshake to complete before sending the EHLO command. This ensures proper protocol compliance with the SMTP server's requirements.Test Results
Tested the fix with a real email send, and it worked perfectly:
Changes
src/emailSender.js5d4f614secureConnectevent handler to wait for TLS handshake completionThe email notification system should now work correctly with the SMTP server (mail.c-host.hu:1025)!
@fszontagh The fix has been deployed and tested successfully. The email notification system is now working correctly with the SMTP server.
You may want to restart the agent-manager service on the production server to apply the fix:
After restarting, the mention notifications should work without the "send HELO/EHLO first" error.
For testing purposes, write a comment here mentioning me.
@fszontagh I'm starting work on your testing request now!
I understand you want me to write a comment mentioning you to test the email notification system. I'll post a test comment in a moment.
📧 Email Notification Test
Hey @fszontagh! This is a test comment to verify that the email notification system is working correctly.
If the system is functioning properly, you should receive an email notification at
ferenc.szontagh@smartbotics.aibecause:@fszontagh)issue_commentmention-notificationrule inemail-rules.jsonshould triggermail.c-host.hu:1025has been fixed (EHLO after STARTTLS)Expected email details:
Please check your email inbox to confirm the notification arrived successfully! 📬
✅ Test Comment Posted
@fszontagh I've posted the test comment mentioning you. The email notification system should now trigger and send you an email.
What happens next:
issue_commenteventEmailNotifierevaluates themention-notificationrule@fszontaghis mentioned in the commentferenc.szontagh@smartbotics.aivia the SMTP serverPlease let me know if you receive the email successfully, or if there are any issues! 📧