1 |
;;; nnmail.el --- mail support functions for the Gnus mail backends |
;;; nnmail.el --- mail support functions for the Gnus mail backends |
2 |
;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000 |
;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2002 |
3 |
;; Free Software Foundation, Inc. |
;; Free Software Foundation, Inc. |
4 |
|
|
5 |
;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org> |
;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org> |
56 |
:group 'nnmail) |
:group 'nnmail) |
57 |
|
|
58 |
(defgroup nnmail-split nil |
(defgroup nnmail-split nil |
59 |
"Organizing the incomming mail in folders." |
"Organizing the incoming mail in folders." |
60 |
:group 'nnmail) |
:group 'nnmail) |
61 |
|
|
62 |
(defgroup nnmail-files nil |
(defgroup nnmail-files nil |
316 |
GROUP: Mail will be stored in GROUP (a string). |
GROUP: Mail will be stored in GROUP (a string). |
317 |
|
|
318 |
\(FIELD VALUE [- RESTRICT [- RESTRICT [...]]] SPLIT): If the message |
\(FIELD VALUE [- RESTRICT [- RESTRICT [...]]] SPLIT): If the message |
319 |
field FIELD (a regexp) contains VALUE (a regexp), store the messages |
field FIELD (a regexp) contains VALUE (a regexp), store the messages |
320 |
as specified by SPLIT. If RESTRICT (a regexp) matches some string |
as specified by SPLIT. If RESTRICT (a regexp) matches some string |
321 |
after FIELD and before the end of the matched VALUE, return nil, |
after FIELD and before the end of the matched VALUE, return nil, |
322 |
otherwise process SPLIT. Multiple RESTRICTs add up, further |
otherwise process SPLIT. Multiple RESTRICTs add up, further |
364 |
(any \"procmail@informatik\\\\.rwth-aachen\\\\.de\" \"procmail.list\") |
(any \"procmail@informatik\\\\.rwth-aachen\\\\.de\" \"procmail.list\") |
365 |
(any \"SmartList@informatik\\\\.rwth-aachen\\\\.de\" \"SmartList.list\") |
(any \"SmartList@informatik\\\\.rwth-aachen\\\\.de\" \"SmartList.list\") |
366 |
;; Both lists below have the same suffix, so prevent |
;; Both lists below have the same suffix, so prevent |
367 |
;; cross-posting to mkpkg.list of messages posted only to |
;; cross-posting to mkpkg.list of messages posted only to |
368 |
;; the bugs- list, but allow cross-posting when the |
;; the bugs- list, but allow cross-posting when the |
369 |
;; message was really cross-posted. |
;; message was really cross-posted. |
370 |
(any \"bugs-mypackage@somewhere\" \"mypkg.bugs\") |
(any \"bugs-mypackage@somewhere\" \"mypkg.bugs\") |
371 |
(any \"mypackage@somewhere\" - \"bugs-mypackage\" \"mypkg.list\") |
(any \"mypackage@somewhere\" - \"bugs-mypackage\" \"mypkg.list\") |
372 |
;; |
;; |
373 |
;; People... |
;; People... |
374 |
(any \"larsi@ifi\\\\.uio\\\\.no\" \"people.Lars Magne Ingebrigtsen\")) |
(any \"larsi@ifi\\\\.uio\\\\.no\" \"people.Lars Magne Ingebrigtsen\")) |
375 |
;; Unmatched mail goes to the catch all group. |
;; Unmatched mail goes to the catch all group. |
467 |
"Coding system used in reading inbox") |
"Coding system used in reading inbox") |
468 |
|
|
469 |
(defvar nnmail-pathname-coding-system nil |
(defvar nnmail-pathname-coding-system nil |
470 |
"*Coding system for pathname.") |
"*Coding system for file name.") |
471 |
|
|
472 |
(defun nnmail-find-file (file) |
(defun nnmail-find-file (file) |
473 |
"Insert FILE in server buffer safely." |
"Insert FILE in server buffer safely." |
484 |
(file-error nil)))) |
(file-error nil)))) |
485 |
|
|
486 |
(defun nnmail-group-pathname (group dir &optional file) |
(defun nnmail-group-pathname (group dir &optional file) |
487 |
"Make pathname for GROUP." |
"Make file name for GROUP." |
488 |
(concat |
(concat |
489 |
(let ((dir (file-name-as-directory (expand-file-name dir)))) |
(let ((dir (file-name-as-directory (expand-file-name dir)))) |
490 |
(setq group (nnheader-replace-duplicate-chars-in-string |
(setq group (nnheader-replace-duplicate-chars-in-string |
760 |
(setq head-end (point)) |
(setq head-end (point)) |
761 |
;; We try the Content-Length value. The idea: skip over the header |
;; We try the Content-Length value. The idea: skip over the header |
762 |
;; separator, then check what happens content-length bytes into the |
;; separator, then check what happens content-length bytes into the |
763 |
;; message body. This should be either the end ot the buffer, the |
;; message body. This should be either the end of the buffer, the |
764 |
;; message separator or a blank line followed by the separator. |
;; message separator or a blank line followed by the separator. |
765 |
;; The blank line should probably be deleted. If neither of the |
;; The blank line should probably be deleted. If neither of the |
766 |
;; three is met, the content-length header is probably invalid. |
;; three is met, the content-length header is probably invalid. |
1047 |
(let (lines chars) |
(let (lines chars) |
1048 |
(save-excursion |
(save-excursion |
1049 |
(goto-char (point-min)) |
(goto-char (point-min)) |
1050 |
(unless (search-forward "\n\n" nil t) |
(unless (search-forward "\n\n" nil t) |
1051 |
(goto-char (point-max)) |
(goto-char (point-max)) |
1052 |
(insert "\n")) |
(insert "\n")) |
1053 |
(setq chars (- (point-max) (point))) |
(setq chars (- (point-max) (point))) |