• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Import Mail.app messages to Eudora
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Import Mail.app messages to Eudora


  • Subject: Import Mail.app messages to Eudora
  • From: John Delacour <email@hidden>
  • Date: Thu, 7 Nov 2002 01:30:29 +0000
  • Mac-eudora-version: 5.3a8

I posted some trial versions of this script on another list, but I think this latest version is the ticket.

You can either run this script from an editor or put it in your scripts folder and run it from the menu or a toolbar button.

The script creates a dropfile and a personality to enable you to import the messages just as if you were checking mail on the server. Attachments are included. The Deleted Messages mailbox is skipped. The script should deal with any depth of sub-folders, importing messages from all mailboxes.

An extra header is added to the messages to enable you to filter them to a mailbox other than "In". Full instructions are sent to you when you run the script.

The process is amazingly fast. Please let me know of any problems.

-- JD


(* Script: Import from Mail.app *)
set dropfile_ to "" & (path to startup disk) & "private:tmp:dropfile.mbx"
set perlscript_ to do shell script "perl -e '
use File::Find ;
$dropfile = qq~/tmp/dropfile.mbx~ ;
chomp ($date = `date`) ;
$date =~ s~\\s+~ ~g ;
$date = qq~$date\\015\\X-Imported-From-Mail.app: true~ ;
open DROPFILE, qq~>$dropfile~ or die $! ;
$dir = qq~$ENV{HOME}/Library/Mail~;
chdir $dir;
find (sub {/^mbox$/ and push @ls, $File::Find::name}, qq~$dir~) ;
for (@ls) {
next if /Deleted Messages/ ;
open MAILBOX, $_ ;
for (<MAILBOX>) {
chomp ;
s~(^From )([^\\s]+)(.+)~$1???@??? $date~g and $count++;
print DROPFILE qq~$_\\015~ ;
}
s~^.+Mail/~~g;
s~\\.mbox/mbox$~~g ;
$list .= qq~<div>$_</div>\\n~ ;
}
print qq~$list|*|$count~
'"
set AppleScript's text item delimiters to {"|*|"}
set {boxes_, count_} to perlscript_'s text items
set AppleScript's text item delimiters to {""}

tell application "Eudora"
set persname_ to "Import_from_Mail"
if not (exists personality persname_) then
set p to make personality
set name of p to persname_
end if
tell personality persname_
set its setting 3 to "!" & dropfile_
set its setting 5 to "Script@127.0.0.1"
set its setting 4 to "[not applicable]"
set its setting 77 to "Script"
set its setting 83 to "y"
end tell
set m to make message at end of mailbox 1 with data "From: Script
To: " & setting 77 & "
Subject: Messages from Mail.app
Content-Type: text/html

<html><font size='+1' face='Geneva' color='navy'>
<h2><font color='#337733'><hr height='3'>
You have " & count_ & " messages from Mail.app ready for collection.<p>
</font></h2><hr>
If you want to have these messages in a special place,
<ol>
<li>Create a mailbox for
imported messages, eg. &#8220;Imported&#8221;</li>
<li>Set up a filter at the <b>top</b> of your filter list
<ul>
<li>Type &#8220;X-Imported-From-Mail.app&#8221;
in the top box</li>
<li>Type &#8220;true&#8221 in the second box</li>
<li>Set action 1 to
&#8220;open&#8221; and check &#8220;mailbox&#8221;</li>
<li>Set action 2 to
&#8220;Transfer To&#8221; (&#8220;Imported&#8221;)</li>
<li>Set action 3 to
&#8220;Make Personality&#8221;
(&#8220;you choose&#8221;)</li>
</ul>
</ol><p>
To get the messages from... <hr><font size='0'>
" & boxes_ & "</font><hr>...type <b>cmd-opt-m</b>
and check mail for personality &#8220;Import_from_Mail&#8221;.
<br>If you are asked for a password, type anything.
<p>
Type <b>cmd-d</b> to delete this message.
</font><html>"
set personality of m to personality persname_
open m
activate
end tell

-- END
_______________________________________________
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.

  • Prev by Date: minimized window
  • Next by Date: Re: Real Simple Question ("null" isn't TID default)
  • Previous by thread: minimized window
  • Next by thread: Re: Real Simple Question ("null" isn't TID default)
  • Index(es):
    • Date
    • Thread