Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Use AppleScript to synchronize Entourage mail Apps
I use Entourage as my eMail client. As I take my PowerBook with me to work almost every day I need to
  • quit Entourage
  • mount my PowerBook's HD on my iMac's desktop
  • kill the Microsoft Database Daemon on the PowerBook
  • copy the Office 2004 Identities folder to the PowerBook, replacing the original
  • unmount the PowerBook's HD
With a little help from the kind folks in the macosxhints forums, I wrote a script that does all that with a single click.

tell application "Microsoft Entourage"
  quit
end tell

do shell script 
  "ssh powerbook killall \\'Microsoft Database Daemon\\'"

do shell script 
  "ssh powerbook exit"

mount volume "afp://powerbook/PowerBookHD" as user name 
  "jazz" with password "password"

-- NOTE: The rm -rf line is shown on two lines. Enter it as *ONE LINE* --
do shell script 
  "rm -rf /Volumes/PowerBookHD/Users/jazz/Documents/'Microsoft User Data'/
   'Office 2004 Identities'"

-- NOTE: The ditto line is shown on three lines. Enter it as --
--       one line (leave a space before /Volumes)            --
with timeout of 180 seconds
    do shell script 
   "ditto -rsrc ~/Documents/'Microsoft User Data'/'Office 2004 Identities' 
    /Volumes/PowerBookHD/Users/jazz/Documents/
    'Microsoft User Data'/'Office 2004 Identities'"
end timeout

tell application "Finder"
  eject "PowerBookHD"
