]> code.delx.au - gnu-emacs/blobdiff - lisp/mail/mailpost.el
(mail-extr-all-letters-but-separators)
[gnu-emacs] / lisp / mail / mailpost.el
index f39d8ee61c2fe3a6698cffba19f3f390dd18c2c6..2bb5764948b2e199e31246a891a9434ad7e592b4 100644 (file)
@@ -1,14 +1,13 @@
 ;;; mailpost.el --- RMAIL coupler to /usr/uci/post mailer
 
+;; This is in the public domain
+;; since Delp distributed it without a copyright notice in 1986.
+
 ;; Author: Gary Delp <delp@huey.Udel.Edu>
 ;; Maintainer: FSF
 ;; Created: 13 Jan 1986
-;; Last-Modified: 30 May 1992
 ;; Keywords: mail
 
-;; This is in the public domain
-;; since Delp distributed it without a copyright notice in 1986.
-
 ;;; Commentary:
 
 ;; Yet another mail interface.  this for the rmail system to provide
@@ -17,6 +16,9 @@
 
 ;;; Code:
 
+(require 'mailalias)
+(require 'sendmail)
+
 ;; (setq send-mail-function 'post-mail-send-it)
 
 (defun post-mail-send-it ()
@@ -26,7 +28,7 @@ site-init."
   (let ((errbuf (if mail-interactive
                    (generate-new-buffer " post-mail errors")
                  0))
-       (temfile "/tmp/,rpost")
+       (temfile (expand-file-name ",rpost" temporary-file-directory))
        (tembuf (generate-new-buffer " post-mail temp"))
        (case-fold-search nil)
        delimline
@@ -41,10 +43,7 @@ site-init."
          (or (= (preceding-char) ?\n)
              (insert ?\n))
          ;; Change header-delimiter to be what post-mail expects.
-         (goto-char (point-min))
-         (search-forward (concat "\n" mail-header-separator "\n"))
-         (replace-match "\n\n")
-         (backward-char 1)
+         (mail-sendmail-undelimit-header)
          (setq delimline (point-marker))
          (if mail-aliases
              (expand-mail-aliases (point-min) delimline))
@@ -98,4 +97,6 @@ site-init."
       (if (bufferp errbuf)
          (switch-to-buffer errbuf)))))
 
+(provide 'mailpost)
+
 ;;; mailpost.el ends here