Gnus development mailing list
 help / color / mirror / Atom feed
From: Daniel Simms <dsimms@alink.net>
Cc: ding@ifi.uio.no
Subject: Re: pop mailboxes
Date: 04 Feb 1997 15:55:52 -0800	[thread overview]
Message-ID: <x54tfsunw7.fsf@ba.alink.net> (raw)
In-Reply-To: Lars Magne Ingebrigtsen's message of 05 Feb 1997 00:13:38 +0100

>>>>> "LMI" == Lars Magne Ingebrigtsen <larsi@ifi.uio.no> 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


  reply	other threads:[~1997-02-04 23:55 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-02-03 23:32 Daniel Simms
1997-02-04 19:41 ` Lars Magne Ingebrigtsen
1997-02-04 23:00   ` Daniel Simms
1997-02-04 23:13     ` Lars Magne Ingebrigtsen
1997-02-04 23:55       ` Daniel Simms [this message]
1997-02-05  1:41         ` Lars Magne Ingebrigtsen
1997-02-05  5:03           ` Paul Franklin
1997-02-05  9:01           ` Daniel Simms
1997-02-05  3:08         ` Rich Pieri
1997-02-05  8:35           ` Daniel Simms
1997-02-05 16:13             ` Rich Pieri
1997-02-05  4:50         ` Paul Franklin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=x54tfsunw7.fsf@ba.alink.net \
    --to=dsimms@alink.net \
    --cc=ding@ifi.uio.no \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).