Quick and Dirty Sieve Script to add Missing "Subject" Header
Hello!
I subscribe to a fax service that sends an E-Mail notification of incoming faxes. As luck would have it, notification messages do not have a "Subject" header. Not having composed Sieve scripts for a while, I've gotten rusty and would appreciate anyone who's willing to share her or his knowledge for a Sieve script to add the missing header. Cannot use the sender's E-Mail address because I also receive sent fax confirmations that do contain a Subject header. The sender's name without the E-Mail address could be use because the name is different for sent fax confirmations. Thank you. -- Jacinto |
Quote:
Code:
if not exists "Subject" { Note, the extraction of the name from the From header is more-or-less paraphrasing what FM generates for the UI "From name" (no preview) condition. It allows any number of leading spaces, names enclosed in quotes, and any number of spaces before the '<' preceding the email address. This match will fail if there is no name so I added a placeholder to handle that case but I don't know what you want to do for that case. |
Good morning and thank you, xyzzy!
Looks good. I'll play with it over the weekend and report how I made out. Thank you, again. -- Jacinto |
Quote:
Code:
require ["fileinto", "regex", "variables", "editheader"]; The test cases I used were, Code:
From: name <> Code:
From: "a name" <> |
All times are GMT +9. The time now is 01:51 PM. |
Copyright EmailDiscussions.com 1998-2022. All Rights Reserved. Privacy Policy