[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Mon, 19 Jan 2004 13:46:34 +0200
GNU Mailutils finally has its implementation of movemail program. This
implementation supports both pop3 and imap4 protocols. It also supports
both traditional movemail command line syntax and usual GNU long options.
Attached is a patch to rmail.el that enables it to make use of the
additional movemail options. The diff was made against emacs version
21.3, but it applies to the CVS version as well.
--- /usr/src/emacs-21.3/lisp/mail/rmail.el Sat Jul 6 17:17:02 2002
+++ rmail.el Tue Dec 30 16:58:27 2003
@@ -130,7 +130,44 @@ rather than deleted, after it is retriev
+(defvar rmail-movemail-variant-in-use nil
+ "The movemail variant currently in use. Known variants are 'emacs (the
+default) and 'mailutils")
+(defun rmail-movemail-variant-p (&rest variants)
+ "Return t if the current movemail variant is any of VARIANTS.
+Currently known variants are 'emacs and 'mailutils."
+ (if (not rmail-movemail-variant-in-use)
+ ;; Autodetect
+ (setq rmail-movemail-variant-in-use
+ (setq errors (generate-new-buffer "*rmail autodetect*"))
+ (buffer-disable-undo errors)
+ (let ((args
+ (list (or rmail-movemail-program
+ (expand-file-name "movemail"
+ nil errors nil)
+ (list "--version"))))
+ (apply 'call-process args))
+ (if (not (buffer-modified-p errors))
+ ;; Should not happen...
+ (set-buffer errors)
+ (goto-char (point-min))
+ ((looking-at ".*movemail: invalid option")
+ 'emacs) ;; Possibly...
+ ((looking-at "movemail (GNU Mailutils .*)")
+ ;; FIXME:
+ (not (null (member rmail-movemail-variant-in-use variants))))
(defcustom rmail-dont-reply-to-names nil "\
*A regexp specifying names to prune of reply to messages.
A value of nil means exclude your own login name as an address
@@ -1467,7 +1504,9 @@ It returns t if it got any new messages.
;; Handle POP mailbox names specially; don't expand as filenames
;; in case the userid contains a directory separator.
(setq file (car files))
- (setq popmail (string-match "^po:" file))
+ (setq popmail (or (string-match "^po:" file)
+ (and (rmail-movemail-variant-p 'mailutils)
+ (string-match "pop://\\|imap://" file))))
(setq renamep t)
(setq file (file-truename
|[Prev in Thread]
||[Next in Thread]|
- Mailutils movemail,
Sergey Poznyakoff <=