;;; smtpmail.el --- SMTP interface for mail-mode
-;; Copyright (C) 1995, 1996, 1998 Free Software Foundation, Inc.
+;; Copyright (C) 1995, 1996, 1998, 1999 Free Software Foundation, Inc.
;; Author: Tomoji Kagatani <kagatani@rbc.ncl.omron.co.jp>
;; Keywords: mail
;; General Public License for more details.
;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING. If not, write to the
-;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; along with this program; see the file COPYING. If not, write to
+;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
;; Boston, MA 02111-1307, USA.
;;; Commentary:
;;; Code:
+(require 'poe)
+(require 'pcustom)
(require 'smtp)
(require 'sendmail)
(require 'time-stamp)
+(eval-when-compile (require 'static))
+
+(static-when (featurep 'xemacs)
+ (define-obsolete-variable-alias 'smtpmail-default-smtp-server
+ 'smtp-default-server)
+ (define-obsolete-variable-alias 'smtpmail-smtp-server 'smtp-server)
+ (define-obsolete-variable-alias 'smtpmail-smtp-service 'smtp-service)
+ (define-obsolete-variable-alias 'smtpmail-local-domain 'smtp-local-domain)
+ (define-obsolete-variable-alias 'smtpmail-debug-info 'smtp-debug-info)
+ )
+
;;;
(defcustom smtpmail-queue-mail nil
(backward-char 1)
(setq delimline (point-marker))
;; (sendmail-synch-aliases)
- (if mail-aliases
+ (if (and mail-aliases (fboundp 'expand-mail-aliases)) ; XEmacs
(expand-mail-aliases (point-min) delimline))
(goto-char (point-min))
;; ignore any blank lines in the header
(save-restriction
(narrow-to-region (point)
(save-excursion
- (end-of-line)
+ (forward-line 1)
+ (while (looking-at "^[ \t]")
+ (forward-line 1))
(point)))
(append (mail-parse-comma-list)
resend-to-addresses))))
(error "Sending failed; no recipients"))
(let* ((file-data (concat
smtpmail-queue-dir
- (time-stamp-strftime
- "%02y%02m%02d-%02H%02M%02S")))
+ (mapconcat
+ (lambda (arg) (format "%x" arg))
+ (current-time) "")))
(file-elisp (concat file-data ".el"))
(buffer-data (create-file-buffer file-data))
(buffer-elisp (create-file-buffer file-elisp))
(set-buffer buffer-data)
(erase-buffer)
(insert-buffer tembuf)
- (write-file file-data)
+ (write-region-as-binary (point-min) (point-max) file-data)
(set-buffer buffer-elisp)
(erase-buffer)
(insert (concat
(end-of-line)
(point))))
(load file-msg)
- (setq tembuf (find-file-noselect file-msg))
+ (setq tembuf (find-file-noselect-as-binary file-msg))
(if smtpmail-recipient-address-list
(if (not (smtp-via-smtp user-mail-address
smtpmail-recipient-address-list tembuf))