Jump to content

Python Script email event handler


Recommended Posts

Quote:

So if there was any extra adjustments you can remember you had to do, I'd like to know if you can recall what they were... maybe they're what I need to do?

 


Well, I can remember exactly what I did because I keep pretty good records (the python script is fine and needed no changes, but modification was needed for the event handler, and I don't know if my mods for 10.4.x Server work on 10.3.9 Server - the mail architecture is so very different). There's also a recent unrelated bug fix posted in the Dantz forums for the event handler if you use email addresses of the form "Some Name <name@your.server.com>" rather than just "name@your.server.com", which works fine. The other stuff I had to do are outside Retrospect and involved some 10.4 server specific stuff that wouldn't apply to 10.3.9. So I really can't help you on the 10.3.9 stuff. However, if you want to discuss further, send me a private message and we can discuss off list. Our server is burdened enough with about 10,000 SPAM emails that it battles off each day, so I'm not eager to post my public email address. In case you care about the 10.4 mail stuff, it's fairly standard and is documented on AFP548.com: (1) my post to fix the bug that causes 10.4 server to stop syslog and mail logging each morning when the logs are rolled - see Fix for 10.4 syslogd stopping and (2) mail backup scripts to stop/checkpoint/restart the mail system so that Retrospect can back up the checkpointed files - see the article at AFP548 article on 10.4 mail backup. Also, you will have to craft selectors to exclude all the changing mail stuff during the server drive backup (the mail off backup or duplicate or whatever you use should capture a consistent mail state, but of course that will be very different for 10.3.9 than 10.4.x because of the radically different mail architecture).

I hope this helps, but it's only good for 10.4.x Server, not 10.3.9. Interesting that there is another Russ W (not me) posting in the Dantz forums under another username about issues with Retrospect and 10.3.9. I've never run 10.3.x, can't help there - we had to replace everything with 10.4 after a fire at our office. Yes, the offsite backups saved us. Regards, Russ

Link to comment
Share on other sites

  • 6 months later...

it would be nice if dantz/emc would fix the problem in the Apple Mail Event Handler so that we don't have to resort to python scripts that a lot of people have trouble with.

 

If you want to fix your copy of the Retrospect Event Handler so that Apple Mail under 10.4 works again do this:

find the line that reads:

set myAddressClass to myAddressClass & {name:myAddress}

and change it to:

set myAddressClass to myAddressClass & {address:myAddress}

 

Not saying that Apple Mail is the best, I don't even use it personally. But it is much easier for lay people to understand an AppleScript / Apple Mail action than a python script.

Link to comment
Share on other sites

Quote:

Not saying that Apple Mail is the best, I don't even use it personally. But it is much easier for lay people to understand an AppleScript / Apple Mail action than a python script.

 


Thanks for the bug fix, but I don't understand the difficulty with using the python version. As I am sure you must be aware (from the documentation), there are two components to the python version: (1) the python script, which doesn't need understanding or modification; and (2) the AppleScript Retrospect Event Handler (that uses the python script).

 

There is exactly the same degree of modification of the Event Handler used with the python version as for the Event Handler version used with Mail, etc. The advantage of using the python version is that it (a) works and (B) isolates you from changes to the mail client (Mail, etc.) as Apple updates its software. Python's language is well documented and doesn't have these problems. And, as an aside, python is pretty easy to understand, too; doesn't give me any problems. All of the modifications / fixes discussed in this forum (including yours) are to the AppleScript component only.

 

Thanks for the bug fix.

 

Russ

Link to comment
Share on other sites

Quote:

it is much easier for lay people to understand an AppleScript / Apple Mail action than a python script.

 


 

while i agree that it would be better for the email facility to be built in to Retrospect, this statement is misleading at best. at worst it is FUD.

 

there is no need for a lay person or anyone else to 'change' the Python script. as with the Apple Mail script, the user edits the AppleScript that goes with it. there is practially no difference between the two.

 

the best part about the Python script is that it does not depend on a particular program. while EMC should change the script to reflect the new _changed_ Apple Mail Program (why Apple changed that is beyond me) and still support the old, i get tired of hearing people decry Mac users as 'not capable' of understanding things. there are plenty of Macintosh users who can edit either AppleScript and not really break a sweat. get used to it.

Link to comment
Share on other sites

  • 11 months later...

I'm getting a weird error where my event handler script won't stay open.

If I trash it and replace it with another fresh copy the fresh copy will open and stay open when launched from the Finder.

As soon as I open Retrospect the event handler will attempt to open twice and close immediately.

Once I've done that the fresh copy is tainted and won't stay open even if launched from the Finder.

This happens using either the python script or the mail.app script.

I've checked and changed both permissions and owner on the scripts to root:admin and 777'd them to no avail.

Weird huh?

 

Any ideas?

 

C.

Link to comment
Share on other sites

Quote:

I'm getting a weird error where my event handler script won't stay open.

If I trash it and replace it with another fresh copy the fresh copy ...

Any ideas?

 


Unclear what you mean by "fresh copy". You have to edit the parameters at the beginning, then, when you save the edited file in Apple Script Editor, you have to "save as application", "stay open", "never show startup screen", and then delete the ".app" extension so that it is named "Retrospect Event Handler". And put the "Retrospect Event Handler" file in /Library/Preferences/Retrospect.

 

Did you do all that?

 

Russ

Link to comment
Share on other sites

  • 3 weeks later...

rhwalker: By a "fresh copy" I meant the default script that is installed when Retrospect is installed.

I can open the default script in the Finder (and make changes as necessary) as many times as I like and it will stay open but as soon as it's launched by Retrospect (because I put the file in /Library/Preferences/Retrospect) it won't stay open and continually crashes. Then when I try to open it in Finder again it doesn't open either. Retrospect seems to be damaging it somehow.

 

CallMeDave: I'll try that next and see what happens. Thanks.

Link to comment
Share on other sites

Quote:

Retrospect seems to be damaging it somehow.

 


Retrospect doesn't write to the Retrospect Event Handler; it just launches it.

 

This is just too odd to understand. I believe you, but I am having a hard time imagining something that would cause this. Dave's suggestion for troubleshooting with a null AppleScript is a very good one.

 

I am also a bit confused by your statement:

 

Quote:

I can open the default script in the Finder (and make changes as necessary) as many times as I like and it will stay open ...

 


Do you mean:

 

(a) you can launch the default script in the Finder ... and it will stay open?

(B) you can open the default script in Apple's Script Editor and make changes as necessary?

 

Unclear how you are making changes to the AppleScript in the Finder.

 

After you have saved the script as an app and have named it correctly, without the .app extension, I assume you are quitting Script Editor, and that you don't still have the script open for editing. Correct?

 

Russ

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...