;;; wl-address.el -- Tiny address management for Wanderlust.
-;; Copyright 1998,1999,2000 Yuuichi Teranishi <teranisi@gohome.org>
-;; Shun-ichi GOTO <gotoh@taiyo.co.jp>
-;; Takeshi Chiba <chiba@d3.bs1.fc.nec.co.jp>
+;; Copyright (C) 1998,1999,2000 Yuuichi Teranishi <teranisi@gohome.org>
+;; Copyright (C) 1998,1999,2000 Shun-ichi GOTO <gotoh@taiyo.co.jp>
+;; Copyright (C) 1998,1999,2000 Takeshi Chiba <chiba@d3.bs1.fc.nec.co.jp>
+
;; Author: Yuuichi Teranishi <teranisi@gohome.org>
-;; Shun-ichi GOTO <gotoh@taiyo.co.jp>
-;; Takeshi Chiba <chiba@d3.bs1.fc.nec.co.jp>
+;; Shun-ichi GOTO <gotoh@taiyo.co.jp>
+;; Takeshi Chiba <chiba@d3.bs1.fc.nec.co.jp>
;; Keywords: mail, net news
;; This file is part of Wanderlust (Yet Another Message Interface on Emacsen).
(setq type (car (car entry))
values (mapcar (function wl-ldap-alias-safe-string)
(cdr (car entry)))
+ values (elmo-flatten values)
entry (cdr entry))
(if (string-match "::?$" type)
(setq type (substring type 0 (match-beginning 0))))
(defun wl-ldap-alias-safe-string (str)
"Modify STR for alias.
Replace space/tab in STR into '_' char.
-Replace '@' in STR into '/' char."
+Replace '@' in STR into list of mailbox and sub-domains."
(while (string-match "[^_a-zA-Z0-9+@%.!\\-/]+" str)
(setq str (concat (substring str 0 (match-beginning 0))
"_"
(substring str (match-end 0)))))
(if (string-match "\\(@\\)[^/@]+" str)
- (setq str (concat (substring str 0 (match-beginning 1))
- "/"
- (substring str (match-end 1)))))
+ (setq str (split-string str "[@\\.]")))
str)
(defun wl-ldap-register-dn-string (hash dn &optional str dn-list)
(if (string-match "[a-z]+=\\(.*\\)" str)
(wl-ldap-alias-safe-string
(wl-match-string 1 str))))
- (split-string dn ",")))))
+ (split-string dn "[ \t]*,[ \t]*")))))
+ (setq dn-list (elmo-flatten dn-list))
;; prepare candidate for uniq str
(if str
(setq str (concat str wl-ldap-alias-sep (car dn-list))
(completing-read "To: " cl)
(read-string "To: "))))
+(defconst wl-address-specials-regexp "[]\"(),.:;<>@[\\]")
+
(defun wl-address-quote-specials (word)
"Make quoted string of WORD if needed."
- (if (assq 'specials (std11-lexical-analyze word))
+ (if (string-match wl-address-specials-regexp word)
(prin1-to-string word)
word))
(forward-line))
ret))))
-(defsubst wl-address-get-petname-1 (string)
+(defun wl-address-get-petname-1 (string)
(let ((address (downcase (wl-address-header-extract-address string))))
(elmo-get-hash-val address wl-address-petname-hash)))