[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

GC, ZMail

   Date: Tue, 6 Sep 88 10:58 EDT
   From: Think.COM!barmar@uunet.uu.net (Barry Margolin)
   Resent-Date: Tue 6 Sep 88 20:46:58-PDT
   Resent-From: TYSON@warbucks.ai.sri.com (Mabry Tyson)
   Resent-To: slug@warbucks.ai.sri.com

       Date: Fri, 2 Sep 88 12:38 EDT
       From: mkr@philabs.philips.com

	       Also, If anyone knows how to make aliases for ZMail, i.e.
       I want to say "To: Rob" instead of "To: mach1!mach2!mach3!rob@sys1",
       I would be pretty happy.  Is there a way to save those notes you put
       in the Calender?? Or when you change mailer windows or reboot will they
       always be gone??

   Calendar reminders are usually stored as messages in a mail file.  When
   you save your mail files they will be saved out with them, just like any
   other messages.


I've written a personal alias function that does just that.  This version
works in 7.2.

;;; -*- mode: lisp; package: ZWEI; base: 10.; patch-file: yes -*-
;;; (c) Copyright 1986, Dan Aronson, Thinking Machines Corporation, Inc.
;;; File creation date: 3/04/86 13:28:02

;;; *********************** CHANGE LOG *******************
;;; 5/26/88 19:05:06 Salem:  Created.
;;; 5/26/88 19:05:11 Salem:  Changed personal-alias-hook.  Patched so it
;;;  wouldn't expand if the host was already specified
;;; 5/26/88 20:12:56 Salem:  Patched for 7.2
#| *************** END OF CHANGE LOG ***************|#

;;; Dan 12/8/87 Finally fixed for release 7

;;; This expands mail aliases according to the list zwei:*personal-alias-name 
;;; if the address is string-equal to a first thing in an address on that
;;; list, that gets replaced with the last thing on that list.

;;; Example
;;;;  (login-forms
;;;;    (push '("RONNIE" . "REAGAN%NANCY-VAX%WHITE-HOUSE@US.GOV.ARPA") zwei:*personal-alias-name*))

;;; Made some minor changes to make things defwrapper so they didn't clobber existing things.
;;;  JBS 3/5/86

(defvar *personal-alias-name* nil)
(defun personal-alias-hook (recipients te &aux thing translated-name)
  (dolist (recipient recipients)
    (when (setq translated-name (maybe-translate-alias recipient))
      ;; 7.2 bug fix kludge -- give it an array leader
      (setq translated-name (lisp:make-array (string-length translated-name)
					     :element-type 'lisp:string-char
					     :initial-contents translated-name
					     :leader-length 10))
      (setq thing
	    (car (parse-driver (rdtbl-lexer rfc733 translated-name
					    0 translated-name (cl:length translated-name))
      (unless (and (member :name thing) (member :host thing))
	(error "Unable to expand personal mail alias.  Please consult maintainer at TMC."))
      (setf (cadr (member :name recipient)) (cadr (member :name thing)) )
      (setf (cadr (member :host recipient)) (cadr (member :host thing)) )

(setq *message-transmit-hook* 'personal-alias-hook)

(defun maybe-translate-alias (recipient)
  (let* ((interval (or (cl:getf recipient :interval) (cl:getf recipient :original-interval)))
	 (name (if interval
		   (apply 'string-interval interval)
		   (cl:getf recipient :name)))
    (dolist (p *personal-alias-name*)
      (when (or (and (listp (car p)) (member name (car p)))
		(And (stringp (car p)) (string-equal name (car p))))
	(setq name (cdr p))
	(return name)))))