fix: Resolve Exchange email server self-signed certificate error
- Add TLS configuration to accept self-signed certificates - Disable TLS/STARTTLS for port 25 when SMTP_SECURE=false - Add ignoreTLS option for Exchange servers on port 25 - Update .env.example with Exchange-specific configuration - Create comprehensive EMAIL_CONFIGURATION.md guide - Support both Exchange internal servers and modern SMTP servers This fixes the "self-signed certificate" error when connecting to Microsoft Exchange servers on port 25 without TLS. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -27,6 +27,15 @@ class ReportService {
|
||||
user: config.email.auth.user,
|
||||
pass: config.email.auth.pass,
|
||||
},
|
||||
// For Exchange Server on port 25 without TLS
|
||||
tls: {
|
||||
rejectUnauthorized: false, // Accept self-signed certificates
|
||||
// If you want to disable TLS completely when secure is false:
|
||||
...(config.email.port === 25 && !config.email.secure ? { enabled: false } : {})
|
||||
},
|
||||
// Disable STARTTLS for port 25 if not using secure
|
||||
requireTLS: config.email.secure,
|
||||
ignoreTLS: config.email.port === 25 && !config.email.secure,
|
||||
});
|
||||
|
||||
// Verify connection
|
||||
|
||||
Reference in New Issue
Block a user