end tell
Now, to send a terminal command to another machine you need to have "Remote Login" enabled on that machine so you can get a remote shell (via ssh). In order to issue commands without having to type a password, you need to authenticate your machine before. I had a snippet of an older hint (or comment) lying around describing the process (I couldn't find the original hint here):
On the machine you are SSHing from (source machine), generate a private key:
ssh-keygen -b 1024 -t dsa   
If you use the default values for all the promps, you should now have ~/.ssh/id_dsa.pub and ~/.ssh/id_dsa files. Copy the contents of the .pub file to your clipboard or somewhere. The contents should be one long line that looks something like:
ssh-dss AAAAB3NzaD1 ... aXdf9L4D== user@machine.local   
Connect to the machine you want to ssh to (destination machine) the old way, using your password. Now, paste the contents of the .pub file from the souce machine to the end of ~/.ssh/authorized_keys file on the destination machine. Make sure it's all one line. That's it. You should now be able to ssh from one machine to the other without entering a password. If you want to ssh to another machine, you don't need to rerun ssh-keygen. Just use the same id_dsa.pub file again.
Of course, I wrote a similar script for the PowerBook that copies the Office folder back to the iMac when I return home.

[robg adds: this older hint also covers creating password-free SSH logins.]
    •    
  • Currently 1.75 / 5
  You rated: 3 / 5 (4 votes cast)
 
[13,749 views]  

Use AppleScript to synchronize Entourage mail | 14 comments | Create New Account
Click here to return to the 'Use AppleScript to synchronize Entourage mail' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Use AppleScript to synchronize Entourage mail
Authored by: bjmorgan on Jul 23, '04 12:03:02PM

Now, when exactly would you need do you do this? I run Entourage on both my work machine and my PowerBook and have never encountered an instance that would create such a problem that required this solution (nor a set up like this).

Granted, I tend to keep all my personal accounts on my PowerBook (with online access to my work accounts) and vice versa on my work machine.

The only reason I can think of for using this is to save your sent e-mails and calendar information (Though I never use the calendar, I swear there's a sync program that makes this chore a lot easier).

When your Database Daemon starts approaching its 2 GB limit (granted I save all my eMails for about a year before I use Entourage Email Archiver to back them up to a FileMaker Database) continually copying it from one machine to the other can be very time consuming.

I'm very interested in learning about how you're using Entourage.



[ Reply to This | # ]
Use AppleScript to synchronize Entourage mail
Authored by: JazzDude on Jul 23, '04 05:42:12PM

The problem on my machines is, once you've launched Entourage (it is in my login items), the Database Daemon starts and keeps ~Documents/Microsoft User Data/Main Identity/Database open, even if you've quit Entourage. When you attempt to replace the file with a newer version you get an error stating the file couldn't be replaced because it is in use. I learned that you can turn off "Office Notifications" but then, I have all events and appointments in my Entourage calendar, some of them having a reminder set. So need the Database Daemon to run. Unless I'm syncing my Database files, that is.

The rest of the script just automates mounting the remote volume, copying the MS User Data folder over and unmounting the volume.



[ Reply to This | # ]
Use AppleScript to synchronize Entourage mail
Authored by: JazzDude on Jul 23, '04 06:19:31PM

Another reason to really copy the whole Microsoft Identity folder (mine is about 36 MB) between the two machines: I aloways have a pretty recent backup of my mail, addresses and events.



[ Reply to This | # ]
Use AppleScript to synchronize Entourage mail
Authored by: henryhbk on Jul 23, '04 06:21:16PM

I do the same thing (the pain of using a pop client). This also does give me a great backup (I do this with iTunes and iPhoto as well). I use the Synchronize Pro app, which doesn't seem to require this whole shutdown thing...

---
Henry Feldman, MD
Medical Informatics
NYU School of Medicine



[ Reply to This | # ]
Use AppleScript to synchronize Entourage mail
Authored by: JazzDude on Jul 23, '04 06:26:00PM

The Database Daemon is there when you use Synchronize! Pro as long as you don't explicitly turn Office notifications OFF.



[ Reply to This | # ]
Can I send a copy of all Sent Mail to myself?
Authored by: Brian Purnell on Jul 23, '04 01:32:49PM

Hi, I do something similar. I use firewire Target Mode to mount my PowerBook and then copy over the files. The problem is if you've already started Entourage it doesn't seem to see the additional files you've copied over. i don't know why this is, but I'm sure it has something to do with their Database Daemon.

I do this to keep my sent mail I did at work, it is important to me, plus my work connection is fast whereas home is at best 16k.

I would really like to know if there is something out there that could sync my Entourage databases. I would think with all the people having a laptop that MS would build some kind of sync into their products.

Even better, can anyone figure out how to have Entourage automatically send a BCC copy of every message i send to myself as well? That way all I would have to do is create a rule to file messages coming in from myself to a folder. i would love this, but I can't figure out any way of doing this automatically.

Anyone have any ideas?



[ Reply to This | # ]
Can I send a copy of all Sent Mail to myself?
Authored by: JazzDude on Jul 23, '04 06:10:01PM

I use firewire Target Mode to mount my PowerBook and then copy over the files.

You can use Target Mode but then one of your machines has to be OFF. Mine are never off.

The problem is if you've already started Entourage it doesn't seem to see the additional files you've copied over. i don't know why this is, but I'm sure it has something to do with their Database Daemon.

The reason why Entourage doesn't seem to "see the additional files" is because all files (=mails) are in one big Database file and that can't be replaced while the Database Daemon is running.



[ Reply to This | # ]
Can I send a copy of all Sent Mail to myself?
Authored by: Fofer on Jul 24, '04 12:22:35PM

To BCC yourself (or just send yourself copies of all mail you send at work,) set up an OUTGOING rule. Set it so that all mail sent from your account is "redirected" to whatever account you like. I set up a mailbox specifically for this sort of mail. And when I get home, Entourage checks that mailbox, and a rule files any mail from there into my "Sent Items" folder.

It's the next best thing to IMAP! :)



[ Reply to This | # ]
Thanks for this tip
Authored by: Brian Purnell on Jul 24, '04 07:41:07PM

Thanks for this tip, I've looked at rules a number of times, I never noticed the "Outgoing" tab. I wish I'd figured this out long ago, it really solves my whole problem.



[ Reply to This | # ]
Use AppleScript to synchronize Entourage mail
Authored by: sfgecko on Jul 23, '04 02:56:06PM

sounds like you're doing a lot of unnecessary work to replicate your email in two diff machines. one solution is to just use an IMAP email account (instead of POP), where your email is always stored on the server and can be accessed via multiple email clients. also, you can synch w/ an IMAP account so that an offline copy of the email is on your local machine so you can read it while not connected to the internet (just like POP).

this is what i use:
http://www.myfastmail.com

i've set up apple mail, entourage, and thunderbird w/ IMAP and they all work fine. in addition, you can access your email via your browser in case you're on a computer that doesn't have an email client set up to access your account.



[ Reply to This | # ]
Use AppleScript to synchronize Entourage mail
Authored by: JazzDude on Jul 23, '04 06:02:56PM

Yes, I've thought about IMAP but that's only for mails, isn't it? I need the calendar synchronized as well.



[ Reply to This | # ]
Use AppleScript to synchronize Entourage mail
Authored by: zane on Jul 25, '04 11:21:06PM

I also thought of IMAP when I first read this hint (or clicking the "leave copy of message on server" option in a POP account), but yeh, that won't sync Contacts, Calendars, Notes, To Do etc.



[ Reply to This | # ]
Use AppleScript to synchronize Entourage mail
Authored by: designr on Jul 23, '04 04:31:17PM

Why not just mount your PowerBook's HD on your iMac's desktop and make an alias of your Powerbook/~/Documents/Microsoft User Data folder in your iMac/~/Documents/ folder?



[ Reply to This | # ]
Thanks for the Outgoing Rule tip
Authored by: Brian Purnell on Jul 24, '04 07:39:49PM

Thanks for this tip, I've looked at rules a number of times, I never noticed the "Outgoing" tab. I wish I'd figured this out long ago, it really solves my whole problem.



[ Reply to This | # ]