ป้ายกำกับ: email-receive

Stalwart: วิธีตรวจสอบ และแก้ปัญหาเบื้องต้นStalwart: วิธีตรวจสอบ และแก้ปัญหาเบื้องต้น

เป็นวิธีการตรวจสอบและแก้ปัญหา Stalwart เบื้องต้น


service ไม่ขึ้น

sudo systemctl status stalwart --no-pager
journalctl -u stalwart --no-pager -n 200

สิ่งที่พบบ่อย:

  • อ่านไฟล์ cert ไม่ได้ ( Permission denied )
  • ต่อฐานข้อมูลไม่ได้ ( Access denied / Connection refused )
  • config syntax ผิด

TLS / Cert มีปัญหา

ตรวจ cert ที่พอร์ตเมล

echo | openssl s_client -connect mail.example.com:465 -servername mail.example.com 2>/dev/null | openssl x509 -noout -subject -issuer -dates
echo | openssl s_client -connect mail.example.com:993 -servername mail.example.com 2>/dev/null | openssl x509 -noout -subject -issuer -dates

ถ้า CN ไม่ตรงโดเมน หรือหมดอายุ ให้ต่ออายุ cert แล้ว reload/restart service


ล็อกอินไม่ได้ ( SMTP / IMAP )

  • เช็ก username / password
  • เช็ก permission ของ user ( authenticate, email-send, email-receive, imap-* )
  • เช็กว่า listener พอร์ตเปิดจริง

ss -tulpen | grep -E ':25|:465|:587|:143|:993'


รับเมลไม่ได้ ( RCPT TO โดนปฏิเสธ )

  • ตรวจว่า domain ถูกเพิ่มใน directory แล้ว
  • ตรวจว่ามี user / mailbox จริง
  • reload config หลังแก้

ส่งออกได้แต่เข้าถังสแปม

  • ตั้งค่า PTR ให้ IP เมลเซิร์ฟเวอร์
  • ตั้ง SPF / DKIM / DMARC ให้ครบ
  • hostname / HELO ต้องตรงและ resolve ได้

เช็ก health แบบเร็ว

sudo systemctl is-active stalwart
curl -s -o /dev/null -w '%{http_code}\n' http://127.0.0.1:8081/


อ่านเพิ่มเติม