Gnus development mailing list
 help / color / mirror / Atom feed
From: Carsten Leonhardt <leo@arioch.oche.de>
Subject: Re: Gnus and the qmail maildir format
Date: 23 Apr 1998 16:23:59 +0200	[thread overview]
Message-ID: <hhd8e8mxa8.fsf@arioch.arioch.oche.de> (raw)
In-Reply-To: patl@curl.com's message of "10 Apr 1998 13:30:32 -0400"


[-- Attachment #1.1: Type: text/plain, Size: 391 bytes --]

>>>>> "patl" == Patrick J LoPresti <patl@curl.com> writes:

patl> Since nobody else has volunteered to take up this task, I guess
patl> I will have to hack it up myself.

I hacked(!) up nnmail to support maildir fetching quite some time
ago. I use mv instead of movemail in connection with the patch,
because movemail leaves zero-byte files lying around.

I hope this inspires you :-)

leo


[-- Attachment #1.2: Type: text/plain, Size: 2135 bytes --]

*** nnmail.el.orig	Wed Apr  1 05:43:39 1998
--- nnmail.el	Fri Mar 20 01:57:52 1998
***************
*** 1006,1011 ****
--- 1006,1046 ----
  	(goto-char end)
  	(forward-line 2)))))
  
+ ;; Added by Carsten Leonhardt <leo@arioch.oche.de>.
+ (defun nnmail-process-maildir-mail-format (func artnum-func)
+ ; In qmail's maildir directory, every file contains exactly one mail
+   (let ((case-fold-search t)
+ 	message-id)
+     (goto-char (point-min))
+     ;; Find the end of the head.
+     (narrow-to-region
+      (point-min) 
+      (if (search-forward "\n\n" nil t)
+ 	 (1- (point))
+        ;; This will never happen, but just to be on the safe side --
+        ;; if there is no head-body delimiter, we search a bit manually.
+        (while (and (looking-at "From \\|[^ \t]+:")
+ 		   (not (eobp)))
+ 	 (forward-line 1)
+ 	 (point))))
+     ;; Find the Message-ID header.
+     (goto-char (point-min))
+     (if (re-search-forward "^Message-ID:[ \t]*\\(<[^>]+>\\)" nil t)
+ 	(setq message-id (match-string 1))
+       ;; There is no Message-ID here, so we create one.
+       (save-excursion
+ 	    (when (re-search-backward "^Message-ID[ \t]*:" nil t)
+ 	  (beginning-of-line)
+ 	  (insert "Original-")))
+       (forward-line 1)
+       (insert "Message-ID: " (setq message-id (nnmail-message-id)) "\n"))
+     (run-hooks 'nnmail-prepare-incoming-header-hook)
+     ;; Allow the backend to save the article.
+     (widen)
+     (save-excursion
+ 	(goto-char (point-min))
+ 	(nnmail-check-duplication message-id func artnum-func))))
+ 
  (defun nnmail-split-incoming (incoming func &optional exit-func
  				       group artnum-func)
    "Go through the entire INCOMING file and pick out each individual mail.
***************
*** 1035,1040 ****
--- 1070,1077 ----
  	       (nnmail-process-babyl-mail-format func artnum-func))
  	      ((looking-at "\^A\^A\^A\^A")
  	       (nnmail-process-mmdf-mail-format func artnum-func))
+ 	      ((looking-at "Return-Path:")
+ 	       (nnmail-process-maildir-mail-format func artnum-func))
  	      (t
  	       (nnmail-process-unix-mail-format func artnum-func))))
        (when exit-func

[-- Attachment #2: Type: application/pgp-signature, Size: 460 bytes --]

  parent reply	other threads:[~1998-04-23 14:23 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <m3wwddekkx.fsf@toyland.sauerland.de>
     [not found] ` <x7u38e28hc.fsf@gkar.prescienttech.com>
1998-04-08 19:28   ` Patrick J. LoPresti
1998-04-08 21:18     ` Istvan Marko
1998-04-10 17:30       ` Patrick J. LoPresti
1998-04-10 18:39         ` Kai Grossjohann
     [not found]           ` <x7ra339ho5.fsf@peorth.gweep.net>
1998-04-12 16:18             ` Alan Shutko
1998-04-23 14:23         ` Carsten Leonhardt [this message]
     [not found]           ` <x77m4gnsjs.fsf@peorth.gweep.net>
1998-04-24  8:02             ` Robert Bihlmeyer
1998-04-25 16:04               ` Patrick J. LoPresti
1998-04-27 20:48                 ` Dan Christensen
1998-04-28  0:59                   ` Patrick J. LoPresti
1998-04-24 20:08         ` Lars Magne Ingebrigtsen

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=hhd8e8mxa8.fsf@arioch.arioch.oche.de \
    --to=leo@arioch.oche.de \
    /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).