; -*-emacs-lisp-*- (setq gnus-ignored-from-addresses (regexp-opt '("mark.longair@ed.ac.uk" "Mark.Longair@ed.ac.uk" "s9808248@sms.ed.ac.uk" "M.H.Longair@sms.ed.ac.uk" "m.h.longair@sms.ed.ac.uk"))) ;; Rather than using Gnus's Gcc lines, I'm going to Bcc myself on all ;; my outgoing mail... That's not ideal, but it will do for the ;; moment. (setq message-default-headers "Bcc: Myself ") ;; Sort threads by date, rather than the order the messages appear in ;; the folder... (setq gnus-thread-sort-functions '(gnus-thread-sort-by-date)) ;; don't fill up my Mail directory with Incoming* files... (setq mail-source-delete-incoming t) ;; I'm only using Gnus for email, not NNTP, so I might as well make ;; nnml the primary select method. (setq gnus-select-method '(nnml "")) ;; Add all your mail sources here e.g. ;; (file :path "/var/mail/mark") ;; (setq imap-log t) ;; <-- If you have problems with IMAP. (setq mail-sources '((imap :server "sms.ed.ac.uk" :port 993 :user "s9808248" :stream ssl))) ;; This is so that mail is only sent to the first matching group out ;; of this lot. Otherwise all the lists also end up in mail-* (setq nnmail-crosspost nil) ;; Filter out a couple of mailing lists, then put everything else in ;; inbox. (setq nnmail-split-methods '(("linux-kernel" "^Sender:.*linux-kernel-owner@vger.kernel.org") ("utf8" "^Sender:.*linux-utf8-bounce@nl.linux.org") ("inbox" ""))) ;; Figure out threading properly, not by subject. Outlook screws this ;; all up, of course, by using its own stupid system for threading and ;; not including a References: line. (setq gnus-summary-thread-gathering-function 'gnus-gather-threads-by-references) ;; A function to return my .xface as a string (used in the posting ;; style below.) (defun x-face-string () (with-temp-buffer (insert-file-contents (expand-file-name "~/.xface")) (buffer-string))) ;; See the `Posting Styles' section of the GNUS manual for more ;; information on this. (setq gnus-posting-styles '((".*" (name "Mark Longair") (organization "None") (address "Mark.Longair@ed.ac.uk") ("X-Face" (x-face-string))) ;; ("nnml:.*" ;; (From (save-excursion ;; (set-buffer gnus-article-buffer) ;; (message-fetch-field "to")))) ;; ("nnml.*vmail" ;; (name "Mark") ;; (address "mark-vmail@mythic-beasts.com")) )) ;; If you're spooling in overlapping mbox folders, you probably want ;; to delete all messages with duplicate message IDs. (setq nnmail-treat-duplicates 'delete) ;; This is set very high for initially importing old mail; you ;; probably want to drop it afterwards. (setq nnmail-message-id-cache-length 500000) ;; Use swish++ and nnir to index and search old email. ;; (require 'nnir) ;; (setq nnir-search-engine 'swish++) ;; (setq nnir-mail-backend gnus-select-method) ;; I still like the Insidious Big Brother Database. (bbdb-insinuate-gnus) (setq bbdb-always-add-addresses t) (setq bbdb/news-auto-create-p t) (setq bbdb-dwim-net-address-allow-redundancy t) (setq bbdb-complete-name-allow-cycling t) ;; I like to be able to press F6 and have a hilighted region of text ;; replaced with [..] (defun snip-region-for-message () "Snips the selected region of an included message." (interactive) (delete-region (point) (mark)) (if (not (zerop (current-column))) (newline)) (insert "[..]") (if (at-end-of-line-p) (progn (forward-line 1) (beginning-of-line)) (progn (newline) (insert message-yank-prefix))) (beginning-of-line)) (defun at-end-of-line-p () "Returns t if there is only whitespace to the end of the line. Otherwise returns nil." (save-excursion (let ((initial-point (point))) (search-forward-regexp "[ \t]*$") (eq initial-point (match-beginning 0))))) (defun trim-line () "Removes the whitespace at the end of the current line." (interactive) (save-excursion (beginning-of-line) (replace-regexp "[ \t]*$" ""))) (global-set-key [f6] 'snip-region-for-message) (add-hook 'gnus-summary-mode-hook '(lambda () (local-set-key "z" 'gnus-summary-mail-forward))) ; supercite is slightly over the top for what I need... ; ; (require 'supercite) ; (setq message-cite-function 'sc-cite-original) (defun my-message-citation-line-function () "Insert a simple citation line." (when message-reply-headers (insert (mail-header-from message-reply-headers) " wrote:\n> \n"))) (setq message-citation-line-function 'my-message-citation-line-function) ;; Some functions that I use for reporting and filing spam. These are ;; probably of little use to you. (defun send-to-bfilter (message-type) (let ((number (gnus-summary-article-number)) (group gnus-newsgroup-name) (command (concat "ssh mark@mythic-beasts.com bfilter " message-type))) (message (with-temp-buffer (gnus-request-article number group (current-buffer)) (shell-command-on-region (point-min) (point-max) command (current-buffer) t) (concat "Called command: " command))))) (defun spam () (interactive) ;; (send-to-bfilter "isspam") (gnus-summary-move-article 1 "spam" nil 'move)) (defun ham () (interactive) ;; (send-to-bfilter "isreal") ) ;; [You might want to set up mailcrypt too...]