Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > AppleScript and Mail.app (Panther): HTML message content?

AppleScript and Mail.app (Panther): HTML message content?
Thread Tools
Senior User
Join Date: Nov 2002
Location: US
Status: Offline
Reply With Quote
Nov 14, 2003, 09:39 AM
 
Just learned AppleScript yesterday and I'm still trying to hook up Mail.app with a Python script so that I can do regex matching with incoming messages for spam filtering.

One problem I have is "content of theMsg" (theMsg is a message matched by a rule) returns me an EMPTY string when the message is in HTML! If I use "source of theMsg" then for HTML messages it only gives me the sender of the messages!

Without this I can't match any incoming HTML messages, which, unfortunately, is the format that most junk mails nowadays are in.

Another question is, lots of these spam bastards encoded their HTML messages using characters such as   . I certainly can translate that back to originals and do matching, but I'm wondering if it's possible to send HTML message off to webkit and get back a translated message (without these encoded characters)?

Thx a lot!
     
Senior User
Join Date: Nov 2002
Location: US
Status: Offline
Reply With Quote
Nov 14, 2003, 12:17 PM
 
Ok I solved both problems

Problem 1: there's still unsolved mystery as to why content of a message is only a single '?' when it's in HTML, but it turns out if I use source of a message, it's ok, AS LONG AS I use 'qouted form of' in 'do shell script', cuz there might be " inside message source (of course!)

Problem 2: I just did this in my Python script, so now those smart-ass 'viagra' encoded in &#xx; will just show up for matching!
     
Senior User
Join Date: Nov 2002
Location: US
Status: Offline
Reply With Quote
Nov 14, 2003, 01:31 PM
 
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 02:25 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2