1 ;;; nnml.el --- mail spool access for Gnus
3 ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
4 ;; 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
6 ;; Authors: Didier Verna <didier@xemacs.org> (adding compaction)
7 ;; Simon Josefsson <simon@josefsson.org> (adding MARKS)
8 ;; Lars Magne Ingebrigtsen <larsi@gnus.org>
9 ;; Masanobu UMEDA <umerin@flab.flab.fujitsu.junet>
10 ;; Keywords: news, mail
12 ;; This file is part of GNU Emacs.
14 ;; GNU Emacs is free software: you can redistribute it and/or modify
15 ;; it under the terms of the GNU General Public License as published by
16 ;; the Free Software Foundation, either version 3 of the License, or
17 ;; (at your option) any later version.
19 ;; GNU Emacs is distributed in the hope that it will be useful,
20 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
21 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 ;; GNU General Public License for more details.
24 ;; You should have received a copy of the GNU General Public License
25 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
29 ;; Based on nnspool.el by Masanobu UMEDA <umerin@flab.flab.fujitsu.junet>.
30 ;; For an overview of what the interface functions do, please see the
39 (eval-when-compile (require 'cl))
41 ;; FIXME first is unused in this file.
42 (autoload 'gnus-article-unpropagatable-p "gnus-sum")
43 (autoload 'gnus-backlog-remove-article "gnus-bcklg")
47 (defvoo nnml-directory message-directory
48 "Spool directory for the nnml mail backend.")
50 (defvoo nnml-active-file
51 (expand-file-name "active" nnml-directory)
54 (defvoo nnml-newsgroups-file
55 (expand-file-name "newsgroups" nnml-directory)
56 "Mail newsgroups description file.")
58 (defvoo nnml-get-new-mail t
59 "If non-nil, nnml will check the incoming mail file and split the mail.")
61 (defvoo nnml-nov-is-evil nil
62 "If non-nil, Gnus will never generate and use nov databases for mail spools.
63 Using nov databases will speed up header fetching considerably.
64 This variable shouldn't be flipped much. If you have, for some reason,
65 set this to t, and want to set it to nil again, you should always run
66 the `nnml-generate-nov-databases' command. The function will go
67 through all nnml directories and generate nov databases for them
68 all. This may very well take some time.")
70 (defvoo nnml-marks-is-evil nil
71 "If non-nil, Gnus will never generate and use marks file for mail spools.
72 Using marks files makes it possible to backup and restore mail groups
73 separately from `.newsrc.eld'. If you have, for some reason, set this
74 to t, and want to set it to nil again, you should always remove the
75 corresponding marks file (usually named `.marks' in the nnml group
76 directory, but see `nnml-marks-file-name') for the group. Then the
77 marks file will be regenerated properly by Gnus.")
79 (defvoo nnml-prepare-save-mail-hook nil
80 "Hook run narrowed to an article before saving.")
82 (defvoo nnml-inhibit-expiry nil
83 "If non-nil, inhibit expiry.")
85 (defvoo nnml-use-compressed-files nil
86 "If non-nil, allow using compressed message files.
88 If it is a string, use it as the file extension which specifies
89 the compression program. You can set it to \".bz2\" if your Emacs
90 supports auto-compression using the bzip2 program. A value of t
91 is equivalent to \".gz\".")
93 (defvoo nnml-compressed-files-size-threshold 1000
94 "Default size threshold for compressed message files.
95 Message files with bodies larger than that many characters will
96 be automatically compressed if `nnml-use-compressed-files' is
101 (defconst nnml-version "nnml 1.0"
104 (defvoo nnml-nov-file-name ".overview")
105 (defvoo nnml-marks-file-name ".marks")
107 (defvoo nnml-current-directory nil)
108 (defvoo nnml-current-group nil)
109 (defvoo nnml-status-string "")
110 (defvoo nnml-nov-buffer-alist nil)
111 (defvoo nnml-group-alist nil)
112 (defvoo nnml-active-timestamp nil)
113 (defvoo nnml-article-file-alist nil)
115 (defvoo nnml-generate-active-function 'nnml-generate-active-info)
117 (defvar nnml-nov-buffer-file-name nil)
119 (defvoo nnml-file-coding-system nnmail-file-coding-system)
121 (defvoo nnml-marks nil)
123 (defvar nnml-marks-modtime (gnus-make-hashtable))
126 ;;; Interface functions.
128 (nnoo-define-basics nnml)
131 (defsubst nnml-group-name-charset (group server-or-method)
132 (gnus-group-name-charset
133 (if (stringp server-or-method)
134 (gnus-server-to-method
135 (if (string-match "\\+" server-or-method)
136 (concat (substring server-or-method 0 (match-beginning 0))
137 ":" (substring server-or-method (match-end 0)))
138 (concat "nnml:" server-or-method)))
139 (or server-or-method gnus-command-method '(nnml "")))
142 (defun nnml-decoded-group-name (group &optional server-or-method)
143 "Return a decoded group name of GROUP on SERVER-OR-METHOD."
144 (if nnmail-group-names-not-encoded-p
146 (mm-decode-coding-string
148 (nnml-group-name-charset group server-or-method))))
150 (defun nnml-encoded-group-name (group &optional server-or-method)
151 "Return an encoded group name of GROUP on SERVER-OR-METHOD."
152 (mm-encode-coding-string
154 (nnml-group-name-charset group server-or-method)))
156 (defun nnml-group-pathname (group &optional file server)
157 "Return an absolute file name of FILE for GROUP on SERVER."
158 (nnmail-group-pathname (inline (nnml-decoded-group-name group server))
159 nnml-directory file))
161 (deffoo nnml-retrieve-headers (sequence &optional group server fetch-old)
162 (when (nnml-possibly-change-directory group server)
163 (with-current-buffer nntp-server-buffer
166 (number (length sequence))
168 (file-name-coding-system nnmail-pathname-coding-system)
170 (if (stringp (car sequence))
172 (if (nnml-retrieve-headers-with-nov sequence fetch-old)
175 (setq article (car sequence))
176 (setq file (nnml-article-to-file article))
179 (not (file-directory-p file)))
180 (insert (format "221 %d Article retrieved.\n" article))
182 (nnheader-insert-head file)
184 (if (re-search-forward "\n\r?\n" nil t)
186 (goto-char (point-max))
189 (delete-region (point) (point-max)))
190 (setq sequence (cdr sequence))
191 (setq count (1+ count))
192 (and (numberp nnmail-large-newsgroup)
193 (> number nnmail-large-newsgroup)
195 (nnheader-message 6 "nnml: Receiving headers... %d%%"
196 (/ (* count 100) number))))
198 (and (numberp nnmail-large-newsgroup)
199 (> number nnmail-large-newsgroup)
200 (nnheader-message 6 "nnml: Receiving headers...done"))
202 (nnheader-fold-continuation-lines)
205 (deffoo nnml-open-server (server &optional defs)
206 (nnoo-change-server 'nnml server defs)
207 (when (not (file-exists-p nnml-directory))
208 (ignore-errors (make-directory nnml-directory t)))
210 ((not (file-exists-p nnml-directory))
212 (nnheader-report 'nnml "Couldn't create directory: %s" nnml-directory))
213 ((not (file-directory-p (file-truename nnml-directory)))
215 (nnheader-report 'nnml "Not a directory: %s" nnml-directory))
217 (nnheader-report 'nnml "Opened server %s using directory %s"
218 server nnml-directory)
221 (deffoo nnml-request-regenerate (server)
222 (nnml-possibly-change-directory nil server)
223 (nnml-generate-nov-databases server)
226 (deffoo nnml-request-article (id &optional group server buffer)
227 (nnml-possibly-change-directory group server)
228 (let* ((nntp-server-buffer (or buffer nntp-server-buffer))
229 (file-name-coding-system nnmail-pathname-coding-system)
230 path gpath group-num)
232 (when (and (setq group-num (nnml-find-group-number id server))
234 (assq (cdr group-num)
235 (nnheader-article-to-file-alist
236 (setq gpath (nnml-group-pathname (car group-num)
238 (setq path (concat gpath (int-to-string (cdr group-num)))))
239 (setq path (nnml-article-to-file id)))
242 (nnheader-report 'nnml "No such article: %s" id))
243 ((not (file-exists-p path))
244 (nnheader-report 'nnml "No such file: %s" path))
245 ((file-directory-p path)
246 (nnheader-report 'nnml "File is a directory: %s" path))
247 ((not (save-excursion (let ((nnmail-file-coding-system
248 nnml-file-coding-system))
249 (nnmail-find-file path))))
250 (nnheader-report 'nnml "Couldn't read file: %s" path))
252 (nnheader-report 'nnml "Article %s retrieved" id)
253 ;; We return the article number.
254 (cons (if group-num (car group-num) group)
255 (string-to-number (file-name-nondirectory path)))))))
257 (deffoo nnml-request-group (group &optional server dont-check info)
258 (let ((file-name-coding-system nnmail-pathname-coding-system)
259 (decoded (nnml-decoded-group-name group server)))
261 ((not (nnml-possibly-change-directory group server))
262 (nnheader-report 'nnml "Invalid group (no such directory)"))
263 ((not (file-exists-p nnml-current-directory))
264 (nnheader-report 'nnml "Directory %s does not exist"
265 nnml-current-directory))
266 ((not (file-directory-p nnml-current-directory))
267 (nnheader-report 'nnml "%s is not a directory" nnml-current-directory))
269 (nnheader-report 'nnml "Group %s selected" decoded)
272 (nnheader-re-read-dir nnml-current-directory)
273 (nnmail-activate 'nnml)
274 (let ((active (nth 1 (assoc group nnml-group-alist))))
276 (nnheader-report 'nnml "No such group: %s" decoded)
277 (nnheader-report 'nnml "Selected group %s" decoded)
278 (nnheader-insert "211 %d %d %d %s\n"
279 (max (1+ (- (cdr active) (car active))) 0)
280 (car active) (cdr active) group)))))))
282 (deffoo nnml-request-scan (&optional group server)
283 (setq nnml-article-file-alist nil)
284 (nnml-possibly-change-directory group server)
285 (nnmail-get-new-mail 'nnml 'nnml-save-incremental-nov nnml-directory group))
287 (deffoo nnml-close-group (group &optional server)
288 (setq nnml-article-file-alist nil)
291 (deffoo nnml-request-create-group (group &optional server args)
292 (nnml-possibly-change-directory nil server)
293 (nnmail-activate 'nnml)
295 ((let ((file (directory-file-name (nnml-group-pathname group nil server)))
296 (file-name-coding-system nnmail-pathname-coding-system))
297 (and (file-exists-p file)
298 (not (file-directory-p file))))
299 (nnheader-report 'nnml "%s is a file"
300 (directory-file-name (nnml-group-pathname group
302 ((assoc group nnml-group-alist)
306 (push (list group (setq active (cons 1 0)))
308 (nnml-possibly-create-directory group server)
309 (nnml-possibly-change-directory group server)
310 (let* ((file-name-coding-system nnmail-pathname-coding-system)
311 (articles (nnml-directory-articles nnml-current-directory)))
313 (setcar active (apply 'min articles))
314 (setcdr active (apply 'max articles))))
315 (nnmail-save-active nnml-group-alist nnml-active-file)
318 (deffoo nnml-request-list (&optional server)
320 (let ((nnmail-file-coding-system nnmail-active-file-coding-system)
321 (file-name-coding-system nnmail-pathname-coding-system))
322 (nnmail-find-file nnml-active-file))
323 (setq nnml-group-alist (nnmail-get-active))
326 (deffoo nnml-request-newgroups (date &optional server)
327 (nnml-request-list server))
329 (deffoo nnml-request-list-newsgroups (&optional server)
331 (nnmail-find-file nnml-newsgroups-file)))
333 (deffoo nnml-request-expire-articles (articles group &optional server force)
334 (nnml-possibly-change-directory group server)
335 (let* ((file-name-coding-system nnmail-pathname-coding-system)
337 (nnml-directory-articles nnml-current-directory))
339 (decoded (nnml-decoded-group-name group server))
340 article rest mod-time number target)
341 (nnmail-activate 'nnml)
343 (setq active-articles (sort active-articles '<))
344 ;; Articles not listed in active-articles are already gone,
345 ;; so don't try to expire them.
346 (setq articles (gnus-sorted-intersection articles active-articles))
348 (while (and articles is-old)
349 (if (and (setq article (nnml-article-to-file
350 (setq number (pop articles))))
351 (setq mod-time (nth 5 (file-attributes article)))
352 (nnml-deletable-article-p group number)
353 (setq is-old (nnmail-expired-article-p group mod-time force
354 nnml-inhibit-expiry)))
356 ;; Allow a special target group.
357 (setq target nnmail-expiry-target)
358 (unless (eq target 'delete)
360 (nnml-request-article number group server (current-buffer))
361 (let (nnml-current-directory
363 nnml-article-file-alist)
364 (when (functionp target)
365 (setq target (funcall target group)))
366 (when (and target (not (eq target 'delete)))
367 (if (or (gnus-request-group target)
368 (gnus-request-create-group target))
369 (nnmail-expiry-target-group target group)
370 (setq target nil)))))
371 ;; Maybe directory is changed during nnmail-expiry-target-group.
372 (nnml-possibly-change-directory group server))
375 (nnheader-message 5 "Deleting article %s in %s"
378 (funcall nnmail-delete-file-function article)
381 (setq active-articles (delq number active-articles))
382 (nnml-nov-delete-article group number))
385 (let ((active (nth 1 (assoc group nnml-group-alist))))
387 (setcar active (or (and active-articles
388 (apply 'min active-articles))
390 (nnmail-save-active nnml-group-alist nnml-active-file))
392 (nconc rest articles)))
394 (deffoo nnml-request-move-article
395 (article group server accept-form &optional last move-is-internal)
396 (let ((buf (get-buffer-create " *nnml move*"))
397 (file-name-coding-system nnmail-pathname-coding-system)
399 (nnml-possibly-change-directory group server)
400 (nnml-update-file-alist)
402 (nnml-deletable-article-p group article)
403 (nnml-request-article article group server)
404 (let (nnml-current-directory
406 nnml-article-file-alist)
407 (with-current-buffer buf
408 (insert-buffer-substring nntp-server-buffer)
409 (setq result (eval accept-form))
410 (kill-buffer (current-buffer))
413 (nnml-possibly-change-directory group server)
415 (funcall nnmail-delete-file-function
416 (nnml-article-to-file article))
418 (nnml-nov-delete-article group article)
421 (nnmail-save-active nnml-group-alist nnml-active-file))))
424 (deffoo nnml-request-accept-article (group &optional server last)
425 (nnml-possibly-change-directory group server)
426 (nnmail-check-syntax)
428 (when nnmail-cache-accepted-message-ids
429 (nnmail-cache-insert (nnmail-fetch-field "message-id")
431 (nnmail-fetch-field "subject")
432 (nnmail-fetch-field "from")))
435 (nnmail-activate 'nnml)
436 (setq result (car (nnml-save-mail
437 (list (cons group (nnml-active-number group
441 (nnmail-save-active nnml-group-alist nnml-active-file)
442 (and last (nnml-save-nov))))
444 (nnmail-activate 'nnml)
445 (if (and (not (setq result (nnmail-article-group
447 (nnml-active-number group ,server)))))
448 (yes-or-no-p "Moved to `junk' group; delete article? "))
450 (setq result (car (nnml-save-mail result server t))))
452 (nnmail-save-active nnml-group-alist nnml-active-file)
453 (when nnmail-cache-accepted-message-ids
454 (nnmail-cache-close))
458 (deffoo nnml-request-post (&optional server)
459 (nnmail-do-request-post 'nnml-request-accept-article server))
461 (deffoo nnml-request-replace-article (article group buffer)
462 (nnml-possibly-change-directory group)
463 (with-current-buffer buffer
464 (nnml-possibly-create-directory group)
465 (let ((chars (nnmail-insert-lines))
466 (art (concat (int-to-string article) "\t"))
470 (point-min) (point-max)
471 (or (nnml-article-to-file article)
472 (expand-file-name (int-to-string article)
473 nnml-current-directory))
474 nil (if (nnheader-be-verbose 5) nil 'nomesg))
476 (setq headers (nnml-parse-head chars article))
477 ;; Replace the NOV line in the NOV file.
478 (with-current-buffer (nnml-open-nov group)
479 (goto-char (point-min))
480 (if (or (looking-at art)
481 (search-forward (concat "\n" art) nil t))
482 ;; Delete the old NOV line.
484 ;; The line isn't here, so we have to find out where
485 ;; we should insert it. (This situation should never
486 ;; occur, but one likes to make sure...)
487 (while (and (looking-at "[0-9]+\t")
490 (match-beginning 0) (match-end 0)))
492 (zerop (forward-line 1)))))
494 (nnheader-insert-nov headers)
498 (deffoo nnml-request-delete-group (group &optional force server)
499 (nnml-possibly-change-directory group server)
500 (let ((file (directory-file-name nnml-current-directory))
501 (file-name-coding-system nnmail-pathname-coding-system))
502 (if (file-exists-p file)
503 (if (file-directory-p file)
506 ;; Delete all articles in GROUP.
509 nnml-current-directory t
511 nnheader-numerical-short-files
512 "\\|" (regexp-quote nnml-nov-file-name) "$"
513 "\\|" (regexp-quote nnml-marks-file-name) "$")))
514 (decoded (nnml-decoded-group-name group server)))
515 (dolist (article articles)
516 (when (file-writable-p article)
517 (nnheader-message 5 "Deleting article %s in %s..."
518 (file-name-nondirectory article)
520 (funcall nnmail-delete-file-function article))))
521 ;; Try to delete the directory itself.
522 (ignore-errors (delete-directory nnml-current-directory))))
523 (nnheader-report 'nnml "%s is not a directory" file))
524 (nnheader-report 'nnml "No such directory: %s/" file))
525 ;; Remove the group from all structures.
526 (setq nnml-group-alist
527 (delq (assoc group nnml-group-alist) nnml-group-alist)
528 nnml-current-group nil
529 nnml-current-directory nil)
530 ;; Save the active file.
531 (nnmail-save-active nnml-group-alist nnml-active-file))
534 (deffoo nnml-request-rename-group (group new-name &optional server)
535 (nnml-possibly-change-directory group server)
536 (let ((new-dir (nnml-group-pathname new-name nil server))
537 (old-dir (nnml-group-pathname group nil server))
538 (file-name-coding-system nnmail-pathname-coding-system))
540 (make-directory new-dir t)
542 ;; We move the articles file by file instead of renaming
543 ;; the directory -- there may be subgroups in this group.
544 ;; One might be more clever, I guess.
545 (dolist (file (nnheader-article-to-file-alist old-dir))
547 (concat old-dir (cdr file))
548 (concat new-dir (cdr file))))
549 ;; Move .overview file.
550 (let ((overview (concat old-dir nnml-nov-file-name)))
551 (when (file-exists-p overview)
552 (rename-file overview (concat new-dir nnml-nov-file-name))))
554 (let ((marks (concat old-dir nnml-marks-file-name)))
555 (when (file-exists-p marks)
556 (rename-file marks (concat new-dir nnml-marks-file-name))))
557 (when (<= (length (directory-files old-dir)) 2)
558 (ignore-errors (delete-directory old-dir)))
559 ;; That went ok, so we change the internal structures.
560 (let ((entry (assoc group nnml-group-alist)))
562 (setcar entry new-name))
563 (setq nnml-current-directory nil
564 nnml-current-group nil)
565 ;; Save the new group alist.
566 (nnmail-save-active nnml-group-alist nnml-active-file)
569 (deffoo nnml-set-status (article name value &optional group server)
570 (nnml-possibly-change-directory group server)
571 (let ((file (nnml-article-to-file article)))
573 ((not (file-exists-p file))
574 (nnheader-report 'nnml "File %s does not exist" file))
577 (nnheader-insert-file-contents file)
578 (nnmail-replace-status name value))
582 ;;; Internal functions.
584 (defun nnml-article-to-file (article)
585 (nnml-update-file-alist)
588 (if nnml-use-compressed-files
589 (cdr (assq article nnml-article-file-alist))
590 (number-to-string article)))
591 (expand-file-name file nnml-current-directory)
592 (when (not nnheader-directory-files-is-safe)
593 ;; Just to make sure nothing went wrong when reading over NFS --
596 (setq file (expand-file-name (number-to-string article)
597 nnml-current-directory)))
598 (nnml-update-file-alist t)
601 (defun nnml-deletable-article-p (group article)
602 "Say whether ARTICLE in GROUP can be deleted."
603 (let ((file-name-coding-system nnmail-pathname-coding-system)
605 (when (setq path (nnml-article-to-file article))
606 (when (file-writable-p path)
607 (or (not nnmail-keep-last-article)
608 (not (eq (cdr (nth 1 (assoc group nnml-group-alist)))
611 ;; Find an article number in the current group given the Message-ID.
612 (defun nnml-find-group-number (id server)
613 (with-current-buffer (get-buffer-create " *nnml id*")
614 (let ((alist nnml-group-alist)
616 ;; We want to look through all .overview files, but we want to
617 ;; start with the one in the current directory. It seems most
618 ;; likely that the article we are looking for is in that group.
619 (if (setq number (nnml-find-id nnml-current-group id server))
620 (cons nnml-current-group number)
621 ;; It wasn't there, so we look through the other groups as well.
622 (while (and (not number)
624 (or (string= (caar alist) nnml-current-group)
625 (setq number (nnml-find-id (caar alist) id server)))
627 (setq alist (cdr alist))))
629 (cons (caar alist) number))))))
631 (defun nnml-find-id (group id server)
633 (let ((nov (nnml-group-pathname group nnml-nov-file-name server))
635 (when (file-exists-p nov)
636 (nnheader-insert-file-contents nov)
637 (while (and (not found)
638 (search-forward id nil t)) ; We find the ID.
639 ;; And the id is in the fourth field.
640 (if (not (and (search-backward "\t" nil t 4)
641 (not (search-backward "\t" (point-at-bol) t))))
645 ;; We return the article number.
647 (ignore-errors (read (current-buffer))))))
650 (defun nnml-retrieve-headers-with-nov (articles &optional fetch-old)
651 (if (or gnus-nov-is-evil nnml-nov-is-evil)
653 (let ((nov (expand-file-name nnml-nov-file-name nnml-current-directory)))
654 (when (file-exists-p nov)
655 (with-current-buffer nntp-server-buffer
657 (nnheader-insert-file-contents nov)
659 (not (numberp fetch-old)))
660 t ; Don't remove anything.
661 (nnheader-nov-delete-outside-range
662 (if fetch-old (max 1 (- (car articles) fetch-old))
664 (car (last articles)))
667 (defun nnml-possibly-change-directory (group &optional server)
669 (not (nnml-server-opened server)))
670 (nnml-open-server server))
673 (let ((pathname (nnml-group-pathname group nil server))
674 (file-name-coding-system nnmail-pathname-coding-system))
675 (when (not (equal pathname nnml-current-directory))
676 (setq nnml-current-directory pathname
677 nnml-current-group group
678 nnml-article-file-alist nil))
679 (file-exists-p nnml-current-directory))))
681 (defun nnml-possibly-create-directory (group &optional server)
682 (let ((dir (nnml-group-pathname group nil server))
683 (file-name-coding-system nnmail-pathname-coding-system))
684 (unless (file-exists-p dir)
685 (make-directory (directory-file-name dir) t)
686 (nnheader-message 5 "Creating mail directory %s" dir))))
688 (defun nnml-save-mail (group-art &optional server full-nov)
689 "Save a mail into the groups GROUP-ART in the nnml server SERVER.
690 GROUP-ART is a list that each element is a cons of a group name and an
691 article number. This function is called narrowed to an article."
692 (let* ((chars (nnmail-insert-lines))
693 (extension (and nnml-use-compressed-files
694 (> chars nnml-compressed-files-size-threshold)
695 (if (stringp nnml-use-compressed-files)
696 nnml-use-compressed-files
698 decoded dec file first headers)
699 (when nnmail-group-names-not-encoded-p
700 (dolist (ga (prog1 group-art (setq group-art nil)))
701 (setq group-art (nconc group-art
702 (list (cons (nnml-encoded-group-name (car ga)
705 decoded (nconc decoded (list (car ga)))))
707 (nnmail-insert-xref group-art)
708 (run-hooks 'nnmail-prepare-save-mail-hook)
709 (run-hooks 'nnml-prepare-save-mail-hook)
710 (goto-char (point-min))
711 (while (looking-at "From ")
712 (replace-match "X-From-Line: ")