Re: Outlook Express: automating spam forwarding
Re: Outlook Express: automating spam forwarding
- Subject: Re: Outlook Express: automating spam forwarding
- From: Paul Berkowitz <email@hidden>
- Date: Sat, 13 Apr 2002 14:39:32 -0700
On 4/13/02 1:46 PM, "Gnarlodious" <email@hidden> wrote:
>
Has anyone, Berkowitz or otherwise, written a script for OE's menu to
>
forward selected spams to a contact group titled "UBE's" then delete the
>
headers from "sent items"
Nope. It's possible that Allen Watson or Barry Wainwright or someone else
has done the first part, or at least forwarding spam to a contact.
>
>
Hope that makes sense...
>
Not entirely.
1) How are you defining "spam"? If you define criteria specifically (email
address or whatever), that's pretty easy . If it's by OE's definition of
Junk status ("Is junk mail") , build that as the criterion for the Rule
that's doing the filter, which is easy enough, because OE's AppleScript
doesn't know about "junk status". (If you need to do it further down the
road, in Entourage you could use the rule to assign a Junk or Spam category,
but that isn't available in OE. If there's some other to define spam, what
would it be?
2) Just curious: why would you be forwarding spam to a whole group?
3) If a straightforward OE rule won't work, a script sending a message can
simply put the name of the group as the recipient, and it will work
(undocumented, but true). Entourage has a 'forward' command, but O doesn't:
you have to construct it yourself, with as much attention to replicating
formatting detail as you feel up to. (You can use stuff from some of my OE
scripts like Reply with CC, if you wish.)
But I don't think you need a script. Make a Rule:
Criteria:
<Is junk mail>
Action:
<Forward to Group> <Name of Group>
<Run AppleScript> <See 4 Below>
4) You can't modify headers of an existing message. What you can do is get
the source and headers in variables, strip the headers-part out of the
source-variable, make a new message with the modified source, and delete the
original message. But what do you mean "all the headers"? ALL the headers?
There might be something which simply has to be there (perhaps a From
header, or Date header, or most likely a "Received" header), and OE may
substitute some default, or error. You'll have to try it out. There's also
a very bad bug I discovered which you'll have to be alert to: searching for
one string inside another in OE will erroneously turn up no result if the
search string begins after character 1 of the main string and ends after
character 255. You're OK for the whole set of headers , no matter how long,
because they begin with character 1 of the source. also if you're really
cutting out all the headers (if it works, which I don't think it will
quite), you can just count the text of the headers and start with the next
one.
The essence of the script would be:
tell app "Outlook Express"
set theMsg to item 1 of (get current messages) -- filtered message
tell theMsg
set {theSource, theHeaders, theFolder} to {source, headers,
storage}
end tell
set h to length of theHeaders
set dumbSource to text (h + 1) thru -1 of theSource
make new incoming message at theStorage with properties
{souce:dumbSource}
delete theMsg
end tell
But, frankly, i expect you'll have to extract certain headers from the
original , probably the Received header(s - there are usually a few of
them), which you can do by using AppleScript's text item delimiters. But
that's where you run into the bug, unless just one Received header will do.
Then search for 'return' as the termination of this header, and use your
result as part of dumbSource, which may also need ;
Mime-version: 1.0
Content-type: text/plain; charset="US-ASCII"
Content-transfer-encoding: 7bit
or whatever came with the message. You see, it starts to get a bit
complicated.
5) I haven't actually used OE in 2 1/2 years, and now that I'm full time in
OS X, and finding starting up Classic a bother since I never need it, I'm
getting a bit out of touch with OE. So - good luck!
--
Paul Berkowitz
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.