Solved

MailApp Apple script help

Posted on 2004-08-22
3
305 Views
Last Modified: 2013-11-17
I have never written an applescript, and would
very much appreciate any help that anyone could give.

I am trying to find a way to copy the long header information
from all the messages in my junk mail box into a single
document; I then send the information on to our system
manager, who uses it to control spam.

Any suggestions will be appreciated.
0
Comment
Question by:mrocek
  • 2
3 Comments
 
LVL 30

Expert Comment

by:weed
ID: 11866549
Hmmm, not quite sure how you want to go about that one. Writing an applescript would work, but youre going to need more than a basic understanding of applescript to do it. It might just be easier to show the package contents on your Junk mailbox in the ~/library/mail folder. Find the mbox file within it, and send them the file. It's got all the junk with headers. If you wanted to clean it up for them, you could write a grep search/replace in BBEdit which would be easier than applescript.
0
 
LVL 23

Accepted Solution

by:
brettmjohnson earned 500 total points
ID: 11872698
You can run the following command from Terminal.app.
(It is all one line)

awk '/^[Ff]rom / { inhead = 1 }; /^$/ {if (inhead)  { print; inhead = 0; }}; { if (inhead) print; }' ~/Library/Mail/Mailboxes/Junk.mbox  > ~/Desktop/JunkHdrs.txt

0
 
LVL 23

Expert Comment

by:brettmjohnson
ID: 11876818
I just noticed a dumb error in my poste.  We need to parse the mbox file inside the Junk.mbox directory:

awk '/^[Ff]rom / { inhead = 1 }; /^$/ {if (inhead)  { print; inhead = 0; }}; { if (inhead) print; }' ~/Library/Mail/Mailboxes/Junk.mbox/mbox  > ~/Desktop/JunkHdrs.txt

0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
URL to download SonicWALL Net Extender for Mac application 4 51
Apple Mackbooks 8 94
Minimum requirements to develop Apple App 8 57
Appleid 5107 1 32
This article describes in detail how to set up the iPad in the Enterprise using iPCU aka iPhone Configuration Utility.  This could also be used for the iPhone although I have not detailed out any differences. Preparation as an iPad Administrator:…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question