X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=lisp%2Fnngateway.el;h=6059dcf821e7baf00f47ef6c57e6d83131270df6;hb=49d38b41c190eaab2cb34294fac7302a9c9ea353;hp=6dd6361501694cb17d9c7249b611cfc2265bdafb;hpb=7523ac5e3a0e4196d6043822dcb826c060fc1b58;p=elisp%2Fgnus.git- diff --git a/lisp/nngateway.el b/lisp/nngateway.el index 6dd6361..6059dcf 100644 --- a/lisp/nngateway.el +++ b/lisp/nngateway.el @@ -1,7 +1,9 @@ ;;; nngateway.el --- posting news via mail gateways -;; Copyright (C) 1996,97,98 Free Software Foundation, Inc. -;; Author: Lars Magne Ingebrigtsen +;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 +;; Free Software Foundation, Inc. + +;; Author: Lars Magne Ingebrigtsen ;; Keywords: news, mail ;; This file is part of GNU Emacs. @@ -25,6 +27,7 @@ ;;; Code: +(eval-when-compile (require 'cl)) (require 'nnoo) (require 'message) @@ -54,7 +57,7 @@ parameter -- the gateway address.") (nngateway-open-server server)) ;; Rewrite the header. (let ((buf (current-buffer))) - (nnheader-temp-write nil + (with-temp-buffer (insert-buffer-substring buf) (message-narrow-to-head) (funcall nngateway-header-transformation nngateway-address) @@ -62,7 +65,9 @@ parameter -- the gateway address.") (insert mail-header-separator "\n") (widen) (let (message-required-mail-headers) - (funcall message-send-mail-function)))))) + (funcall (or message-send-mail-real-function + message-send-mail-function))) + t)))) ;;; Internal functions @@ -75,6 +80,13 @@ parameter -- the gateway address.") (insert "To: " (nnheader-replace-chars-in-string newsgroups ?. ?-) "@" gateway "\n"))) +(defun nngateway-mail2news-header-transformation (gateway) + "Transform the headers for sending to a mail2news gateway." + (message-remove-header "to") + (message-remove-header "cc") + (goto-char (point-min)) + (insert "To: " gateway "\n")) + (nnoo-define-skeleton nngateway) (provide 'nngateway)