1 ;;; smtp.el --- basic functions to send mail with SMTP server
3 ;; Copyright (C) 1995, 1996, 1998, 1999, 2000, 2001 ,2002, 2004
4 ;; Free Software Foundation, Inc.
6 ;; Author: Tomoji Kagatani <kagatani@rbc.ncl.omron.co.jp>
7 ;; Simon Leinen <simon@switch.ch> (ESMTP support)
8 ;; Shuhei KOBAYASHI <shuhei@aqua.ocn.ne.jp>
9 ;; Daiki Ueno <ueno@unixuser.org>
10 ;; Keywords: SMTP, mail
12 ;; This file is part of FLIM (Faithful Library about Internet Message).
14 ;; This program is free software; you can redistribute it and/or
15 ;; modify it under the terms of the GNU General Public License as
16 ;; published by the Free Software Foundation; either version 2, or (at
17 ;; your option) any later version.
19 ;; This program is distributed in the hope that it will be useful, but
20 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
21 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22 ;; General Public License for more details.
24 ;; You should have received a copy of the GNU General Public License
25 ;; along with this program; see the file COPYING. If not, write to the
26 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
27 ;; Boston, MA 02110-1301, USA.
36 (require 'mail-utils) ; mail-strip-quoted-names
39 (require 'mel) ; binary-funcall
42 "SMTP protocol for sending mail."
45 (defgroup smtp-extensions nil
46 "SMTP service extensions (RFC1869)."
49 (defcustom smtp-default-server nil
50 "Specify default SMTP server."
51 :type '(choice (const nil) string)
54 (defcustom smtp-server (or (getenv "SMTPSERVER") smtp-default-server)
55 "The name of the host running SMTP server.
56 It can also be a function
57 called from `smtp-via-smtp' with arguments SENDER and RECIPIENTS."
58 :type '(choice (string :tag "Name")
59 (function :tag "Function"))
62 (defcustom smtp-send-by-myself nil
63 "If non-nil, smtp.el send a mail by myself without smtp-server.
64 This option requires \"dig.el\"."
68 (defcustom smtp-service "smtp"
69 "SMTP service port number. \"smtp\" or 25."
70 :type '(choice (integer :tag "25" 25)
71 (string :tag "smtp" "smtp"))
74 (defcustom smtp-local-domain nil
75 "Local domain name without a host name.
76 If the function (system-name) returns the full internet address,
77 don't define this value."
78 :type '(choice (const nil) string)
81 (defcustom smtp-fqdn nil
82 "Fully qualified domain name used for Message-ID."
83 :type '(choice (const nil) string)
86 (defcustom smtp-use-8bitmime t
87 "If non-nil, use ESMTP 8BITMIME (RFC1652) if available."
89 :group 'smtp-extensions)
91 (defcustom smtp-use-size t
92 "If non-nil, use ESMTP SIZE (RFC1870) if available."
94 :group 'smtp-extensions)
96 (defcustom smtp-use-starttls nil
97 "If non-nil, use STARTTLS (RFC2595) if available."
99 :group 'smtp-extensions)
101 (defcustom smtp-use-starttls-ignore-error nil
102 "If non-nil, do not use STARTTLS if STARTTLS is not available."
104 :group 'smtp-extensions)
106 (defcustom smtp-starttls-program "starttls"
107 "The program to run in a subprocess to open an TLSv1 connection."
108 :group 'smtp-extensions)
110 (defcustom smtp-starttls-extra-args nil
111 "Extra arguments to `starttls-program'"
112 :group 'smtp-extensions)
114 (defcustom smtp-use-sasl nil
115 "If non-nil, use SMTP Authentication (RFC2554) if available."
117 :group 'smtp-extensions)
119 (defcustom smtp-sasl-user-name (user-login-name)
120 "Identification to be used for authorization."
122 :group 'smtp-extensions)
124 (defcustom smtp-sasl-properties nil
125 "Properties set to SASL client."
127 :group 'smtp-extensions)
129 (defcustom smtp-sasl-mechanisms nil
130 "List of authentication mechanisms."
131 :type '(repeat string)
132 :group 'smtp-extensions)
134 (defcustom smtp-progress-message-format nil
135 "Format string used to show progress message while sending mails.
136 It allows the following special format specifiers:
138 %b means show the number of bytes which has been sent
139 and the total bytes of a mail.
140 %k means show the number of kilobytes which has been sent
141 and the total kilobytes of a mail.
142 %l means show the number of lines which has been sent
143 and the total lines of a mail.
145 For instance, the value \"Sending (%k)...\" shows like
146 \"Sending (45k/123k)...\" in the echo area."
147 :type '(radio (string :format "%v\n" :size 0 :value "Sending (%k)...")
148 (const :tag "Don't show progress message" nil))
151 (defvar sasl-mechanisms)
154 (defvar smtp-open-connection-function #'open-network-stream
155 "*Function used for connecting to a SMTP server.
156 The function will be called with the same four arguments as
157 `open-network-stream' and should return a process object.
160 \(setq smtp-open-connection-function
161 #'(lambda (name buffer host service)
162 (let ((process-connection-type nil))
163 (start-process name buffer \"ssh\" \"-C\" host
164 \"nc\" host service))))
166 It connects to a SMTP server using \"ssh\" before actually connecting
167 to the SMTP port. Where the command \"nc\" is the netcat executable;
168 see http://www.atstake.com/research/tools/index.html#network_utilities
169 for details. In addition, you will have to modify the value for
170 `smtp-end-of-line' to \"\\n\" if you use \"telnet\" instead of \"nc\".")
172 (defvar smtp-read-point nil)
174 (defvar smtp-connection-alist nil)
176 (defvar smtp-submit-package-function #'smtp-submit-package)
178 (defvar smtp-end-of-line "\r\n"
179 "*String to use as end-of-line marker when talking to a SMTP server.
180 This is \"\\r\\n\" by default, but it may have to be \"\\n\" when using a non
181 native connection function. See also `smtp-open-connection-function'.")
184 ;;; A package contains a mail message, an envelope sender address,
185 ;;; and one or more envelope recipient addresses. In ESMTP model
186 ;;; the current sending package should be guaranteed to be accessible
187 ;;; anywhere from the hook methods (or SMTP commands).
190 (luna-define-class smtp-package ()
195 (luna-define-internal-accessors 'smtp-package))
197 (defun smtp-make-package (sender recipients buffer)
198 "Create a new package structure.
199 A package is a unit of SMTP message
200 SENDER specifies the package sender, a string.
201 RECIPIENTS is a list of recipients.
202 BUFFER may be a buffer or a buffer name which contains mail message."
203 (luna-make-entity 'smtp-package :sender sender :recipients recipients :buffer buffer))
205 (defun smtp-package-buffer-internal-size (package)
206 "Return the size of PACKAGE, an integer."
208 (set-buffer (smtp-package-buffer-internal package))
211 ;; Add one byte for each change-of-line
212 ;; because or CR-LF representation:
213 (count-lines (point-min) (point-max))
214 ;; For some reason, an empty line is
215 ;; added to the message. Maybe this
216 ;; is a bug, but it can't hurt to add
217 ;; those two bytes anyway:
219 (goto-char (point-min))
220 (while (re-search-forward "^\\." nil t)
221 (setq size (1+ size)))
224 ;;; @ SMTP connection
225 ;;; We should consider the function `open-network-stream' is a emulation
226 ;;; for another network stream. They are likely to be implemented with an
227 ;;; external program and the function `process-contact' returns the
228 ;;; process id instead of `(HOST SERVICE)' pair.
231 (luna-define-class smtp-connection ()
239 (luna-define-internal-accessors 'smtp-connection))
241 (defun smtp-make-connection (process server service)
242 "Create a new connection structure.
243 PROCESS is an internal subprocess-object. SERVER is name of the host
244 to connect to. SERVICE is name of the service desired."
245 (luna-make-entity 'smtp-connection :process process :server server :service service))
247 (luna-define-generic smtp-connection-opened (connection)
248 "Say whether the CONNECTION to server has been opened.")
250 (luna-define-generic smtp-close-connection (connection)
251 "Close the CONNECTION to server.")
253 (luna-define-method smtp-connection-opened ((connection smtp-connection))
254 (let ((process (smtp-connection-process-internal connection)))
255 (if (memq (process-status process) '(open run))
258 (luna-define-method smtp-close-connection ((connection smtp-connection))
259 (let ((process (smtp-connection-process-internal connection)))
260 (delete-process process)))
262 (defun smtp-make-fqdn ()
263 "Return user's fully qualified domain name."
266 (let ((system-name (system-name)))
269 (concat system-name "." smtp-local-domain))
270 ((string-match "[^.]\\.[^.]" system-name)
273 (error "Cannot generate valid FQDN"))))))
275 (defun smtp-find-connection (buffer)
276 "Find the connection delivering to BUFFER."
277 (let ((entry (assq buffer smtp-connection-alist))
280 (setq connection (nth 1 entry))
281 (if (smtp-connection-opened connection)
283 (setq smtp-connection-alist
284 (delq entry smtp-connection-alist))
288 (autoload 'starttls-open-stream "starttls")
289 (autoload 'starttls-negotiate "starttls"))
291 (defun smtp-open-connection (buffer server service)
292 "Open a SMTP connection for a service to a host.
293 Return a newly allocated connection-object.
294 BUFFER is the buffer to associate with the connection. SERVER is name
295 of the host to connect to. SERVICE is name of the service desired."
297 (binary-funcall smtp-open-connection-function
298 "SMTP" buffer server service))
301 (setq connection (smtp-make-connection process server service))
302 (set-process-filter process 'smtp-process-filter)
303 (setq smtp-connection-alist
304 (cons (list buffer connection)
305 smtp-connection-alist))
309 (autoload 'dig-invoke "dig")
310 (autoload 'dig-extract-rr "dig"))
312 (defun smtp-find-mx (domain &optional doerror)
314 ;; dig.el resolves only primally MX.
315 (cond ((setq server (smtp-dig domain "MX"))
316 (progn (string-match " \\([^ ]*\\)$" server)
317 (match-string 1 server)))
318 ((smtp-dig domain "A")
322 (error (format "SMTP cannot resolve %s" domain)))))))
324 (defun smtp-dig (domain type)
327 (setq dig-buf (dig-invoke domain type)))
329 (dig-extract-rr domain type)
330 (kill-buffer dig-buf))))
332 (defun smtp-find-server (recipients)
335 (mapcar (lambda (recipient)
337 (if (and (string-match "@\\([^\t\n ]*\\)" recipient)
340 (match-string 1 recipient))))
341 (cons server (list recipient))
342 (error (format "cannot find server for %s." recipient)))))
345 (while (setq rets (pop rec))
346 (if (setq ret (assoc (car rets) rec))
348 (append (cdr ret) (cdr rets)))
350 (append rlist (list rets)))))
354 (defun smtp-via-smtp (sender recipients buffer)
355 "Like `smtp-send-buffer', but sucks in any errors."
358 (smtp-send-buffer sender recipients buffer)
362 (make-obsolete 'smtp-via-smtp "It's old API.")
365 (defun smtp-send-buffer (sender recipients buffer)
367 SENDER is an envelope sender address.
368 RECIPIENTS is a list of envelope recipient addresses.
369 BUFFER may be a buffer or a buffer name which contains mail message."
370 (if smtp-send-by-myself
371 (smtp-send-buffer-by-myself sender recipients buffer)
373 (if (functionp smtp-server)
374 (funcall smtp-server sender recipients)
376 (error "`smtp-server' not defined"))))
378 (smtp-make-package sender recipients buffer))
379 (starttls-program smtp-starttls-program)
380 (starttls-extra-args smtp-starttls-extra-args)
381 (smtp-open-connection-function
382 (if smtp-use-starttls
383 #'starttls-open-stream
384 smtp-open-connection-function)))
388 (format "*trace of SMTP session to %s*" server)))
390 (buffer-disable-undo)
391 (unless (smtp-find-connection (current-buffer))
392 (smtp-open-connection (current-buffer) server smtp-service))
393 (make-local-variable 'smtp-read-point)
394 (setq smtp-read-point (point-min))
395 (funcall smtp-submit-package-function package)))))
397 (defun smtp-submit-package (package)
400 (smtp-primitive-greeting package)
402 (smtp-primitive-ehlo package)
404 (smtp-primitive-helo package)))
405 (if smtp-use-starttls
407 (smtp-connection-extensions-internal
408 (smtp-find-connection (current-buffer))))
410 (smtp-primitive-starttls package)
411 (smtp-primitive-ehlo package))
412 (unless smtp-use-starttls-ignore-error
413 (error "STARTTLS is not supported on this server"))))
415 (smtp-primitive-auth package))
416 (smtp-primitive-mailfrom package)
417 (smtp-primitive-rcptto package)
418 (smtp-primitive-data package))
419 (let ((connection (smtp-find-connection (current-buffer))))
420 (when (smtp-connection-opened connection)
421 (smtp-primitive-quit package)
422 (smtp-close-connection connection)))))
424 (defun smtp-send-buffer-by-myself (sender recipients buffer)
425 "Send a message by myself.
426 SENDER is an envelope sender address.
427 RECIPIENTS is a list of envelope recipient addresses.
428 BUFFER may be a buffer or a buffer name which contains mail message."
430 (smtp-find-server recipients))
431 (smtp-open-connection-function
432 (if smtp-use-starttls
433 #'starttls-open-stream
434 smtp-open-connection-function))
437 (setq server (caar servers))
438 (setq recipients (cdar servers))
439 (if (not (and server recipients))
440 ;; MAILER-DAEMON is required. :)
441 (error (format "Cannot send <%s>"
442 (mapconcat 'concat recipients ">,<"))))
444 (smtp-make-package sender recipients buffer))
448 (format "*trace of SMTP session to %s*" server)))
450 (buffer-disable-undo)
451 (unless (smtp-find-connection (current-buffer))
452 (smtp-open-connection (current-buffer) server smtp-service))
453 (make-local-variable 'smtp-read-point)
454 (setq smtp-read-point (point-min))
455 (let ((smtp-use-sasl nil)
456 (smtp-use-starttls-ignore-error t))
457 (funcall smtp-submit-package-function package)))
458 (setq servers (cdr servers)))))
460 ;;; @ hook methods for `smtp-submit-package'
463 (defun smtp-primitive-greeting (package)
465 (smtp-find-connection (current-buffer)))
467 (smtp-read-response connection)))
468 (if (/= (car response) 220)
469 (smtp-response-error response))))
471 (defun smtp-primitive-ehlo (package)
473 (smtp-find-connection (current-buffer)))
475 (smtp-send-command connection (format "EHLO %s" (smtp-make-fqdn)))
476 (setq response (smtp-read-response connection))
477 (if (/= (car response) 250)
478 (smtp-response-error response))
479 (smtp-connection-set-extensions-internal
483 (split-string extension)))
485 (car (read-from-string
486 (downcase (car extensions)))))
490 (defun smtp-primitive-helo (package)
492 (smtp-find-connection (current-buffer)))
494 (smtp-send-command connection (format "HELO %s" (smtp-make-fqdn)))
495 (setq response (smtp-read-response connection))
496 (if (/= (car response) 250)
497 (smtp-response-error response))))
499 (defun smtp-primitive-auth (package)
501 (smtp-find-connection (current-buffer)))
503 (cdr (assq 'auth (smtp-connection-extensions-internal connection))))
505 (or smtp-sasl-mechanisms sasl-mechanisms))
507 (sasl-find-mechanism mechanisms))
513 (error "No authentication mechanism available"))
514 (setq client (sasl-make-client mechanism smtp-sasl-user-name "smtp"
515 (smtp-connection-server-internal connection)))
516 (if smtp-sasl-properties
517 (sasl-client-set-properties client smtp-sasl-properties))
518 (setq name (sasl-mechanism-name mechanism)
519 ;; Retrieve the initial response
520 step (sasl-next-step client nil))
523 (if (sasl-step-data step)
524 (format "AUTH %s %s" name (base64-encode-string (sasl-step-data step) t))
525 (format "AUTH %s" name)))
528 (setq response (smtp-read-response connection))
529 (when (= (car response) 235)
530 ;; The authentication process is finished.
531 (setq step (sasl-next-step client step))
534 (smtp-response-error response)) ;Bogus server?
535 (if (/= (car response) 334)
536 (smtp-response-error response))
537 (sasl-step-set-data step (base64-decode-string (nth 1 response)))
538 (setq step (sasl-next-step client step))
541 (if (sasl-step-data step)
542 (base64-encode-string (sasl-step-data step) t)
544 ;;; (smtp-connection-set-encoder-internal
545 ;;; connection (sasl-client-encoder client))
546 ;;; (smtp-connection-set-decoder-internal
547 ;;; connection (sasl-client-decoder client))
550 (defun smtp-primitive-starttls (package)
552 (smtp-find-connection (current-buffer)))
554 ;; STARTTLS --- begin a TLS negotiation (RFC 2595)
555 (smtp-send-command connection "STARTTLS")
556 (setq response (smtp-read-response connection))
557 (if (/= (car response) 220)
558 (smtp-response-error response))
559 (starttls-negotiate (smtp-connection-process-internal connection))))
561 (defun smtp-primitive-mailfrom (package)
563 (smtp-find-connection (current-buffer)))
565 (smtp-connection-extensions-internal
568 (smtp-package-sender-internal package))
571 ;; SIZE --- Message Size Declaration (RFC1870)
572 (if (and smtp-use-size
573 (assq 'size extensions))
574 (setq extension (format "SIZE=%d" (smtp-package-buffer-internal-size package))))
575 ;; 8BITMIME --- 8bit-MIMEtransport (RFC1652)
576 (if (and smtp-use-8bitmime
577 (assq '8bitmime extensions))
578 (setq extension (concat extension " BODY=8BITMIME")))
582 (format "MAIL FROM:<%s> %s" sender extension)
583 (format "MAIL FROM:<%s>" sender)))
584 (setq response (smtp-read-response connection))
585 (if (/= (car response) 250)
586 (smtp-response-error response))))
588 (defun smtp-primitive-rcptto (package)
590 (smtp-find-connection (current-buffer)))
592 (smtp-package-recipients-internal package))
596 connection (format "RCPT TO:<%s>" (pop recipients)))
597 (setq response (smtp-read-response connection))
598 (unless (memq (car response) '(250 251))
599 (smtp-response-error response)))))
601 (defun smtp-primitive-data (package)
603 (smtp-find-connection (current-buffer)))
605 (smtp-send-command connection "DATA")
606 (setq response (smtp-read-response connection))
607 (if (/= (car response) 354)
608 (smtp-response-error response))
610 (set-buffer (smtp-package-buffer-internal package))
611 (setq def (smtp-parse-progress-message-format))
612 (goto-char (point-min))
615 connection (buffer-substring (point) (progn (end-of-line)(point))))
616 (beginning-of-line 2)
617 (setq prev (smtp-show-progress-message def prev))))
618 (smtp-send-command connection ".")
619 (setq response (smtp-read-response connection))
620 (if (/= (car response) 250)
621 (smtp-response-error response))))
623 (defun smtp-primitive-quit (package)
625 (smtp-find-connection (current-buffer)))
627 (smtp-send-command connection "QUIT")
628 (setq response (smtp-read-response connection))
629 (if (/= (car response) 221)
630 (smtp-response-error response))))
632 ;;; @ low level process manipulating function
634 (defun smtp-process-filter (process output)
636 (set-buffer (process-buffer process))
637 (goto-char (point-max))
640 (put 'smtp-error 'error-message "SMTP error")
641 (put 'smtp-error 'error-conditions '(smtp-error error))
643 (put 'smtp-response-error 'error-message "SMTP response error")
644 (put 'smtp-response-error 'error-conditions '(smtp-response-error smtp-error error))
646 (defun smtp-response-error (response)
647 (signal 'smtp-response-error response))
649 (defun smtp-read-response (connection)
651 (smtp-connection-decoder-internal connection))
652 (response-continue t)
654 (while response-continue
655 (goto-char smtp-read-point)
656 (while (not (search-forward smtp-end-of-line nil t))
657 (unless (smtp-connection-opened connection)
658 (signal 'smtp-error "Connection closed"))
659 (accept-process-output (smtp-connection-process-internal connection))
660 (goto-char smtp-read-point))
662 (let ((string (buffer-substring smtp-read-point (- (point) 2))))
663 (delete-region smtp-read-point (point))
664 (insert (funcall decoder string) smtp-end-of-line)))
667 (list (buffer-substring
668 (+ 4 smtp-read-point)
671 (prog1 smtp-read-point
672 (setq smtp-read-point (point))))
673 (if (looking-at "[1-5][0-9][0-9] ")
674 (setq response (cons (read (point-marker)) response)
675 response-continue nil)))
678 (defun smtp-send-command (connection command)
681 (smtp-connection-process-internal connection))
683 (smtp-connection-encoder-internal connection)))
684 (set-buffer (process-buffer process))
685 (goto-char (point-max))
686 (setq command (concat command smtp-end-of-line))
688 (setq smtp-read-point (point))
690 (setq command (funcall encoder command)))
691 (process-send-string process command))))
693 (defun smtp-send-data (connection data)
695 (smtp-connection-process-internal connection))
697 (smtp-connection-encoder-internal connection)))
698 ;; Escape "." at start of a line.
699 (if (eq (string-to-char data) ?.)
700 (setq data (concat "." data smtp-end-of-line))
701 (setq data (concat data smtp-end-of-line)))
703 (setq data (funcall encoder data)))
704 (process-send-string process data)))
706 (defun smtp-deduce-address-list (smtp-text-buffer header-start header-end)
707 "Get address list suitable for smtp RCPT TO:<address>."
708 (let ((simple-address-list "")
712 (smtp-address-buffer (generate-new-buffer " *smtp-mail*")))
716 (set-buffer smtp-address-buffer)
717 (setq case-fold-search t)
719 (insert (save-excursion
720 (set-buffer smtp-text-buffer)
721 (buffer-substring-no-properties header-start header-end)))
722 (goto-char (point-min))
723 ;; RESENT-* fields should stop processing of regular fields.
725 (if (re-search-forward "^RESENT-TO:" header-end t)
727 "^\\(RESENT-TO:\\|RESENT-CC:\\|RESENT-BCC:\\)")
728 (setq addr-regexp "^\\(TO:\\|CC:\\|BCC:\\)")))
730 (while (re-search-forward addr-regexp header-end t)
732 (setq this-line (match-beginning 0))
734 ;; get any continuation lines.
735 (while (and (looking-at "^[ \t]+") (< (point) header-end))
737 (setq this-line-end (point-marker))
738 (setq simple-address-list
739 (concat simple-address-list " "
740 (mail-strip-quoted-names
741 (buffer-substring this-line this-line-end)))))
743 (insert " " simple-address-list "\n")
745 (subst-char-in-region (point-min) (point-max) 10 ? t)
747 (subst-char-in-region (point-min) (point-max) ?, ? t)
749 (subst-char-in-region (point-min) (point-max) 9 ? t)
751 (goto-char (point-min))
752 ;; tidyness in case hook is not robust when it looks at this
753 (while (re-search-forward "[ \t]+" header-end t) (replace-match " "))
755 (goto-char (point-min))
756 (let (recipient-address-list)
757 (while (re-search-forward " \\([^ ]+\\) " (point-max) t)
759 (setq recipient-address-list
760 (cons (buffer-substring (match-beginning 1) (match-end 1))
761 recipient-address-list)))
762 recipient-address-list))
763 (kill-buffer smtp-address-buffer))))
765 ;;; @ functions used to show progress message
767 (defun smtp-parse-progress-message-format ()
768 "Parse the `smtp-progress-message-format' variable.
769 Return nil, or a cons of an ordinary format string and a type including
770 nil, the symbols `b', `k' and `l'."
771 (when smtp-progress-message-format
772 (let ((format smtp-progress-message-format)
775 (while (string-match "%\\([bkl]\\)\\|%\\([^%bkl]\\|\\'\\)" format index)
778 (setq index (match-end 0)
779 type (intern (match-string 1 format))
780 format (replace-match
783 (number-to-string (buffer-size))))
785 (if (>= (buffer-size) 512)
788 (/ (+ (buffer-size) 512) 1024))
792 (number-to-string (buffer-size)))))
796 (count-lines (point-min)
799 (setq index (1+ (match-end 0))
800 format (replace-match "%\\&" nil nil format))))
801 (cons format type))))
803 (defun smtp-show-progress-message (def prev)
804 "Show progress message while sending mails.
805 DEF is a cons cell which is pre-computed by the
806 `smtp-parse-progress-message-format' function or nil.
807 PREV is a number shown last time or nil.
808 Return a number computed this time."
810 (let* ((fmt (car def))
812 (value (cond ((eq type 'b)
813 (- (point) (point-min)))
815 (/ (- (point) (point-min) -512) 1024))
817 (count-lines (point-min) (point)))))
823 (cond ((featurep 'xemacs)
824 (display-message 'no-log (if value
830 (message "%s" fmt))))
835 ;;; smtp.el ends here