AppleScript to extract addresses from a folder

S

Scott McDaniel

Good day.
I have a folder with messages containing various addresses; there are
several hundred of them. I need to add the all of them to a group, or
alternately, extract them to a text file.

Is anyone aware of a way to do so, by looping through the folder and
gathering the addresses?

<Backstory>
I have a newsletter on my site, but it never delivers to all of my users.
The server errors out and I get them all bounced back to me (ugh).
So, the message will actually show 'from' as my servers mail-daemon; the
users addresses are inside a block of text that says this:

-----------
This message was created automatically by mail delivery software.

A message that you sent could not be delivered to one or more of its
recipients. This is a permanent error. The following address(es) failed:

[email protected]
unrouteable mail domain "hotmail.com"
-----------

My host says it's a limitation of the mailer, and they are working on it,
but I need to deliver my newsletter soon. So, I want to gather the addresses
and send them manually.

Thanks for any help you can offer.
 
B

Barry Wainwright

You don't need a script - a mail rule can do this.

Set up a rule with selection criteria 'all mail', and the action 'add sender
to group'. Uncheck the 'enabled' box, so it doesn't fire automatically on
all mail as it arrives!

Now, select the messages you want to process, and choose 'apply Rule' from
either the message window or the contextual menu, then choose your new rule.
 
Top