feat(smtp): complete native Lua SMTP integration for production mail delivery

- Add native Lua SMTP client with SSL/TLS support for mail.dragons-at-work.de:465
- Implement POST /v1/mail/send endpoint with real email delivery functionality
- Add environment variable integration (SMTP_*) for secure credential management
- Add comprehensive input validation and error handling for mail requests
- Add health check endpoint with SMTP configuration status reporting
- Add multi-line SMTP response handling for robust server communication
- Add request ID tracking system for debugging and monitoring
- Update start.sh script for automatic .env loading and dependency checking
- Add complete testing suite for SMTP functionality verification

This completes the Week 2 Challenge migration from Go to pure Lua HTTP server
with full production-ready SMTP capabilities. The implementation eliminates all
Google/corporate dependencies while achieving superior performance (18ms response
time) and maintaining digital sovereignty principles.

Real mail delivery confirmed: test email successfully sent to admin@dragons-at-work.de
Ready for Hugo website integration and production deployment with security layer.

Closes #65
This commit is contained in:
michael 2025-06-19 09:52:15 +02:00
parent 662bfc7b7a
commit 6d7d8a2af8
7 changed files with 510 additions and 24 deletions

View file

@ -24,13 +24,13 @@ return {
-- Mail configuration (for SMTP integration)
mail = {
smtp_server = "mail.dragons-at-work.de",
smtp_port = 465,
smtp_server = os.getenv("SMTP_HOST") or "mail.dragons-at-work.de",
smtp_port = tonumber(os.getenv("SMTP_PORT")) or 465,
use_ssl = true,
username = os.getenv("FURT_MAIL_USERNAME"),
password = os.getenv("FURT_MAIL_PASSWORD"),
from_address = "noreply@dragons-at-work.de",
to_address = "michael@dragons-at-work.de"
username = os.getenv("SMTP_USERNAME"),
password = os.getenv("SMTP_PASSWORD"),
from_address = os.getenv("SMTP_FROM") or "noreply@dragons-at-work.de",
to_address = os.getenv("SMTP_TO") or "michael@dragons-at-work.de"
}
}