AppleScript to redirect mail from Exchange to mail

Can somebody point me to AppleScript samples that would allow me to redirect mail from Exchange to my Gmail account? (I can't use rules in Mail because Exchange doesn't allow redirect.)

This post doesn't involve applescript.  You could look into one of these options.  Do not know if they work with exchange or not.  The idea is that they log into your account and forware email to another account of yours.
What soda3 does is connect to your email server before you do.  It filters out the junk mail.  It passes the "good stuff" on to you.
http://www.soda3.com/iphone
Don't know how this works, but makes greats claims.  Maybe it works like soda3.  There is a fee.
https://itunes.apple.com/us/app/spamdrain/id346767120?mt=8

Similar Messages

  • SPAM rules on Inbox after migration from Exchange 2003 - GFI Mail Essentials

    Hello,
    Few times ago, we had an Exchange 2003 server with mailboxes which were configured with "rulemgmt.exe" tool (from Microsoft ?) to manage users mailboxes and SPAM redirection in these mailboxes.
    GFI MailEssentials (antispam) was installed on a mail relay and once a SPAM was detected, it was redirected in Inbox/SPAM folder on user mailbox thanks to the rule defined by "rulemgmt.exe".
    Recently, we did a migration from Exchange 2003 to 2010. Unfortunately, "rulemgmt.exe" doesn't work anymore on Exchange 2010 and it's replaced by a "Transport Rule" which works fine but only to redirect SPAMs in Junk e-mail folder. However,
    if I don't set up this transport rule, SPAM redirection still works from mailboxes which were created on Exchange 2003 and e-mails go to Inbox/SPAM as before... For new mailboxes on Exchange 2010, it doesn't work which is normal.
    My question is: for old mailboxes from Exchange 2003, where are the SPAM redirection (Inbox/SPAM) information stored? I don't understand how SPAM can be redirected if the information is not stored in Exchange...
    The aim is to use Junk E-mail folder with the Transport Rule at the end everywhere and to clean old rules used for Inbox/SPAM.
    I contact GFI support but they couldn't help me.
    Any idea?
    Regards,
    DeltaSM
               

    Those old mailboxes probably have old rules still set.  You can use the Outlook.exe /cleanrules switch to purge those old rules.  This would require that you create an outlook profile for each of those impacted mailboxes.
    You can also look at using MFCMapi -
    http://support.microsoft.com/kb/2860406/en-us
    When that is done, you might want to perform a Clean-MailboxDatabase and then look at the mailbox rules (get-inboxrule).  If that does not work for you, could be something else within the mailbox and as such, I would recommend working with MS to get
    more info.
    DaDougInc

  • Mail redirect rule only redirects mail from certain domain!!!

    Hi all,
    I set up a rule in Mail to redirect EVERY message to a certain email address (for backup/storage purposes) However it only redirects emails from email addresses with the same domain as my email (eg will redirect mydomainname.com but not otherdomainname.com
    Why is this??? Any ideas on how to fix it??? It is getting the mail from an Exchange server if that helps any...

    Thanks for the welcome!
    Ok so here are some screenshots...
    Here is the screenshot of the rule details
    Here is the main rules window
    And here is a screenshot showing how some are redirected and some are not (the ones that are redirected (and the one that shows the forward icon (it was forwarded before I set up the redirect rule)) are all from the same domain as my email account.
    Any ideas? Thanks!

  • Cannot send mail from Exchange 2013 to Exchange 2007

    I have an
    Exchange 2007server with all roles in the same server (Version:
    08.03.0327.001 ) on a Windows 2008 R2 server. I have now installed two Exchange 2013 servers both with CAS and MBX roles on Windows 2012 servers
    (full patched). There is also a DAG between the new servers. All mail goes through a BorderWare besides the internal mail.
    I can send mail from both environments to the Internet. I can also send internal mail from Exchange 2007 to Exchange 2013.But the problem is that I am unable to send from Exchange 2013 to Exchange 2007. I've debugged, but not solved the problem and there are
    few articles on the Internet.
    Any suggestions?

    These two sentences are in conflict : "I can also send
    internal mail
    from Exchange
    2007 to
    Exchange 2013. But
    the problem is
    that I am unable
    to send from Exchange
    2007 to
    Exchange 2013. "
    Can you describe what is your real problem? Flow from E2007->E2013? Or vice versa?
    Please mark as helpful if you find my contribution useful or as an answer if it does answer your question. That will encourage me - and others - to take time out to help you. Thank you! Damir

  • Appointments from Exchange 2010 show as Mail in Mailbox

    I have a very frustrating issue with a single user on one of our post offices. For reasons unknown appointments sent to the user from Exchange 2010 appear as mail items instead of appointments within the mailbox. Other users on the same post office do not get the same issue. I have tried resetting the user's views and a full client reset via maintenance. I have set the user's client settings to be the same as another user who does not get the issue without any luck either. Maintenance checks on the account does not flag any errors. I'm pretty certain I'm missing something very simple, but alas I can not think what.
    Software wise we're running client 8.0.1 on post office agent version 8.0.2. We seem to get the same results regardless of the Client version of outlook, (we have tried the web version and 2003 and 2010 of the client). Anything else I could try would be greatly appreciated.
    Kind Regards
    Rob

    In article <[email protected]>, Rob naylor
    wrote:
    > Software wise we're running client 8.0.1 on post office agent version
    > 8.0.2.
    >
    How about updating those as they are a bit old.
    Try looking at that user's account from another machine and from
    WebAccess (if installed).
    It is good to separate the PC from the user account as sometimes an odd
    problem can be from some funky issue on the PC.
    I'm not surprised that different versions of the Exchange 2010 client
    doesn't make a difference as there is the formatting is set when
    Exchange formats the outgoing to the internet.
    A thought there, is your user setup as a contact on the Exchange
    system, there have been settings in the past that caused invalid
    formatting of internet messages. Something to the effect that 'this
    user is on OutLook/Exchange vs regular internet standards'.
    Has there been a single appointment sent from a user on that Exchange
    system to two of your users?
    Andy Konecny
    Konecny Consulting Inc. in Toronto
    "Give more than others think is wise
    Challenge yourself beyond what others think is right"
    Michael 'Pinball' Clemens

  • Pb for rerouting mail in a migration from Exchange 5.5 to OCS 10g R2

    Hi,
    I try to migrate from Exchange 5.5 to OCS 10g R2.
    I meet a pb when I want to migrate an account, rerouting is active.
    The routing alias is created in Exchange (user_es902migration@ocshostname) as well the delegation rule.
    BUT no rewriting rule is created is the OCS server, so the mail I send to this user on Exchange are well received on Exchange but are rejected on OCS.
    Any help is welcome .

    Try to use the "project from WAR file" or "project from existing source" option in JDeveloper and point to either a WAR file produced from Netbeans or the actual source code.
    You then might need to set up libraries and project content as well as web content under the project properties in JDeveloper.
    This how-to shows how we did it with another tool but the general directions should be similar:
    http://www.oracle.com/technology/products/jdev/howtos/1013/w4wljdev/workshopandjdev.html

  • Apple Mail can't send or receive messages from Exchange 2010, Mountain Lion

    Over the last several weeks, I have been unable to send or recieve e-mails from Exchange 2010 in a corprate environment.  I have deleted and re-added the account several times, and sometimes it will fix the issue.  Other times it won't.  I have also tried deleting the account, clearing the cache in ~/Library/Mail/V2/EWS*, and then re-adding the account.  It resolves the issue temporarily, but then returns to not being able to sync.  I've tested it with a number of other users accounts on the same Exchange system, and it's working as expected.  OSX is version 10.8.4 with current patches as of 10/7/2013.
    The connection doctor shows that the connection to EWS is green.  The activity monitor looks like it's updating the folders properly on sync.
    Here is the message I get in the logs in high volume when Console logging is turned on:
    *** Assertion failure in -[EWSConnection sendMessage:forRequest:], /SourceCache/Message/Message-1508/Message/EWS/EWSConnection.m:555
    Received an unexpected error: Error Domain=EWSExchangeWebServicesErrorDomain Code=277 "The operation couldn’t be completed. (EWSExchangeWebServicesErrorDomain error 277.)" UserInfo=0x7fd1c9a97e70 {EWSErrorMessage=The request failed schema validation., NSUnderlyingError=0x7fd1c85106f0 "The operation couldn’t be completed. (SOAPWebServicesErrorDomain error -1000.)"}, response: (null)
              0   CoreMessage                         0x00007fff86a4a517 -[MFAssertionHandler _handleFailureWithPreamble:description:arguments:] + 141
              1   CoreMessage                         0x00007fff86a4a388 -[MFAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 215
              2   Message                             0x00007fff8daa5a8e -[EWSConnection sendMessage:forRequest:] + 762
              3   Message                             0x00007fff8daaeab3 -[EWSGateway sendMessage:forRequest:] + 69
              4   Message                             0x00007fff8dac543a -[EWSRequestOperation executeOperation] + 110
              5   CoreMessage                         0x00007fff86a65b80 -[MonitoredOperation main] + 219
              6   Foundation                          0x00007fff92475926 -[__NSOperationInternal start] + 684
              7   Foundation                          0x00007fff9247d0f1 __block_global_6 + 129
              8   libdispatch.dylib                   0x00007fff87f4af01 _dispatch_call_block_and_release + 15
              9   libdispatch.dylib                   0x00007fff87f470b6 _dispatch_client_callout + 8
              10  libdispatch.dylib                   0x00007fff87f481fa _dispatch_worker_thread2 + 304
              11  libsystem_c.dylib                   0x00007fff9068ad0b _pthread_wqthread + 404
              12  libsystem_c.dylib                   0x00007fff906751d1 start_wqthread + 13

    Over the last several weeks, I have been unable to send or recieve e-mails from Exchange 2010 in a corprate environment.  I have deleted and re-added the account several times, and sometimes it will fix the issue.  Other times it won't.  I have also tried deleting the account, clearing the cache in ~/Library/Mail/V2/EWS*, and then re-adding the account.  It resolves the issue temporarily, but then returns to not being able to sync.  I've tested it with a number of other users accounts on the same Exchange system, and it's working as expected.  OSX is version 10.8.4 with current patches as of 10/7/2013.
    The connection doctor shows that the connection to EWS is green.  The activity monitor looks like it's updating the folders properly on sync.
    Here is the message I get in the logs in high volume when Console logging is turned on:
    *** Assertion failure in -[EWSConnection sendMessage:forRequest:], /SourceCache/Message/Message-1508/Message/EWS/EWSConnection.m:555
    Received an unexpected error: Error Domain=EWSExchangeWebServicesErrorDomain Code=277 "The operation couldn’t be completed. (EWSExchangeWebServicesErrorDomain error 277.)" UserInfo=0x7fd1c9a97e70 {EWSErrorMessage=The request failed schema validation., NSUnderlyingError=0x7fd1c85106f0 "The operation couldn’t be completed. (SOAPWebServicesErrorDomain error -1000.)"}, response: (null)
              0   CoreMessage                         0x00007fff86a4a517 -[MFAssertionHandler _handleFailureWithPreamble:description:arguments:] + 141
              1   CoreMessage                         0x00007fff86a4a388 -[MFAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 215
              2   Message                             0x00007fff8daa5a8e -[EWSConnection sendMessage:forRequest:] + 762
              3   Message                             0x00007fff8daaeab3 -[EWSGateway sendMessage:forRequest:] + 69
              4   Message                             0x00007fff8dac543a -[EWSRequestOperation executeOperation] + 110
              5   CoreMessage                         0x00007fff86a65b80 -[MonitoredOperation main] + 219
              6   Foundation                          0x00007fff92475926 -[__NSOperationInternal start] + 684
              7   Foundation                          0x00007fff9247d0f1 __block_global_6 + 129
              8   libdispatch.dylib                   0x00007fff87f4af01 _dispatch_call_block_and_release + 15
              9   libdispatch.dylib                   0x00007fff87f470b6 _dispatch_client_callout + 8
              10  libdispatch.dylib                   0x00007fff87f481fa _dispatch_worker_thread2 + 304
              11  libsystem_c.dylib                   0x00007fff9068ad0b _pthread_wqthread + 404
              12  libsystem_c.dylib                   0x00007fff906751d1 start_wqthread + 13

  • Mail hangs when downloading messages from Exchange

    I've had the problem of Mail hanging when downloading from Exchange 2007, though from time to time it all works fine, suggesting all the settings are correct. Sometimes it will all work after a few forced quit- restart cycles, but this isn't reliable. Following advice on this forum I've trimmed the number of messages on the server (to c. 3,500), to no effect, and have deleted the Envelope Index file (which did temporarily alleviate the problem, but issues returned 24 hours later).
    I see several errors are reported to Console which suggest a communication problem with EWS, and in particular an "id" issue, ("id is malformed" and a illegal temporary id is being used online) though I have no idea what id this is, or whether I can influence it in any way. Here are three exemplars:
    1)
    04/01/2010 00:27:10 Mail[14116] * Assertion failure in -[EWSGateway resolvedIdStringForIdString:], /SourceCache/Message/Message-1077/MessageStores.subproj/EWSGateway.m:1548
    Temporary ids should never be used while online. Got temp-e2dbcc09-254b-4f02-9a54-05e314cb0755.
    0 Message 0x00007fff82691119 -[MFAssertionHandler _handleFailureWithPreamble:description:arguments:] + 137
    1 Message 0x00007fff8269107e -[MFAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 220
    2 Message 0x00007fff825dcb68 -[EWSGateway resolvedIdStringForIdString:] + 186
    3 Message 0x00007fff825da29d -[EWSDeleteItemsRequestOperation prepareRequest] + 380
    4 Message 0x00007fff825f1f93 -[EWSRequestOperation executeOperation] + 60
    5 Message 0x00007fff8269f347 -[MonitoredOperation main] + 229
    6 Foundation 0x00007fff8800406d -[__NSOperationInternal start] + 681
    7 Foundation 0x00007fff88003d23 ___startOperations_block_invoke2 + 99
    8 libSystem.B.dylib 0x00007fff87cb0ce8 dispatch_call_block_andrelease + 15
    9 libSystem.B.dylib 0x00007fff87c8f279 dispatch_workerthread2 + 231
    10 libSystem.B.dylib 0x00007fff87c8ebb8 pthreadwqthread + 353
    11 libSystem.B.dylib 0x00007fff87c8ea55 start_wqthread + 13
    3)
    04/01/2010 00:27:11 Mail[14116] * Assertion failure in -[EWSResponseOperation handleResponseMessage:withObject:], /SourceCache/Message/Message-1077/MessageStores.subproj/EWSResponseOperation.m: 420
    Mail did something wrong: Id is malformed. on EWS response <EWSResponseOperation: 0x1168c57a0> (EXECUTING)
    0 Message 0x00007fff82691119 -[MFAssertionHandler _handleFailureWithPreamble:description:arguments:] + 137
    1 Message 0x00007fff8269107e -[MFAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 220
    2 Message 0x00007fff825f2eb2 -[EWSResponseOperation handleResponseMessage:withObject:] + 2295
    3 Message 0x00007fff825f3592 -[EWSResponseOperation handleResponseMessages] + 240
    4 Message 0x00007fff825f30a1 -[EWSResponseOperation executeOperation] + 69
    5 Message 0x00007fff8269f347 -[MonitoredOperation main] + 229
    6 Foundation 0x00007fff8800406d -[__NSOperationInternal start] + 681
    7 Foundation 0x00007fff88003d23 ___startOperations_block_invoke2 + 99
    8 libSystem.B.dylib 0x00007fff87cb0ce8 dispatch_call_block_andrelease + 15
    9 libSystem.B.dylib 0x00007fff87c8f279 dispatch_workerthread2 + 231
    10 libSystem.B.dylib 0x00007fff87c8ebb8 pthreadwqthread + 353
    11 libSystem.B.dylib 0x00007fff87c8ea55 start_wqthread + 13
    3)
    04/01/2010 11:25:57 iCal[9798] deleting pending creates because the server failed to confirm their creation: (
    "<NSManagedObject: 0x115cf0a50> (entity: ContactMapping; id: 0x1185962f0 <x-coredata://54D56B92-4C67-416D-8B08-A79AB7FDAF86/ContactMapping/p361> ; data: <fault>)",
    "<NSManagedObject: 0x115c4e530> (entity: ContactMapping; id: 0x115ce7bc0 <x-coredata://54D56B92-4C67-416D-8B08-A79AB7FDAF86/ContactMapping/p362> ; data: <fault>)"
    Any help very welcome!

    I finally called AppleCare again (after the first rep never got back to me), and we determined that somehow my Mail Rules had become corrupted. One of them (probably thanks to OmniFocus fiddling with my Mail rules) was caught in a loop that would keep repeating until it caused Mail to crash. I had to remove the "MessageRules.plist.backup" and "MessageRules.plist" files from my ~/Library/Mail folder, and then recreate all my rules, but that did the trick.

  • How do I delete items from Exchange and resynch to fix a bug in Apple Mail?

    How do I delete items from Exchange and resynch to fix a bug in Apple Mail?  Mail does not synch with iCal.  Many more Mail problems that may need this fix.

    Is This you want...?
    The best solution is the one you find it by yourself
    Attachments:
    BD_Image.JPG ‏9 KB

  • Retrieving Mails from Exchange or from outlook 2010 using TSQL

    Hi,
    Will you please provide step by step queries to retrieve mails from directly from Exchange Server or else retrieving mails from the outlook 2010 which is connected Exchange Server.
    I have SQL Server 2012 developer edition, outlook 2010 and no idea what version of Company Exchange Server available.
    I google this solution but not successful. Mostly example i found old Exchange or SQL Server 7.0
    Thanks.

    Hi Visakh,
    Will you please assist here :
    EXEC sp_addlinkedserver 'exchange',
    'Exchange OLE DB provider',
    'exoledb.DataSource.1',
    'file:\\.\backofficestorage\localhost\public folders'
    - I don't have "Exchange OLE DB Provider"(exoledb.DataSource.1) in my Linked Server connection, from where can I download so that it can view in SQL Server Linked Servers.
    Will you please let me know the path('file:\\.\backofficestorage\localhost\public folders'), what exactly it is. Is it .pst/.ost file location.
    Thanks.
    Best Regards
    Kashif Chotu

  • Importing mail from Exchange to MS CRM

    Hello all,
    Microsoft Dynamics CRM 2013 receives all mail since it was activated, the emails were in Outlook before CRM be active not appear.
    I do not have the backup of independent Outlook but Microsof Exchange Server.
    How do I import mail from Exchange to CRM?
    Please would like response!
    Many thanks
    Best regards

    1. CRM is not a backup for Exchange. So while I get while there can be business value of old email in CRM, don't treat it like a backup system.
    2. If you use the Dynamics CRM Outlook Plugin, as a user you can just go back to your old email archive and click "Track in CRM".  This will also give you the granularity of what's relevant and what's not for storing in CRM.
    The postings on this site are solely my own and do not represent or constitute Hitachi Solutions' positions, views, strategies or opinions.

  • Migrate from Exchange Server 2011 to Mac OSX Lion Mail Server

    Hi all,
    I'm looking to migrate from Exchange Server 2011 to Mac OSX Lion Mail Server.  I work for a company with roughly 30 employees and they use exchange for mail, contacts and calendars.  We want to take full advantage of OSX Server and to completly get off of exchange.
    What are the best ways to do this?  Are there any tools available to help this process?

    I agree with the points made by Strontium90. If you have any PCs then Apple's mail/contacts/calendar software is a poor choice. Kerio Connect as a mail/contacts/calendar server would not only support Macs but would also do a good job supporting PCs running Outlook.
    If you are going to become a pure Apple site, then you could use just the Apple software and this would be cheaper than using Kerio. For 30 users this might be a suitable solution, however even in a pure Apple environment many people prefer Kerio. For example I find Kerio much more pleasent when dealing with email addresses across multiple domains, email aliases, email group addresses, and so on. Kerio also has built-in email archiving, that is keeping a record of all emails. Kerio also provides a web-browser client for accessing email, calendar and contacts. It is worth noting that as standard Mountain Lion Server no longer includes a webmail feature. While I personally find the Kerio webclient rather ugly it does work.
    There are some annoyances I have with Kerio, firstly they have always charged a 'maintenance' fee for their software. This provided access to software updates, and in the past also provided access to Kerio technical support. Unfortunately they now only let you make two (2) support cases per year for that cost, and you now have to pay extra for any more cases. Also while they added support for EWS (Exchange Web Service) to allow using Outlook 2011 for Mac as a supported email client, they did a poor job of this so that it does not work properly with any other EWS compatible client. This means it will not work in EWS mode with Apple Mail, nor with Outlook for Windows. While there are other ways to connect these other clients, this seems a foolish move and there have been plenty of requests to fix this.
    Apple's Mail client uses EWS to connect to a 'real' MS Exhange server.

  • Mails From Exchange 2013 are received as SPAM

    Hello,
    We have Exchange 2013 configured to send and receive mails internally and externally. Everything is going great except the fact that the mails sent FROM our Exchange 2013 are received as SPAM. For example, I send an email from exchange to my gmail account
    (generally to any EXTERNAL receipt). I receive the mail in the SPAM folder.
    Any ideas Please !!

    Hi,
    Firstly, I’d like to recommend you find out exactly what the problem is and resolve it before bothering to delisting from the blacklist.
    And based on my knowledge, there are the following reasons:
    1. Exchange Server is pumping out SPAM emails because a mailbox password was compromised:
    Please figure out which mailbox user is the culprit by looking over event viewer logs and change the password. Then clear email queue and see if any new spam emails are generated, if the change of password stops the flow of SPAM email, we can remove the domain
    name from the blacklist.
    2. One of our computers are infected with a mass mailing worm virus:
    We can check our firewall log
    For information about removing from blacklist, you can refer to the following similar thread:
    http://social.technet.microsoft.com/Forums/en-US/b3b818a6-641a-4264-87ca-fa4183ffc50c/how-to-remove-my-ip-address-fro-blacklist?forum=exchangesvrsecuremessaginglegacy
    If you have any question, please feel free to let me know.
    Thanks,
    Angela Shi
    TechNet Community Support

  • Redirection of emails garbled-flat from Exchange 2010

    When we forward email from exchange server to an external contact, recipient receives clear text or garbled emails.
    When we create a rule in Outlook 2010 and forward from there it reaches fine.
    What's the different between doing it from server exchange 2010 and outlook 2010?
    thoughts????  thanks

    Hi,
    For the purpose of forwarding emails, there is no big difference. One is forwarding emails from Exchange server side, the other is forwarding emails from outlook side.
    About the format problem, please check the following setting.
    In the console tree, navigate to Recipient Configuration > Mail Contact.
    In the result pane, select the contact you configured for forwarding email.
    In the action pane, click Properties.
    Use the General tab, check the option Use MAPI rich text format.
    Never   If you select this option, messages sent to this recipient are converted to plain text.
    Always   If you select this option, messages sent to this recipient are in the MAPI rich text format (RTF).
    Use Default Settings   If you select this option, messages sent to this recipient are sent in either MAPI RTF or plain text, depending on the settings of the client computer from which the message is sent.
    Meanwhile, please run the following command to check the format setting on the contact.
    Get-MailContact “Alias” | fl UseMapiRichTextFormat, MessageBodyFormat, MessageFormat
    For more information about these three parameters, please refer to this document
    https://technet.microsoft.com/en-us/library/aa995950(v=exchg.150).aspx
    Best Regards.
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact [email protected]
    Lynn-Li
    TechNet Community Support

  • Applescript for Mac Mail Email Addresses

    Hey guys,
    Bit of help with scripting here would be awesome:
    I have been trying to collate all the email addresses located in my Mac Mail accounts. To do this I have used the following in Applescript:
    tell application "Mail"
    set selectionMessage to selection -- just select the first message in the folder
    set thisMessage to item 1 of selectionMessage
    set theseMessages to (every message in (mailbox of thisMessage))
    repeat with eachMessage in theseMessages
    set theFrom to (extract address from sender of eachMessage)
    do shell script "echo " & quoted form of theFrom & return & " >> ~/documents/extracted.txt"
    end repeat
    end tell
    This has worked really well, but I would also like the addresses of people I have sent mails to (sent mail account) and also any addresses that are CC'd in emails.
    I have played around with the script, but my little knowledge of the program meant I got only errors! Any help on obtaining these final email addresses would be much appreciated.
    Best regards,
    Simon

    While the script works, two problems are that there are many duplicate email addresses and the list is not sorted.
    The following addresses these problems (and avoids repeated do shell script calls):
    <pre style="
    font-family: Monaco, 'Courier New', Courier, monospace;
    font-size: 10px;
    font-weight: normal;
    margin: 0px;
    padding: 5px;
    border: 1px solid #000000;
    width: 720px; height: 340px;
    color: #000000;
    background-color: #E6E6EE;
    overflow: auto;"
    title="this text can be pasted into the AppleScript Editor">
    tell application "Mail"
    set selectionMessage to selection -- just select the first message in the folder
    set thisMessage to item 1 of selectionMessage
    set theseMessages to (every message in (mailbox of thisMessage))
    set listOfEmails to {}
    repeat with eachMessage in theseMessages
    try
    set theFrom to (extract address from sender of eachMessage)
    if listOfEmails does not contain theFrom then
    copy theFrom to the end of listOfEmails
    end if
    if (address of to recipient) of eachMessage is not {} then
    repeat with i from 1 to count of to recipient of eachMessage
    set theTo to (address of to recipient i) of eachMessage as string
    if listOfEmails does not contain theTo then
    copy theTo to the end of listOfEmails
    end if
    end repeat
    end if
    if (address of cc recipient) of eachMessage is not {} then
    repeat with i from 1 to count of cc recipient of eachMessage
    set theCC to (address of cc recipient i) of eachMessage as string
    if listOfEmails does not contain theCC then
    copy theCC to the end of listOfEmails
    end if
    end repeat
    end if
    end try
    end repeat
    end tell
    tell application "Finder" to set ptd to path to documents folder as string
    set theFile to ptd & "extracted.txt"
    set theFileID to open for access theFile with write permission
    set SortedListOfEmails to simple_sort(listOfEmails)
    repeat with i from 1 to count of SortedListOfEmails
    write item i of SortedListOfEmails & return to theFileID as «class utf8»
    end repeat
    close access theFileID
    on simple_sort(my_list)
    set the index_list to {}
    set the sorted_list to {}
    repeat (the number of items in my_list) times
    set the low_item to ""
    repeat with i from 1 to (number of items in my_list)
    if i is not in the index_list then
    set this_item to item i of my_list as text
    if the low_item is "" then
    set the low_item to this_item
    set the low_item_index to i
    else if this_item comes before the low_item then
    set the low_item to this_item
    set the low_item_index to i
    end if
    end if
    end repeat
    set the end of sorted_list to the low_item
    set the end of the index_list to the low_item_index
    end repeat
    return the sorted_list
    end simple_sort</pre>

Maybe you are looking for

  • Acrobat 9 - Save PDF as Optimized leading to blurry print jobs

    Hi, I am looking for some insight into PDF's with optimized savings. I had a print job recently where some pages came out blurry and some pages did not. The previous job I did had no issues but the files files took a long time to send. SO this time I

  • How uninstall WSUS server role from Windows Server 2008 R2 with database hosted on remote SQL server?

    Hello,  I'm looking to uninstall the WSUS server role 3.0 from Windows Server 2008 R2 SP1. The thing is the database is hosted on a remote MS SQL server. I want to remove the database as well. I would like help for figuring out what I need to do to c

  • ISA Server Internet Explorer content limit

    Have access to a site that has more than 20,000 characters through a Microsoft TMG2010 Server with SP2. We did not get to see the last 50 characters. But if we turn off the Microsoft Forefront TMG firewall service we could access. We Would like to kn

  • Vbscript delete files based on extension on a drive

    Right now i use this batch script to delete files based on extension on drive D: and all folder and subfolder on it every computer restart. @echo off del /F /S /Q D:\*.jpg             del /F /S /Q D:\*.mp3 del /F /S /Q D:\*.lnk del /F /S /Q D:\*.bmp

  • Change inactive tab dimming, darkness

    This began to be addressed in "Can color be added back to inactive tabs?" but was closed with in a week with no solution, though "130 have this problem," as using the Stylish extension was the only solution but which really is not the solution all al