
I'm dipping my toes in uncharted territory here, but I want to be able to change the From/Reply-To and X-Account attributes for some outgoing emails. Basically, if I mail (or reply) to anyone on employer's domain, I want to make sure that my email is sent from that domain too. I have an account set up but it's a pain to remember to change the account manually on each mail when I create it, otherwise it goes from my personal address. At the moment my failure rate is probably about 20%.

So - I've set an outgoing mail filter to pick up the cases (where recipients include that domain) and to run the little script that I wrote as follows:
- Code: Select all
{ Quit if something goes wrong
Set $OnErrorGoTo Quit
Set $fm "me <me@myworkdomain.com>"
DeleteHeader "From:" %m
AddHeader %m "From:" $fm
DeleteHeader "Reply-To:" %m
AddHeader %m "Reply-To:" $fm
DeleteHeader "X-Account:" %m
AddHeader %m "X-Account:" "Domain account"
Set $a "Something ran!"
AppendBody $a " "
AppendBody $a "Bye!"
Beep
MessageBox $a
:Quit
Exit
Now, I'm getting the messagebox coming up when I send test mails so I know it's running - but when I check the headers of my sent emails, nothing has changed.
I can't figure out why, but I'm very new to scripts so maybe it's something obvious. Any ideas?
Thank you

~ Added code tags ... Eric ~