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:
parent
662bfc7b7a
commit
6d7d8a2af8
7 changed files with 510 additions and 24 deletions
|
|
@ -57,13 +57,21 @@ lua -e "require('ssl')" 2>/dev/null && {
|
|||
echo -e "${YELLOW}○${NC} lua-ssl not found (install with: luarocks install --local luaossl)"
|
||||
}
|
||||
|
||||
# Set environment variables for mail (if not set)
|
||||
if [ -z "$FURT_MAIL_USERNAME" ]; then
|
||||
echo -e "${YELLOW}Warning: FURT_MAIL_USERNAME not set${NC}"
|
||||
# Load environment variables from project root
|
||||
echo -e "${YELLOW}Loading environment variables...${NC}"
|
||||
if [ -f "../.env" ]; then
|
||||
echo -e "${GREEN}[OK]${NC} Loading from ../.env"
|
||||
export $(grep -v '^#' ../.env | grep -v '^$' | xargs)
|
||||
else
|
||||
echo -e "${YELLOW}[WARN]${NC} No .env file found in project root"
|
||||
fi
|
||||
|
||||
if [ -z "$FURT_MAIL_PASSWORD" ]; then
|
||||
echo -e "${YELLOW}Warning: FURT_MAIL_PASSWORD not set${NC}"
|
||||
# Check SMTP configuration (korrekte Variable-Namen)
|
||||
if [ -n "$SMTP_USERNAME" ] && [ -n "$SMTP_PASSWORD" ]; then
|
||||
echo -e "${GREEN}[OK]${NC} SMTP configured: $SMTP_USERNAME"
|
||||
else
|
||||
echo -e "${YELLOW}[WARN]${NC} SMTP credentials missing in .env"
|
||||
echo "Add SMTP_USERNAME and SMTP_PASSWORD to .env"
|
||||
fi
|
||||
|
||||
# Change to project directory
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue