Gnus development mailing list
 help / color / mirror / Atom feed
* maildir and ssh
@ 2011-11-22 20:07 Adam W
  2011-11-23 18:52 ` Adam
  2011-11-24  0:13 ` Katsumi Yamaoka
  0 siblings, 2 replies; 4+ messages in thread
From: Adam W @ 2011-11-22 20:07 UTC (permalink / raw)
  To: larsi; +Cc: ding



Hey,

I found a bug in gnus.  In mail-source.el, mail-source-fetch-dir there
is a call to delete-file.  Gnus checks this call to return non-nil.
When using a remote ssh maildir via ssh, delete-file returns nil though.

Here is the fixed function:

(defun mail-source-fetch-maildir (source callback)
  "Fetcher for maildir sources."
  (mail-source-bind (maildir source)
    (let ((found 0)
      mail-source-string)
      (unless (string-match "/$" path)
    (setq path (concat path "/")))
      (dolist (subdir subdirs)
    (when (file-directory-p (concat path subdir))
      (setq mail-source-string (format "maildir:%s%s" path subdir))
      (dolist (file (directory-files (concat path subdir) t))
        (when (and (not (file-directory-p file))
               (not (if function
                (funcall function file mail-source-crash-box)
                  (let ((coding-system-for-write
                     mm-text-coding-system)
                    (coding-system-for-read
                     mm-text-coding-system))
                (with-temp-file mail-source-crash-box
                  (insert-file-contents file)
                  (goto-char (point-min))
;;;               ;; Unix mail format
;;;               (unless (looking-at "\n*From ")
;;;                 (insert "From maildir "
;;;                     (current-time-string) "\n"))
;;;               (while (re-search-forward "^From " nil t)
;;;                 (replace-match ">From "))
;;;               (goto-char (point-max))
;;;               (insert "\n\n")
                  ;; MMDF mail format
                  (insert "\001\001\001\001\n"))
                (delete-file file)
                nil))))
          (incf found (mail-source-callback callback file))
          (mail-source-delete-crash-box)))))
      found)))

Any chance you could incorporate this in gnus?




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-11-24  5:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-22 20:07 maildir and ssh Adam W
2011-11-23 18:52 ` Adam
2011-11-24  0:13 ` Katsumi Yamaoka
2011-11-24  5:32   ` Michael Albinus

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).