Limiting matches for SMTP template rules

Limiting matches for SMTP template rules to envelope and headers
Partial fix for issue #32