annotate lisp/w3/url-mail.el @ 97:498bf5da1c90

Added tag r20-0final for changeset dbb370e3c29e
author cvs
date Mon, 13 Aug 2007 09:12:43 +0200
parents 0293115a14e9
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
14
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
1 ;;; url-mail.el --- Mail Uniform Resource Locator retrieval code
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
2 ;; Author: wmperry
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
3 ;; Created: 1997/01/20 19:52:07
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
4 ;; Version: 1.7
14
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
5 ;; Keywords: comm, data, processes
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
6
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
7 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
8 ;;; Copyright (c) 1993-1996 by William M. Perry (wmperry@cs.indiana.edu)
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
9 ;;; Copyright (c) 1996, 1997 Free Software Foundation, Inc.
14
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
10 ;;;
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
11 ;;; This file is not part of GNU Emacs, but the same permissions apply.
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
12 ;;;
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
13 ;;; GNU Emacs is free software; you can redistribute it and/or modify
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
14 ;;; it under the terms of the GNU General Public License as published by
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
15 ;;; the Free Software Foundation; either version 2, or (at your option)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
16 ;;; any later version.
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
17 ;;;
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
18 ;;; GNU Emacs is distributed in the hope that it will be useful,
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
19 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
20 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
21 ;;; GNU General Public License for more details.
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
22 ;;;
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
23 ;;; You should have received a copy of the GNU General Public License
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
24 ;;; along with GNU Emacs; see the file COPYING. If not, write to the
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
25 ;;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
26 ;;; Boston, MA 02111-1307, USA.
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
27 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
28
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
29 (require 'url-vars)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
30 (require 'url-parse)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
31
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
32 (defmacro url-mailserver-skip-chunk ()
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
33 (` (while (and (not (looking-at "/"))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
34 (not (eobp)))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
35 (forward-sexp 1))))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
36
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
37 (defun url-mail (&rest args)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
38 (interactive "P")
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
39 (if (fboundp 'message-mail)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
40 (apply 'message-mail args)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
41 (or (apply 'mail args)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
42 (error "Mail aborted"))))
14
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
43
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
44 (defun url-mail-goto-field (field)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
45 (if (not field)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
46 (goto-char (point-max))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
47 (let ((dest nil)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
48 (lim nil)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
49 (case-fold-search t))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
50 (save-excursion
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
51 (goto-char (point-min))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
52 (if (re-search-forward (regexp-quote mail-header-separator) nil t)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
53 (setq lim (match-beginning 0)))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
54 (goto-char (point-min))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
55 (if (re-search-forward (concat "^" (regexp-quote field) ":") lim t)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
56 (setq dest (match-beginning 0))))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
57 (if dest
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
58 (progn
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
59 (goto-char dest)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
60 (end-of-line))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
61 (goto-char lim)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
62 (insert (capitalize field) ": ")
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
63 (save-excursion
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
64 (insert "\n"))))))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
65
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
66 (defun url-mailto (url)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
67 ;; Send mail to someone
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
68 (if (not (string-match "mailto:/*\\(.*\\)" url))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
69 (error "Malformed mailto link: %s" url))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
70 (setq url (substring url (match-beginning 1) nil))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
71 (if (get-buffer url-working-buffer)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
72 (kill-buffer url-working-buffer))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
73 (let (to args source-url subject func)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
74 (if (string-match (regexp-quote "?") url)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
75 (setq to (url-unhex-string (substring url 0 (match-beginning 0)))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
76 args (url-parse-query-string
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
77 (substring url (match-end 0) nil) t))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
78 (setq to (url-unhex-string url)))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
79 (setq source-url (url-view-url t))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
80 (if (and url-request-data (not (assoc "subject" args)))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
81 (setq args (cons (list "subject"
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
82 (concat "Automatic submission from "
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
83 url-package-name "/"
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
84 url-package-version)) args)))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
85 (if (and source-url (not (assoc "x-url-from" args)))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
86 (setq args (cons (list "x-url-from" source-url) args)))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
87 (setq args (cons (list "to" to) args)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
88 subject (cdr-safe (assoc "subject" args)))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
89 (if (fboundp url-mail-command) (funcall url-mail-command) (mail))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
90 (while args
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
91 (url-mail-goto-field (caar args))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
92 (setq func (intern-soft (concat "mail-" (caar args))))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
93 (insert (mapconcat 'identity (cdar args) ", "))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
94 (setq args (cdr args)))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
95 (url-mail-goto-field "X-Mailer")
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
96 (insert url-package-name "/" url-package-version)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
97 (if (not url-request-data)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
98 (if subject
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
99 (url-mail-goto-field nil)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
100 (url-mail-goto-field "subject"))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
101 (if url-request-extra-headers
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
102 (mapconcat
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
103 (function
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
104 (lambda (x)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
105 (url-mail-goto-field (car x))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
106 (insert (cdr x))))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
107 url-request-extra-headers ""))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
108 (goto-char (point-max))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
109 (insert url-request-data)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
110 (mail-send-and-exit nil))))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
111
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
112 (defun url-mailserver (url)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
113 ;; Send mail to someone, much cooler/functional than mailto
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
114 (if (get-buffer url-working-buffer)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
115 (kill-buffer url-working-buffer))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
116 (set-buffer (get-buffer-create " *mailserver*"))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
117 (erase-buffer)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
118 (insert url)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
119 (goto-char (point-min))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
120 (set-syntax-table url-mailserver-syntax-table)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
121 (skip-chars-forward "^:") ; Get past mailserver
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
122 (skip-chars-forward ":") ; Get past :
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
123 ;; Handle some ugly malformed URLs, but bitch about it.
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
124 (if (looking-at "/")
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
125 (progn
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
126 (url-warn 'url "Invalid mailserver URL... attempting to cope.")
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
127 (skip-chars-forward "/")))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
128
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
129 (let ((save-pos (point))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
130 (url (url-view-url t))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
131 (rfc822-addr nil)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
132 (subject nil)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
133 (body nil))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
134 (url-mailserver-skip-chunk)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
135 (setq rfc822-addr (buffer-substring save-pos (point)))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
136 (forward-char 1)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
137 (setq save-pos (point))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
138 (url-mailserver-skip-chunk)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
139 (setq subject (buffer-substring save-pos (point)))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
140 (if (not (eobp))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
141 (progn ; There is some text to use
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
142 (forward-char 1) ; as the body of the message
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
143 (setq body (buffer-substring (point) (point-max)))))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
144 (if (fboundp url-mail-command) (funcall url-mail-command) (mail))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
145 (url-mail-goto-field "to")
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
146 (insert rfc822-addr)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
147 (if (and url (not (string= url "")))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
148 (progn
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
149 (url-mail-goto-field "X-URL-From")
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
150 (insert url)))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
151 (url-mail-goto-field "X-Mailer")
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
152 (insert url-package-name "/" url-package-version)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
153 (url-mail-goto-field "subject")
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
154 ;; Massage the subject from URLEncoded garbage
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
155 ;; Note that we do not allow any newlines in the subject,
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
156 ;; as recommended by the Internet Draft on the mailserver
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
157 ;; URL - this means the document author cannot spoof additional
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
158 ;; header lines, which is a 'Good Thing'
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
159 (if subject
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
160 (progn
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
161 (setq subject (url-unhex-string subject))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
162 (let ((x (1- (length subject)))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
163 (y 0))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
164 (while (<= y x)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
165 (if (memq (aref subject y) '(?\r ?\n))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
166 (aset subject y ? ))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
167 (setq y (1+ y))))))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
168 (insert subject)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
169 (if url-request-extra-headers
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
170 (progn
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
171 (goto-char (point-min))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
172 (insert
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
173 (mapconcat
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
174 (function
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
175 (lambda (x)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
176 (url-mail-goto-field (car x))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
177 (insert (cdr x))))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
178 url-request-extra-headers ""))))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
179 (goto-char (point-max))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
180 ;; Massage the body from URLEncoded garbage
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
181 (if body
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
182 (let ((x (1- (length body)))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
183 (y 0))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
184 (while (<= y x)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
185 (if (= (aref body y) ?/)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
186 (aset body y ?\n))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
187 (setq y (1+ y)))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
188 (setq body (url-unhex-string body))))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
189 (and body (insert body))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
190 (and url-request-data (insert url-request-data))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
191 (if (and (or body url-request-data)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
192 (funcall url-confirmation-func
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
193 (concat "Send message to " rfc822-addr "? ")))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
194 (mail-send-and-exit nil))))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
195
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
196 (provide 'url-mail)