From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/9476 Path: main.gmane.org!not-for-mail From: Rich Pieri Newsgroups: gmane.emacs.gnus.general Subject: Re: OffGnus Date: 20 Jan 1997 10:17:39 -0500 Message-ID: References: NNTP-Posting-Host: coloc-standby.netfonds.no X-Trace: main.gmane.org 1035149496 18723 80.91.224.250 (20 Oct 2002 21:31:36 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 20 Oct 2002 21:31:36 +0000 (UTC) Return-Path: Original-Received: from ifi.uio.no (0@ifi.uio.no [129.240.64.2]) by deanna.miranova.com (8.8.4/8.8.4) with SMTP id HAA04537 for ; Mon, 20 Jan 1997 07:37:01 -0800 Original-Received: from londo.asds.com (londo.prescienttech.com [199.103.216.62]) by ifi.uio.no with ESMTP (8.6.11/ifi2.4) id for ; Mon, 20 Jan 1997 16:18:07 +0100 Original-Received: from gkar.asds.com (gkar.asds.com [111.17.19.1]) by londo.asds.com (8.8.4/8.8.4) with ESMTP id KAA06920 for ; Mon, 20 Jan 1997 10:18:06 -0500 Original-Received: (from ratinox@localhost) by gkar.asds.com (8.8.4/8.8.4) id KAA03724; Mon, 20 Jan 1997 10:18:05 -0500 Original-To: ding@ifi.uio.no In-Reply-To: Lars Magne Ingebrigtsen's message of 16 Jan 1997 02:10:57 +0100 Original-Lines: 257 X-Mailer: Gnus v5.2.40/Emacs 19.34 Xref: main.gmane.org gmane.emacs.gnus.general:9476 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:9476 -----BEGIN PGP SIGNED MESSAGE----- >>>>> "LMI" == Lars Magne Ingebrigtsen writes: LMI> 1) inn+suck (or whatever) and pop. That is, we set things up LMI> properly and let other programs deal with how to shuffle things LMI> to/from the net. This also does not necessarilly work all that well on non-Unix machines (Windows 95 and NT). LMI> 2) Using the cache. This doesn't really work as well as it should, LMI> since Gnus insists on trying to connect to the real server even most LMI> of the articles are present in the cache. Right now there are two or three mail queueing schemes out there. The one I am currently using, a wrapper for smtpmail, was recently posted to gnu.emacs.sources. It would be *really* nice to have something like this for news. LMI> 3) nnsoup. Using soup is quite fiddly, but it basically seems to LMI> work. Like #1, yes on Unix. I have been demonstrably unsuccessful in getting nnsoup to work on my Windows 95 machine, most probably due to the poor handling of I/O streams in the console mode API. [...] LMI> So -- I propose writing a new backend for Gnus provide similar LMI> functionality. I don't know what to call it (nnoff? nnoffline? I LMI> don't really like the word "offline".), but I'm sure that someone will LMI> come up with a good name. Right? nntpol, since this will basically be nntp with off-line extensions. I suggest a merger between nntp.el and nnml.el. This "new" backend will use nntp's code to slurp news from the server and nnml's code to store and read it locally. For outgoing mail we need smtpmail.el (which is distributed with GNU Emacs, now) and smtpmail_delay (or smtpmailq, as I prefer), which is a simpler setup than feedmail. For outgoing news, message-post-method (or whatever) should be pointed at a queueing function, and then a "foo-post-queued-news-now" function (which can be added to whatever desired exit hooks or invoked manually) which processes the queue. Here is a slightly modified version of smtpmailq.el: ; $Id: smtpmail_delay.el,v 1.3 1997/01/11 15:13:17 gko Exp $ ; Georges KO gko@mail.net.tw (require 'smtpmail) (require 'mailalias) (require 'time-stamp) (defvar smtpmail-delay-popout-dir "~/Mail/queue/") (defvar smtpmail-delay-popout-index-file "index") ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defvar smtpmail-delay-popout-index (concat smtpmail-delay-popout-dir smtpmail-delay-popout-index-file)) (defun smtpmail-queue-it () "Hacked version of smtpmail-send-it: stores the message in a file in smtpmail-delay-popout-dir and updates smtpmail-delay-popout-index." (require 'mail-utils) (let ((errbuf (if mail-interactive (generate-new-buffer " smtpmail errors") 0)) (tembuf (generate-new-buffer " smtpmail temp")) (case-fold-search nil) resend-to-addresses delimline (mailbuf (current-buffer))) (unwind-protect (save-excursion (set-buffer tembuf) (erase-buffer) (insert-buffer-substring mailbuf) (goto-char (point-max)) ;; require one newline at the end. (or (= (preceding-char) ?\n) (insert ?\n)) ;; Change header-delimiter to be what sendmail expects. (goto-char (point-min)) (re-search-forward (concat "^" (regexp-quote mail-header-separator) "\n")) (replace-match "\n") (backward-char 1) (setq delimline (point-marker)) ;; (sendmail-synch-aliases) (if mail-aliases (expand-mail-aliases (point-min) delimline)) (goto-char (point-min)) ;; ignore any blank lines in the header (while (and (re-search-forward "\n\n\n*" delimline t) (< (point) delimline)) (replace-match "\n")) (let ((case-fold-search t)) (goto-char (point-min)) (goto-char (point-min)) (while (re-search-forward "^Resent-to:" delimline t) (setq resend-to-addresses (save-restriction (narrow-to-region (point) (save-excursion (end-of-line) (point))) (append (mail-parse-comma-list) resend-to-addresses)))) ;; Don't send out a blank subject line (goto-char (point-min)) (if (re-search-forward "^Subject:[ \t]*\n" delimline t) (replace-match "")) ;; Put the "From:" field in unless for some odd reason ;; they put one in themselves. (goto-char (point-min)) (if (not (re-search-forward "^From:" delimline t)) (let* ((login user-mail-address) (fullname (user-full-name))) (cond ((eq mail-from-style 'angles) (insert "From: " fullname) (let ((fullname-start (+ (point-min) 6)) (fullname-end (point-marker))) (goto-char fullname-start) ;; Look for a character that cannot appear unquoted ;; according to RFC 822. (if (re-search-forward "[^- !#-'*+/-9=?A-Z^-~]" fullname-end 1) (progn ;; Quote fullname, escaping specials. (goto-char fullname-start) (insert "\"") (while (re-search-forward "[\"\\]" fullname-end 1) (replace-match "\\\\\\&" t)) (insert "\"")))) (insert " <" login ">\n")) ((eq mail-from-style 'parens) (insert "From: " login " (") (let ((fullname-start (point))) (insert fullname) (let ((fullname-end (point-marker))) (goto-char fullname-start) ;; RFC 822 says \ and nonmatching parentheses ;; must be escaped in comments. ;; Escape every instance of ()\ ... (while (re-search-forward "[()\\]" fullname-end 1) (replace-match "\\\\\\&" t)) ;; ... then undo escaping of matching parentheses, ;; including matching nested parentheses. (goto-char fullname-start) (while (re-search-forward "\\(\\=\\|[^\\]\\(\\\\\\\\\\)*\\)\\\\(\\(\\([^\\]\\|\\\\\\\\\\)*\\)\\\\)" fullname-end 1) (replace-match "\\1(\\3)" t) (goto-char fullname-start)))) (insert ")\n")) ((null mail-from-style) (insert "From: " login "\n"))))) ;; Insert an extra newline if we need it to work around ;; Sun's bug that swallows newlines. (goto-char (1+ delimline)) (if (eval mail-mailer-swallows-blank-line) (newline)) ;; Find and handle any FCC fields. (goto-char (point-min)) (if (re-search-forward "^FCC:" delimline t) (mail-do-fcc delimline)) (if mail-interactive (save-excursion (set-buffer errbuf) (erase-buffer)))) ;; ;; ;; (setq smtpmail-address-buffer (generate-new-buffer "*smtp-mail*")) (setq smtpmail-recipient-address-list (or resend-to-addresses (smtpmail-deduce-address-list tembuf (point-min) delimline))) (kill-buffer smtpmail-address-buffer) (smtpmail-do-bcc delimline) ;;;;;;;;;;; Above is the same as smtpmail-send-it ;;;;;;;;;;;;;;;; ;;; Put everything in queue (let* ((file-data (concat smtpmail-delay-popout-dir (time-stamp-strftime "%02y%02m%02d-%02H%02M%02S"))) (file-elisp (concat file-data ".el")) (buffer-data (create-file-buffer file-data)) (buffer-elisp (create-file-buffer file-elisp))) (save-excursion (set-buffer buffer-data) (erase-buffer) (insert-buffer tembuf) (write-file file-data) (set-buffer buffer-elisp) (erase-buffer) (insert (concat "(setq smtpmail-recipient-address-list '" (prin1-to-string smtpmail-recipient-address-list) ")\n")) (write-file file-elisp) (set-buffer (generate-new-buffer "*popout*")) (insert (concat file-data "\n")) (append-to-file (point-min) (point-max) smtpmail-delay-popout-index) )))))) (defun smtpmail-send-queued-mail-now () "Sends messages queued by smtpmail-queue-it." (interactive) ;;; Get index, take first file, send message, take second file, etc... (let ((buffer-index (find-file-noselect smtpmail-delay-popout-index)) (file-msg "") (tembuf nil)) (save-excursion (set-buffer buffer-index) (beginning-of-buffer) (while (not (eobp)) (setq file-msg (buffer-substring (point) (save-excursion (end-of-line) (point)))) (load file-msg) (setq tembuf (find-file-noselect file-msg)) (if (not (null smtpmail-recipient-address-list)) (if (not (smtpmail-via-smtp smtpmail-recipient-address-list tembuf)) (error "Sending failed; SMTP protocol error")) (error "Sending failed; no recipients")) (delete-file file-msg) (delete-file (concat file-msg ".el")) (kill-buffer tembuf) (kill-line 1)) (set-buffer buffer-index) (save-buffer smtpmail-delay-popout-index) ))) -----BEGIN PGP SIGNATURE----- Version: 2.6.3a Charset: noconv iQCVAwUBMuOMmJ6VRH7BJMxHAQEt6QP/SIU6b5bxNiUQlExiLNJhcNQjl/tc2oPy fxLuFuPqmbxBJ5NB2tIPCaNTjKwLP63XSdzxbwxPyInObgom9ydZ5h6ufu9yHWCl a8VIowD+g6aUeR4Ie17ULYHOqtTD1NPOFl+gwIRS1mAoxWsM9NtOg2yIa2VFpXOp /oahHisP5mw= =+InJ -----END PGP SIGNATURE----- -- Rich Pieri | Do not taunt Happy Fun Ball. Prescient Technologies, Inc. | A Stone & Webster Company | I speak for myself, not PTI or SWEC |