Mercurial > emacs
comparison lisp/mail/smtpmail.el @ 92129:1f3cc233058d
Remove leading `*' from defcustom doc-strings.
(smtpmail-code-conv-from): Doc fix. Fix custom type.
(smtpmail-queue-index-file): Make it a defcustom.
(smtpmail-queue-index): Delete.
(smtpmail-send-it, smtpmail-send-queued-mail):
Use smtpmail-queue-index-file and smtpmail-queue-dir rather than
smtpmail-queue-index.
author | Glenn Morris <rgm@gnu.org> |
---|---|
date | Sat, 23 Feb 2008 19:33:50 +0000 |
parents | ee383bc4d019 |
children | 1e3a407766b9 |
comparison
equal
deleted
inserted
replaced
92128:84357f6e06d1 | 92129:1f3cc233058d |
---|---|
85 "SMTP protocol for sending mail." | 85 "SMTP protocol for sending mail." |
86 :group 'mail) | 86 :group 'mail) |
87 | 87 |
88 | 88 |
89 (defcustom smtpmail-default-smtp-server nil | 89 (defcustom smtpmail-default-smtp-server nil |
90 "*Specify default SMTP server. | 90 "Specify default SMTP server. |
91 This only has effect if you specify it before loading the smtpmail library." | 91 This only has effect if you specify it before loading the smtpmail library." |
92 :type '(choice (const nil) string) | 92 :type '(choice (const nil) string) |
93 :group 'smtpmail) | 93 :group 'smtpmail) |
94 | 94 |
95 (defcustom smtpmail-smtp-server | 95 (defcustom smtpmail-smtp-server |
96 (or (getenv "SMTPSERVER") smtpmail-default-smtp-server) | 96 (or (getenv "SMTPSERVER") smtpmail-default-smtp-server) |
97 "*The name of the host running SMTP server." | 97 "The name of the host running SMTP server." |
98 :type '(choice (const nil) string) | 98 :type '(choice (const nil) string) |
99 :group 'smtpmail) | 99 :group 'smtpmail) |
100 | 100 |
101 (defcustom smtpmail-smtp-service 25 | 101 (defcustom smtpmail-smtp-service 25 |
102 "*SMTP service port number. | 102 "SMTP service port number. |
103 The default value would be \"smtp\" or 25." | 103 The default value would be \"smtp\" or 25." |
104 :type '(choice (integer :tag "Port") (string :tag "Service")) | 104 :type '(choice (integer :tag "Port") (string :tag "Service")) |
105 :group 'smtpmail) | 105 :group 'smtpmail) |
106 | 106 |
107 (defcustom smtpmail-local-domain nil | 107 (defcustom smtpmail-local-domain nil |
108 "*Local domain name without a host name. | 108 "Local domain name without a host name. |
109 If the function `system-name' returns the full internet address, | 109 If the function `system-name' returns the full internet address, |
110 don't define this value." | 110 don't define this value." |
111 :type '(choice (const nil) string) | 111 :type '(choice (const nil) string) |
112 :group 'smtpmail) | 112 :group 'smtpmail) |
113 | 113 |
114 (defcustom smtpmail-sendto-domain nil | 114 (defcustom smtpmail-sendto-domain nil |
115 "*Local domain name without a host name. | 115 "Local domain name without a host name. |
116 This is appended (with an @-sign) to any specified recipients which do | 116 This is appended (with an @-sign) to any specified recipients which do |
117 not include an @-sign, so that each RCPT TO address is fully qualified. | 117 not include an @-sign, so that each RCPT TO address is fully qualified. |
118 \(Some configurations of sendmail require this.) | 118 \(Some configurations of sendmail require this.) |
119 | 119 |
120 Don't bother to set this unless you have get an error like: | 120 Don't bother to set this unless you have get an error like: |
138 "Whether this library sends the SMTP VERB command or not. | 138 "Whether this library sends the SMTP VERB command or not. |
139 The commands enables verbose information from the SMTP server." | 139 The commands enables verbose information from the SMTP server." |
140 :type 'boolean | 140 :type 'boolean |
141 :group 'smtpmail) | 141 :group 'smtpmail) |
142 | 142 |
143 (defcustom smtpmail-code-conv-from nil ;; *junet* | 143 (defcustom smtpmail-code-conv-from nil |
144 "*smtpmail code convert from this code to *internal*..for tiny-mime.." | 144 "Coding system for encoding outgoing mail. |
145 :type 'boolean | 145 Used for the value of `sendmail-coding-system' when |
146 `select-message-coding-system' is called. " | |
147 :type 'coding-system | |
146 :group 'smtpmail) | 148 :group 'smtpmail) |
147 | 149 |
148 (defcustom smtpmail-queue-mail nil | 150 (defcustom smtpmail-queue-mail nil |
149 "*If set, mail is queued; otherwise it is sent immediately. | 151 "Non-nil means mail is queued; otherwise it is sent immediately. |
150 If queued, it is stored in the directory `smtpmail-queue-dir' | 152 If queued, it is stored in the directory `smtpmail-queue-dir' |
151 and sent with `smtpmail-send-queued-mail'." | 153 and sent with `smtpmail-send-queued-mail'." |
152 :type 'boolean | 154 :type 'boolean |
153 :group 'smtpmail) | 155 :group 'smtpmail) |
154 | 156 |
155 (defcustom smtpmail-queue-dir "~/Mail/queued-mail/" | 157 (defcustom smtpmail-queue-dir "~/Mail/queued-mail/" |
156 "*Directory where `smtpmail.el' stores queued mail." | 158 "Directory where `smtpmail.el' stores queued mail." |
157 :type 'directory | 159 :type 'directory |
158 :group 'smtpmail) | 160 :group 'smtpmail) |
159 | 161 |
160 (defcustom smtpmail-auth-credentials "~/.authinfo" | 162 (defcustom smtpmail-auth-credentials "~/.authinfo" |
161 "Specify username and password for servers, directly or via .netrc file. | 163 "Specify username and password for servers, directly or via .netrc file. |
189 (file :tag "Certificate"))) | 191 (file :tag "Certificate"))) |
190 :version "21.1" | 192 :version "21.1" |
191 :group 'smtpmail) | 193 :group 'smtpmail) |
192 | 194 |
193 (defcustom smtpmail-warn-about-unknown-extensions nil | 195 (defcustom smtpmail-warn-about-unknown-extensions nil |
194 "*If set, print warnings about unknown SMTP extensions. | 196 "If set, print warnings about unknown SMTP extensions. |
195 This is mainly useful for development purposes, to learn about | 197 This is mainly useful for development purposes, to learn about |
196 new SMTP extensions that might be useful to support." | 198 new SMTP extensions that might be useful to support." |
197 :type 'boolean | 199 :type 'boolean |
198 :version "21.1" | 200 :version "21.1" |
199 :group 'smtpmail) | 201 :group 'smtpmail) |
200 | 202 |
201 (defvar smtpmail-queue-index-file "index" | 203 (defcustom smtpmail-queue-index-file "index" |
202 "File name of queued mail index. | 204 "File name of queued mail index. |
203 This is relative to `smtpmail-queue-dir'.") | 205 This is relative to `smtpmail-queue-dir'." |
206 :type 'string | |
207 :group 'smtpmail) | |
208 | |
209 ;; End of customizable variables. | |
210 | |
204 | 211 |
205 (defvar smtpmail-address-buffer) | 212 (defvar smtpmail-address-buffer) |
206 (defvar smtpmail-recipient-address-list) | 213 (defvar smtpmail-recipient-address-list) |
207 | 214 |
208 (defvar smtpmail-queue-counter 0) | 215 (defvar smtpmail-queue-counter 0) |
209 | 216 |
210 ;; Buffer-local variable. | 217 ;; Buffer-local variable. |
211 (defvar smtpmail-read-point) | 218 (defvar smtpmail-read-point) |
212 | 219 |
213 (defvar smtpmail-queue-index (concat smtpmail-queue-dir | |
214 smtpmail-queue-index-file)) | |
215 | |
216 (defconst smtpmail-auth-supported '(cram-md5 plain login) | 220 (defconst smtpmail-auth-supported '(cram-md5 plain login) |
217 "List of supported SMTP AUTH mechanisms.") | 221 "List of supported SMTP AUTH mechanisms.") |
218 | |
219 ;;; | |
220 ;;; | |
221 ;;; | |
222 | 222 |
223 (defvar smtpmail-mail-address nil | 223 (defvar smtpmail-mail-address nil |
224 "Value to use for envelope-from address for mail from ambient buffer.") | 224 "Value to use for envelope-from address for mail from ambient buffer.") |
225 | 225 |
226 ;;;###autoload | 226 ;;;###autoload |
407 (write-file file-elisp) | 407 (write-file file-elisp) |
408 (set-buffer (generate-new-buffer buffer-scratch)) | 408 (set-buffer (generate-new-buffer buffer-scratch)) |
409 (insert (concat file-data "\n")) | 409 (insert (concat file-data "\n")) |
410 (append-to-file (point-min) | 410 (append-to-file (point-min) |
411 (point-max) | 411 (point-max) |
412 smtpmail-queue-index) | 412 (expand-file-name smtpmail-queue-index-file |
413 ) | 413 smtpmail-queue-dir))) |
414 (kill-buffer buffer-scratch) | 414 (kill-buffer buffer-scratch) |
415 (kill-buffer buffer-data) | 415 (kill-buffer buffer-data) |
416 (kill-buffer buffer-elisp)))) | 416 (kill-buffer buffer-elisp)))) |
417 (kill-buffer tembuf) | 417 (kill-buffer tembuf) |
418 (if (bufferp errbuf) | 418 (if (bufferp errbuf) |
423 "Send mail that was queued as a result of setting `smtpmail-queue-mail'." | 423 "Send mail that was queued as a result of setting `smtpmail-queue-mail'." |
424 (interactive) | 424 (interactive) |
425 (with-temp-buffer | 425 (with-temp-buffer |
426 ;;; Get index, get first mail, send it, update index, get second | 426 ;;; Get index, get first mail, send it, update index, get second |
427 ;;; mail, send it, etc... | 427 ;;; mail, send it, etc... |
428 (let ((file-msg "")) | 428 (let ((file-msg "") |
429 (insert-file-contents smtpmail-queue-index) | 429 (qfile (expand-file-name smtpmail-queue-index-file |
430 smtpmail-queue-dir))) | |
431 (insert-file-contents qfile) | |
430 (goto-char (point-min)) | 432 (goto-char (point-min)) |
431 (while (not (eobp)) | 433 (while (not (eobp)) |
432 (setq file-msg (buffer-substring (point) (line-end-position))) | 434 (setq file-msg (buffer-substring (point) (line-end-position))) |
433 (load file-msg) | 435 (load file-msg) |
434 ;; Insert the message literally: it is already encoded as per | 436 ;; Insert the message literally: it is already encoded as per |
446 (error "Sending failed; SMTP protocol error")) | 448 (error "Sending failed; SMTP protocol error")) |
447 (error "Sending failed; no recipients")))) | 449 (error "Sending failed; no recipients")))) |
448 (delete-file file-msg) | 450 (delete-file file-msg) |
449 (delete-file (concat file-msg ".el")) | 451 (delete-file (concat file-msg ".el")) |
450 (delete-region (point-at-bol) (point-at-bol 2))) | 452 (delete-region (point-at-bol) (point-at-bol 2))) |
451 (write-region (point-min) (point-max) smtpmail-queue-index)))) | 453 (write-region (point-min) (point-max) qfile)))) |
452 | 454 |
453 ;(defun smtpmail-via-smtp (host,port,sender,destination,smtpmail-text-buffer) | 455 ;(defun smtpmail-via-smtp (host,port,sender,destination,smtpmail-text-buffer) |
454 | 456 |
455 (defun smtpmail-fqdn () | 457 (defun smtpmail-fqdn () |
456 (if smtpmail-local-domain | 458 (if smtpmail-local-domain |