Gnus development mailing list
 help / color / mirror / Atom feed
* Using qmail's maildir as mail-spool
@ 1996-11-06 23:08 Carsten Leonhardt
  1996-11-09  4:44 ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 2+ messages in thread
From: Carsten Leonhardt @ 1996-11-06 23:08 UTC (permalink / raw)



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

Hi people!

Some time ago I switched from smail to qmail. Qmail supports
delivering mails to a 'maildir' (a directory beneath the users
home-dir, containing three subdirs, 'tmp', 'cur' and 'new', new mails
are delivered into 'new', one file per mail). A "From "-style line is
*not* prepended to the mail. It seems to me that "Return-Path:" is
always the top header in the mail.

Today I gave 'maildir' a try. I had to patch nnmail.el to make things
work, and set (setq nnmail-movemail-program "/bin/mv") so that 0 byte
files aren't left behind in '<maildir>/new/' (using "mv" should be
perfectly safe, as qmail never accesses files in 'new' again after
delivery).

This is not extensively tested, but appears to work at my place.


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

*** nnmail.el	1996/11/06 20:03:23	1.1
--- nnmail.el	1996/11/06 21:44:24	1.3
***************
*** 783,788 ****
--- 783,823 ----
  	(goto-char end)
  	(forward-line 2)))))
  
+ ;; Added by Carsten Leonhardt <leo@arioch.tng.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:" 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.
***************
*** 812,817 ****
--- 847,854 ----
  	       (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 --]

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

* Re: Using qmail's maildir as mail-spool
  1996-11-06 23:08 Using qmail's maildir as mail-spool Carsten Leonhardt
@ 1996-11-09  4:44 ` Lars Magne Ingebrigtsen
  0 siblings, 0 replies; 2+ messages in thread
From: Lars Magne Ingebrigtsen @ 1996-11-09  4:44 UTC (permalink / raw)


Carsten Leonhardt <leo@arioch.tng.oche.de> writes:

> Today I gave 'maildir' a try. I had to patch nnmail.el to make things
> work, and set (setq nnmail-movemail-program "/bin/mv") so that 0 byte
> files aren't left behind in '<maildir>/new/' (using "mv" should be
> perfectly safe, as qmail never accesses files in 'new' again after
> delivery).

Hm.  I think I'll hold off on doing anything in this department until
the mail spool name thingie makeover has been done, which will be
after Gnus 5.4 has been released.

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@ifi.uio.no * Lars Ingebrigtsen


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

end of thread, other threads:[~1996-11-09  4:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-11-06 23:08 Using qmail's maildir as mail-spool Carsten Leonhardt
1996-11-09  4:44 ` Lars Magne Ingebrigtsen

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