Gnus development mailing list
 help / color / mirror / Atom feed
From: Adam W <adam_w67@yahoo.com>
To: "larsi@gnus.org" <larsi@gnus.org>
Cc: "ding@gnus.org" <ding@gnus.org>
Subject: maildir and ssh
Date: Tue, 22 Nov 2011 20:07:07 +0000 (GMT)	[thread overview]
Message-ID: <1321992427.10810.YahooMailNeo@web29910.mail.ird.yahoo.com> (raw)



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?




             reply	other threads:[~2011-11-22 20:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-22 20:07 Adam W [this message]
2011-11-23 18:52 ` Adam
2011-11-24  0:13 ` Katsumi Yamaoka
2011-11-24  5:32   ` Michael Albinus

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=1321992427.10810.YahooMailNeo@web29910.mail.ird.yahoo.com \
    --to=adam_w67@yahoo.com \
    --cc=ding@gnus.org \
    --cc=larsi@gnus.org \
    /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).