Hacker News new | ask | show | jobs
by Shyaamal11 103 days ago
The spam scoring caught my eye — 45+ heuristic signals is a lot. How do you handle false positives for transactional emails? A password reset or order confirmation might legitimately trigger some of those signals (no unsubscribe, image-heavy, urgent language) even though they're completely clean emails. Does the transactional exemption you mention cover most of those cases or is there still manual tuning needed?
1 comments

Good question! The engine handles this at two levels:

Auto-detection: It scans for transactional signals ("reset your password", "order confirmation", OTP codes, etc.). If it finds 2+, it automatically downgrades the missing-unsubscribe penalty to zero.

Explicit declaration: Callers can pass `emailType: "transactional"`, which fully exempts from both unsubscribe and CAN-SPAM physical address checks.

The compliance rules (unsubscribe, physical address) get exempted because they don't legally apply to transactional mail. But deliverability rules (image ratio, hidden text, deceptive links) stay active intentionally. A transactional email that's 100% images is still a deliverability problem regardless of type.

In practice, well-crafted transactional emails rarely trigger those remaining rules since they tend to be simple, text-forward templates.