X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=lisp%2Fsmtp.el;h=1954200f35413fed731d2721a3785620590432d6;hb=a45dd507bf71d9e3fbfb6067896554323b02b643;hp=331bd7e2c1e2861825a6fa1af850d3f9fdd46763;hpb=eab82f63a124fbeb2f82831bc2431173749671ba;p=elisp%2Fgnus.git- diff --git a/lisp/smtp.el b/lisp/smtp.el index 331bd7e..1954200 100644 --- a/lisp/smtp.el +++ b/lisp/smtp.el @@ -1,4 +1,4 @@ -;;; smtp.el --- basic functions of SMTP protocol (RFC 821) +;;; smtp.el --- basic functions to send mail with SMTP server ;; Copyright (C) 1995, 1996, 1998 Free Software Foundation, Inc. @@ -57,11 +57,6 @@ don't define this value." :type 'boolean :group 'smtp) -(defcustom smtp-coding-system 'binary - "*Coding-system for SMTP output." - :type 'coding-system - :group 'smtp) - (defun smtp-fqdn () (if smtp-local-domain @@ -75,9 +70,7 @@ don't define this value." response-code greeting process-buffer - (supported-extensions '()) - (coding-system-for-read smtp-coding-system) - (coding-system-for-write smtp-coding-system)) + (supported-extensions '())) (unwind-protect (catch 'done ;; get or create the trace buffer @@ -91,7 +84,8 @@ don't define this value." (erase-buffer)) ;; open the connection to the server - (setq process (open-network-stream "SMTP" process-buffer host port)) + (setq process (open-network-stream-as-binary + "SMTP" process-buffer host port)) (and (null process) (throw 'done nil)) ;; set the send-filter @@ -361,7 +355,7 @@ don't define this value." (setq this-line-end (point)) (setq sending-data nil) (setq sending-data (buffer-substring this-line this-line-end)) - (if (/= (forward-line 1) 0) + (if (or (/= (forward-line 1) 0) (eobp)) (setq data-continue nil))) (smtp-send-data-1 process sending-data) @@ -376,19 +370,21 @@ don't define this value." (simple-address-list "") this-line this-line-end - addr-regexp) - + addr-regexp + (smtp-address-buffer (generate-new-buffer " *smtp-mail*"))) (unwind-protect (save-excursion ;; - (set-buffer smtp-address-buffer) (erase-buffer) + (set-buffer smtp-address-buffer) + (erase-buffer) (insert-buffer-substring smtp-text-buffer header-start header-end) (goto-char (point-min)) ;; RESENT-* fields should stop processing of regular fields. (save-excursion (if (re-search-forward "^RESENT-TO:" header-end t) - (setq addr-regexp "^\\(RESENT-TO:\\|RESENT-CC:\\|RESENT-BCC:\\)") + (setq addr-regexp + "^\\(RESENT-TO:\\|RESENT-CC:\\|RESENT-BCC:\\)") (setq addr-regexp "^\\(TO:\\|CC:\\|BCC:\\)"))) (while (re-search-forward addr-regexp header-end t) @@ -401,15 +397,19 @@ don't define this value." (setq this-line-end (point-marker)) (setq simple-address-list (concat simple-address-list " " - (mail-strip-quoted-names (buffer-substring this-line this-line-end)))) + (mail-strip-quoted-names + (buffer-substring this-line this-line-end)))) ) (erase-buffer) (insert-string " ") (insert-string simple-address-list) (insert-string "\n") - (subst-char-in-region (point-min) (point-max) 10 ? t);; newline --> blank - (subst-char-in-region (point-min) (point-max) ?, ? t);; comma --> blank - (subst-char-in-region (point-min) (point-max) 9 ? t);; tab --> blank + ;; newline --> blank + (subst-char-in-region (point-min) (point-max) 10 ? t) + ;; comma --> blank + (subst-char-in-region (point-min) (point-max) ?, ? t) + ;; tab --> blank + (subst-char-in-region (point-min) (point-max) 9 ? t) (goto-char (point-min)) ;; tidyness in case hook is not robust when it looks at this @@ -419,15 +419,14 @@ don't define this value." (let (recipient-address-list) (while (re-search-forward " \\([^ ]+\\) " (point-max) t) (backward-char 1) - (setq recipient-address-list (cons (buffer-substring (match-beginning 1) (match-end 1)) - recipient-address-list)) + (setq recipient-address-list + (cons (buffer-substring (match-beginning 1) (match-end 1)) + recipient-address-list)) ) - (setq smtp-recipient-address-list recipient-address-list)) - + recipient-address-list) ) - ) - ) - ) + (kill-buffer smtp-address-buffer)) + )) (defun smtp-do-bcc (header-end) "Delete BCC: and their continuation lines from the header area.