From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/9809 Path: main.gmane.org!not-for-mail From: Daniel Simms Newsgroups: gmane.emacs.gnus.general Subject: Re: pop mailboxes Date: 04 Feb 1997 15:55:52 -0800 Sender: dsimms@ba.alink.net Message-ID: References: NNTP-Posting-Host: coloc-standby.netfonds.no X-Trace: main.gmane.org 1035149778 20699 80.91.224.250 (20 Oct 2002 21:36:18 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 20 Oct 2002 21:36:18 +0000 (UTC) Cc: ding@ifi.uio.no Return-Path: Original-Received: from ifi.uio.no (0@ifi.uio.no [129.240.64.2]) by deanna.miranova.com (8.8.5/8.8.5) with SMTP id QAA13478 for ; Tue, 4 Feb 1997 16:26:59 -0800 Original-Received: from alink.net (ns.alink.net [207.135.127.66]) by ifi.uio.no with ESMTP (8.6.11/ifi2.4) id ; Wed, 5 Feb 1997 00:56:44 +0100 Original-Received: from yoyo.alink.net (dsimms@ba.alink.net [207.135.127.69]) by alink.net (8.8.0/8.7.3) with SMTP id PAA08357; Tue, 4 Feb 1997 15:56:42 -0800 Original-To: Lars Magne Ingebrigtsen In-Reply-To: Lars Magne Ingebrigtsen's message of 05 Feb 1997 00:13:38 +0100 Original-Lines: 135 X-Mailer: Red Gnus v0.82/Emacs 19.34 Xref: main.gmane.org gmane.emacs.gnus.general:9809 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:9809 >>>>> "LMI" == Lars Magne Ingebrigtsen writes: >> ; >> file-directory-p("po:pop.alink.net:110:apop:n:dsimms%alink.net:*") LMI> This isn't a valid value from `nnmail-spool-file'. It should LMI> be just "po:username". Yes, yes*, it does the same thing with just po:luser too. * I also have a less creative nnmail-movemail-program: (setq nnmail-movemail-program 'pop3-really-movemail) (require 'pop3) (defun pop3-split (regexp string) (let (list last-match) (store-match-data nil) (while (string-match regexp string (setq last-match (match-end 0))) (setq list (cons (substring string (or last-match 0) (match-beginning 0))list))) (setq list (cons (substring string (or last-match 0) nil) list)) (nreverse list))) (defvar pop3-pop-passwords nil "stupid list to keep track of passwords") (defun pop3-really-movemail (pop-maildrop pop-crashbox) "example pop-maildrop spec \"po;pop.alink.net;110;apop;n;dsimms;*\"" (let* ((md-list (cdr (pop3-split ";" pop-maildrop))) ;(md-list (pop3-split ";" (nth 1 (pop3-split ":" pop-maildrop)))) (pop3-save-password nil) (pop3-mailhost (nth 0 md-list)) (pop3-port (nth 1 md-list)) (pop3-authentication-scheme (intern (nth 2 md-list))) (pop3-leave-mail-on-server (string= "y" (nth 3 md-list))) (pop3-maildrop (nth 4 md-list)) (pop3-password (nth 5 md-list)) (pop3-password-required t) (pop3-timestamp nil) (pop3-crashbox pop-crashbox)) (cond ((or (string= "*" pop3-password) (string= "" pop3-password)) (setq pop3-password (cadr (assoc pop-maildrop pop3-pop-passwords))) (setq pop3-save-password (not pop3-password)))) (setq pop3-port (or (string-to-number pop3-port) pop3-port)) (let ((retval (pop3-movemail pop3-crashbox))) (if (and retval pop3-save-password) (setq pop3-pop-passwords (cons (list pop-maildrop pop3-password) pop3-pop-passwords))) retval))) and you tweaked your pop3.el, a bit: *** pop3.el.~1~ Sun Jan 5 00:49:42 1997 --- pop3.el Tue Feb 4 15:53:25 1997 *************** *** 46,51 **** --- 46,55 ---- "*POP3 mailhost.") (defvar pop3-port 110 "*POP3 port.") + (defvar pop3-leave-mail-on-server nil + "*POP3 DELE after RETR.") + (defvar pop3-save-password nil + "*POP3 save password after successful authorization.") (defvar pop3-password-required t "*Non-nil if a password is required when connecting to POP server.") *************** *** 86,92 **** (save-excursion (set-buffer crashbuf) (append-to-file (point-min) (point-max) crashbox)) ! (pop3-dele process n) (setq n (+ 1 n))) (pop3-quit process) (kill-buffer crashbuf) --- 90,96 ---- (save-excursion (set-buffer crashbuf) (append-to-file (point-min) (point-max) crashbox)) ! (if (not pop3-leave-mail-on-server) (pop3-dele process n)) (setq n (+ 1 n))) (pop3-quit process) (kill-buffer crashbuf) *************** *** 250,257 **** (progn (pop3-send-command process (format "PASS %s" pass)) (let ((response (pop3-read-response process t))) ! (if (not (and response (string-match "+OK" response))) ! (pop3-quit process))))) )) (defun pop3-apop (process user) --- 254,262 ---- (progn (pop3-send-command process (format "PASS %s" pass)) (let ((response (pop3-read-response process t))) ! (if (and response (string-match "+OK" response)) ! (progn (if pop3-save-password (setq pop3-password pass)) t) ! (pop3-quit process))))) )) (defun pop3-apop (process user) *************** *** 265,272 **** (let ((hash (md5 (concat pop3-timestamp pass)))) (pop3-send-command process (format "APOP %s %s" user hash)) (let ((response (pop3-read-response process t))) ! (if (not (and response (string-match "+OK" response))) ! (pop3-quit process))))) )) ;; TRANSACTION STATE --- 270,278 ---- (let ((hash (md5 (concat pop3-timestamp pass)))) (pop3-send-command process (format "APOP %s %s" user hash)) (let ((response (pop3-read-response process t))) ! (if (and response (string-match "+OK" response)) ! (progn (if pop3-save-password (setq pop3-password pass)) t) ! (pop3-quit process))))) )) ;; TRANSACTION STATE -- Daniel Simms "If ignorance is bliss, then dsimms@alink.net knock the smile off my face" (408) 720-6161 -"Freedom", RATM