;;; nngateway.el --- posting news via mail gateways
-;; Copyright (C) 1996,97 Free Software Foundation, Inc.
-;; Author: Lars Magne Ingebrigtsen <larsi@ifi.uio.no>
+;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
+;; Free Software Foundation, Inc.
+
+;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
;; Keywords: news, mail
;; This file is part of GNU Emacs.
;;; Code:
+(eval-when-compile (require 'cl))
(require 'nnoo)
(require 'message)
(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)
+ (goto-char (point-max))
+ (insert mail-header-separator "\n")
(widen)
(let (message-required-mail-headers)
- (message-send-mail))))))
+ (funcall (or message-send-mail-real-function
+ message-send-mail-function)))
+ t))))
;;; Internal functions
(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)