Make event emails sent from 10.6 iCal Server come from actual user

Mar 29, '11 07:30:00AM

Contributed by: mmblz

In Server Admin, the iCal settings allow you to specify a single email from which event invitations will come. For a personal calendar though, you really want the email to come from your own email.

The script which sends invitations is found at:

/usr/share/caldavd/lib/python/twistedcaldav/mail.py

It appears that it tries to find the appropriate email address, but I could not figure out how to make a value ever be present where it was looking.

So, I modified the script as shown below.

Change:

 if organizer.startswith("mailto:"):
  orgEmail = fromAddr = organizer[7:]
 else:
  fromAddr = serverAddress
  orgEmail = None
 cn = calendar.getOrganizerProperty().params().get('CN', (None,))[0]
To:
 oemail = calendar.getOrganizerProperty().params().get('EMAIL', (None,))[0]
 if organizer.startswith("mailto:"):
   orgEmail = fromAddr = organizer[7:]
 elif oemail is not None:
   orgEmail = fromAddr = oemail
 else:
   fromAddr = serverAddress
   orgEmail = None
 cn = calendar.getOrganizerProperty().params().get('CN', (None,))[0]
After making this change, stop and restart the iCal service.

Maybe there is a way to do this without editing a script, but I could not find one.

[crarko adds: I haven't tested this one, but I do have a client with an iCal server and I may try this out. Obviously make sure you have a backup of the original script before modifying it.]

Comments (5)


Mac OS X Hints
http://hints.macworld.com/article.php?story=2011032813422190