(require 'gnus-art)
(require 'mm-url)
(defvar nix-mailing-list-directory "~/.Mail/"
"The directory where mailing lists sit.")
(setq message-directory "~/Mail/spool/"
mail-source-directory "~/Mail/spool/"
mail-sources `((directory :path ,nix-mailing-list-directory :suffix "")
(file :path "~/.Mailbox"))
mail-source-delete-incoming t mail-source-primary-source "/home/nix/.Mailbox" mail-user-agent 'gnus-user-agent nnmail-message-id-cache-file "~/.Mail.msgid.cache" nnmail-treat-duplicates 'delete gnus-secondary-select-methods '((nnml ""
(nnml-directory "/home/nix/Mail/spool/") (nnml-active-file "/home/nix/Mail/spool/active") (nnml-newsgroups-file "/home/nix/Mail/spool/newsgroups") (nnml-use-compressed-files nil) (nnml-get-new-mail t)) (nnmh ""
(nnmh-directory "/home/nix/Mail/nnmh/") (nnmh-get-new-mail nil))) gnus-suppress-duplicates t gnus-save-duplicate-list t gnus-gcc-mark-as-read t)
(require 'mail-source)
(defun mail-source-fetch-directory (source callback)
"Fetcher for directory sources.
Modified by Nix to tell split methods the name of the file being
grabbed from."
(mail-source-bind (directory source)
(mail-source-run-script
prescript (format-spec-make ?t path) prescript-delay)
(let ((found 0)
(mail-source-prefix "directory:"))
(dolist (file (directory-files
path t (concat (regexp-quote suffix) "$")))
(when (and (file-regular-p file)
(funcall predicate file)
(let ((mail-source-string (concat mail-source-prefix file)))
(mail-source-movemail file mail-source-crash-box)))
(incf found (mail-source-callback callback file))
(mail-source-run-script postscript (format-spec-make ?t path))
(mail-source-delete-crash-box)))
found)))
(setq nnmail-split-methods 'nnmail-split-fancy nnmail-split-fancy `(| ("x-gnus-mail-source"
,(concat "directory:" nix-mailing-list-directory "\\(.*\\)")
"\\1")
"Mailbox")
mm-discouraged-alternatives '("text/html") mm-inline-large-images t mm-inline-text-html-with-w3m-keymap nil message-default-charset 'utf-8
nnmail-expiry-wait-function #'(lambda (group)
(cond ((or (string-match "blockbox" group)
(string-match "spambox" group)
(string-match "spambox-verified" group))
'immediate)
(t 7))))
(add-hook 'nnmail-prepare-incoming-message-hook 'article-de-quoted-unreadable)
(defadvice mm-url-insert (after convert-atom-to-rss nil)
"Converts atom to RSS by calling xsltproc."
(when (re-search-forward "xmlns=\"http://www.w3.org/.*/Atom\""
nil t)
(message "Converting Atom to RSS... ")
(goto-char (point-min))
(call-process-region (point-min) (point-max)
"xsltproc"
t t nil
(expand-file-name "~/lib/atom2rss.xsl") "-")
(goto-char (point-min))
(message "Converting Atom to RSS... done")))
(ad-activate 'mm-url-insert)
(provide 'dot-gnus-mail)