Path: utzoo!utgpu!water!watmath!uunet!tut.cis.ohio-state.edu!THINK.COM!mjab
From: mjab@THINK.COM
Newsgroups: gnu.emacs.bug
Subject: bug in define-mail-alias
Message-ID: <8809291815.AA10511@medusa.think.com>
Date: 29 Sep 88 18:15:19 GMT
References: <8809232111.AA00920@sugar-bombs.ai.mit.edu>
Sender: daemon@tut.cis.ohio-state.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 97


   Date: Wed, 21 Sep 88 18:34:20 EDT
   From: rms@wheaties.ai.mit.edu (Richard Stallman)

   The evidence available to me seems to say that spaces do separate
   recipient names in mail aliases.  So I won't change Emacs unless I get
   clear evidence that they are not *supposed* to do so.  Sorry.

   ....

   Date: Fri, 23 Sep 88 17:11:02 EDT
   From: rms@wheaties.ai.mit.edu (Richard Stallman)

       Please take a look at rfc822.

   It is not clear to me that rfc822 is the spec for the alias command.

Here is a little more information on why I think the current
behavior of emacs when building aliases is in error.  While
rfc822 is not directly a spec for the alias command, it is a spec
for internet mail addresses.  The purpose of aliases is to allow
me to use a short mnemonic name for one or more internet mail
aliases. It follows that if I say 

alias friends valid-list-of-mail-addresses

I should be able to type 

TO: friends

or

CC: friends

to have mail sent to the list of valid addresses.  Since valid
internet addresses often contain whitespace (as specified in
rfc822), the emacs function define-mail-alias should respect the
whitespace in a valid addresse and not insert commas which turn a
single valid address into several invalid ones.

The following is the relevant excerpt from rfc822.  Note that
address -> mailbox -> phrase route-addr -> phrase <[route] addr-spec>
It is the "phrase" which is being seen by emacs as addresses when
it should not be.

     Standard for ARPA Internet Text Messages


     6.  ADDRESS SPECIFICATION

     6.1.  SYNTAX

     address     =  mailbox                      ; one addressee
                 /  group                        ; named list

     group       =  phrase ":" [#mailbox] ";"

     mailbox     =  addr-spec                    ; simple address
                 /  phrase route-addr            ; name & addr-spec

     route-addr  =  "<" [route] addr-spec ">"

     route       =  1#("@" domain) ":"           ; path-relative

     addr-spec   =  local-part "@" domain        ; global address

     local-part  =  word *("." word)             ; uninterpreted
                                                 ; case-preserved

     domain      =  sub-domain *("." sub-domain)

     sub-domain  =  domain-ref / domain-literal

     domain-ref  =  atom                         ; symbolic reference


Here, again, is my proposed definition for this function:

(defun define-mail-alias (name definition)
  "Define NAME as a mail-alias that translates to DEFINITION."
  (interactive "sDefine mail alias: \nsDefine %s as mail alias for: ")
  ;; Read the defaults first, if we have not done so.
  (if (eq mail-aliases t)
      (progn
	(setq mail-aliases nil)
	(if (file-exists-p "~/.mailrc")
	    (build-mail-aliases))))
  ;removed code wich mistakenly inserted commas -mjab Wed Sep 14 1988
      (setq mail-aliases (cons (cons name definition) mail-aliases)))


=============================================
Michael J. A. Berrry

Internet: mjab@think.com
uucp:     {harvard, ihnp4, seismo}!think!mjab
=============================================