;;; smtpmail.el --- SMTP interface for mail-mode
-;; Copyright (C) 1995, 1996, 1998, 1999 Free Software Foundation, Inc.
+;; Copyright (C) 1995, 1996, 1998, 1999, 2000 Free Software Foundation, Inc.
;; Author: Tomoji Kagatani <kagatani@rbc.ncl.omron.co.jp>
;; Keywords: mail
;;; Code:
-(require 'poe)
(require 'custom)
(require 'smtp)
(require 'sendmail)
(require 'time-stamp)
+(require 'mel) ; binary-write-decoded-region, binary-find-file-noselect
(eval-when-compile (require 'static))
;;; (insert "Sender: " (user-login-name) "\n")))
;; Don't send out a blank subject line
(goto-char (point-min))
- (if (re-search-forward "^Subject:[ \t]*\n" delimline t)
- (replace-match ""))
+ (if (re-search-forward "^Subject:\\([ \t]*\n\\)+\\b" delimline t)
+ (replace-match "")
+ ;; This one matches a Subject just before the header delimiter.
+ (if (and (re-search-forward "^Subject:\\([ \t]*\n\\)+" delimline t)
+ (= (match-end 0) delimline))
+ (replace-match "")))
;; Put the "From:" field in unless for some odd reason
;; they put one in themselves.
(goto-char (point-min))
(insert-buffer tembuf)
(or (file-directory-p smtpmail-queue-dir)
(make-directory smtpmail-queue-dir t))
- (write-region-as-binary (point-min) (point-max) file-data)
+ (binary-write-decoded-region (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-as-binary file-msg))
+ (setq tembuf (binary-find-file-noselect file-msg))
(if smtpmail-recipient-address-list
(smtp-send-buffer user-mail-address
smtpmail-recipient-address-list tembuf)