[Kos-misc] gnus

d2 David.Decotigny@irisa.fr
25 Jun 2001 09:32:17 +0200


--=-=-=


Hello,

Ces derniers temps (ce WE), j'ai recu pratiquement tous tes mails en
double. Est-ce normal ?

Bon, sinon, pour Gnus, il est possible d'avoir les mails stockes dans
des vrais folders (des fichiers qui contiennent plusieurs mails),
comme sous Netscape. Il est meme possible d'estampiller les mails
recus par la date. Par exemple, ici, mon repertoire de mail donne :

mowgli ~/perso/mail/gnus/nnfolder >ls
AFUL             attac             envois-2001-02   kos-2001-05
Apodeline        attac-35          envois-2001-03   kos-2001-06
Cuisine-fr       attac35-2000-05   envois-2001-04   kos-2001-06~
Cygwin32         attac35-2000-06   envois-2001-05   libre
Divers           attac35-2000-07   envois-2001-06   linuxfr
Divers-2000-04   attac35-2000-08   envois-2001-06~  lug-rennes
Divers-2000-05   attac35-2000-09   finix            mail-2001-02
Divers-2000-06   attac35-2000-10   finix~           mail-2001-03
Divers-2000-07   attac35-2000-11   grub             nano-GUI
Divers-2000-08   attac35-2000-12   grub~            nano-GUI~
Divers-2000-09   attac35-2001-01   gulliver         netscape.ps
Divers-2000-10   attac35-2001-02   gulliver~        news-2001-02
Divers-2000-11   attac35-2001-03   harddrake        os-edge
Divers-2000-12   attac35-2001-04   histoire         paraski
Divers-2001-01   attac35-2001-05   irisa            pmode-l
Divers-2001-02   attac35-2001-06   irisa-2000-04    pmode-l~
Divers-2001-03   attac35-2001-06~  irisa-2000-05    renaud
Divers-2001-04   bochs             irisa-2000-06    rennes
Divers-2001-05   bochs~            irisa-2000-07    roadrunner
Divers-2001-06   bogus             irisa-2000-08    rtems
Divers-2001-06~  cine              irisa-2000-09    rtems~
Finix            cinefil           irisa-2000-10    solidor
Grub             cine~             irisa-2000-11    studio
Gulliver         cron              irisa-2000-12    studio-2000-04
Histoire         cron~             irisa-2001-01    studio-2000-05
Junk+Error       cvs-forum         irisa-2001-02    studio-2000-06
Libre            cvs-gnome         irisa-2001-03    studio-2000-07
Linux/           cvs-hades         irisa-2001-04    studio-2000-08
Lothar-devel     cygwin            irisa-2001-05    studio-2000-09
NNL              cygwin32          irisa-2001-06    studio-2000-10
NTIC             debian/           kos              studio-2000-11
Nano-GUI         duplicates        kos-2000-04      studio-2000-12
OSKit            duplicates~       kos-2000-05      studio-2001-01
Soft GNU         dyndns            kos-2000-06      studio-2001-02
TB/              envois            kos-2000-07      studio-2001-03
TB-2001-03       envois-2000-05    kos-2000-08      studio-2001-04
TB-2001-04       envois-2000-06    kos-2000-09      studio-2001-05
TB-2001-05       envois-2000-07    kos-2000-10      studio-2001-06
TB-2001-06       envois-2000-08    kos-2000-11      trace.txt
active           envois-2000-09    kos-2000-12      webnews
aitb             envois-2000-10    kos-2001-01      webnews~
apodeline        envois-2000-11    kos-2001-02
atheos           envois-2000-12    kos-2001-03
atheos~          envois-2001-01    kos-2001-04

Voila mon .gnus.el et mon .emacs.el :


--=-=-=
Content-Type: application/emacs-lisp
Content-Disposition: attachment; filename=.emacs.el
Content-Transfer-Encoding: 8bit

;;; Wrapper to make .emacs self-compiling.
;;; Author: Bill Brodie <wbrodie@panix.com>   Last Rev: Fri Apr 7 15:30 1995

(defvar init-top-level t)

; Load-Path
(setq load-path (cons (expand-file-name "/udd/ddecotig/arch/common/share/emacs/site-lisp/gnus") load-path))
(setq load-path (cons (expand-file-name "/udd/ddecotig/arch/common/share/emacs/site-lisp/w3") load-path))
(setq load-path (cons (expand-file-name "/udd/ddecotig/arch/common/share/emacs/site-lisp/bbdb") load-path))
(setq load-path (cons (expand-file-name "/udd/ddecotig/arch/common/share/emacs/site-lisp/caml") load-path))
(setq load-path (cons (expand-file-name "/udd/ddecotig/arch/common/share/emacs/site-lisp/eudc") load-path))


; Info-Path
(setq Info-default-directory-list (cons "/udd/ddecotig/info" Info-default-directory-list))

(server-start)

;; Definition des fichiers d'edition temporaire
(setq server-temp-file-regexp "^/tmp/Re\\|/draft$\\|TMP_")

(if init-top-level
    (let ((init-top-level nil))
      (if (file-newer-than-file-p "~/.emacs.el" "~/.emacs.elc")
          (progn
            (byte-compile-file "~/.emacs.el")
            (load "~/.emacs.el"))
        (load "~/.emacs.elc")))
  
  
; Activation automatique de font-lock pour tous les modes
    (if window-system
        (progn
          (global-font-lock-mode t)
          (setq font-lock-maximum-decoration t)
          
; Utilisation de lazy-lock
          (autoload 'turn-on-lazy-lock "lazy-lock" "Unconditionally turn on Lazy Lock mode")
          (add-hook 'font-lock-mode-hook 'turn-on-lazy-lock)

; Definition des couleurs pour les barres
          (set-face-background 'modeline "firebrick") 
          (set-face-foreground 'modeline "seashell1")
          ))

; **** Pas de barre en mode texte
    (if (null window-system)
        (progn
          (menu-bar-mode -1)
          (setq visible-bell nil)
          ))

; La zone sélectionnée passe en inverse vidéo
(transient-mark-mode 1)

; (Dé)compression automatique des fichiers
(load "jka-compr")

; Afficher le numero de colonne
(column-number-mode 1)

; On veut savoir ce qu'il fait
(setq font-lock-verbose t)

; **** sun keys
(setq term (or (getenv "SYSTEM")
	       "Unknown"))

;; *** Touche 'Del' supprime le caractere courant (aka C-d) ***
(global-set-key [\delete] 'delete-char)
;; *** 'F1' => man du terme pointe par le curseur disponible dans un buffer.
(global-set-key [(f1)] (lambda () 
			 (interactive) (manual-entry (current-word))))

; Les accents
;; Affichage des caracte`res 8 bits.
    (standard-display-european t)
          
;; Les nouveaux caracte`res sont des lettres.
;;    (require 'iso-syntax )

; *** Pour une creer des fichiers texte propres (passage a la ligne /72c)
(add-hook 'text-mode-hook 
          (function (lambda()
                      (auto-fill-mode 1)
                      )))

; *** Calendrier europeen
(setq european-calendar-style t)

; *** Changer le titre des fenetres
(setq default-frame-title-format
      (list ""
            (concat "Emacs - " (user-login-name) "@"
                    (substring (system-name) 0
                               (string-match "\\..+" (system-name)))
                    " - %f")))

(setq frame-title-format default-frame-title-format)
(setq icon-title-format "%b")

; **** Configuration pour l'impression ****
(setq lpr-switches (list '"-o nobanner"))

; **** Gestion des URL : lancer Netscape en -remote ****
(setq browse-url-browser-function
      (if (eq window-system 'x)
	  'browse-url-netscape
	'browse-url-w3))
(autoload browse-url-browser-function "browse-url"
  "Ask a WWW browser to show a URL." t)

;; *** Parentheses ***
(show-paren-mode t)

; **** Gestion des modes
(delete '("\\.h\\'" . c-mode) auto-mode-alist)
(nconc auto-mode-alist
       '(("\\.h\\'" . c++-mode)))
(delete '("\\(M\\|m\\|GNUm\\)akefile\\(.in\\)?\\'" . makefile-mode)
	auto-mode-alist)
(nconc auto-mode-alist
       '(("\\(M\\|m\\|GNUm\\)akefile\\(.in\\|.aimk\\)?\\'" . makefile-mode)))
(nconc auto-mode-alist
       '(("\\.wml\\'" . html-mode)))
    
(custom-set-faces)
(custom-set-variables
 '(browse-url-netscape-arguments (quote ("-noraise")))
 '(browse-url-netscape-program "/usr/local/lib/netscape/current/netscape"))

;; *** Caml ***
(setq auto-mode-alist
      (cons '("\\.ml[iylp]?$" . caml-mode) auto-mode-alist))
(autoload 'caml-mode "caml" "Major mode for editing Caml code." t)
(autoload 'run-caml "inf-caml" "Run an inferior Caml process." t)
;; (if window-system (require 'caml-hilit))
(if window-system (require 'caml-font))

; *** Mode C ***
(add-hook 'c-mode-hook 'my-imenu-enable t)
; Saut ligne auto (auto-state) + del des espaces vides multiples (hungry)
(add-hook 'c-mode-hook '(lambda ()
			  (c-toggle-auto-hungry-state t)))
(add-hook 'c++-mode-hook '(lambda ()
			    (c-toggle-auto-hungry-state t)))
(setq c-font-lock-extra-types 
      (append 
       '("Gdk\\sw+" "Gtk\\sw+" "gchar"                  ; Gdk/Gtk/glib
	 "guint" "gint" "glong" "gdouble"
	 "gpointer" "gboolean" "GList" "GSList"
	 "st_\\sw+")
       c-font-lock-extra-types))
(font-lock-add-keywords 'c-mode
			'(
			  ;; Glib
			  ("\\<\\(g_[-.a-z0-9_]*;?\\)\\>" . 
			   font-lock-keyword-face)
			  ;; Greffon
			  ("\\<\\(dlopen\\)\\>" . font-lock-keyword-face)
			  ("\\<\\(dlsym\\)\\>" . font-lock-keyword-face)
			  ("\\<\\(dlerror()\\)\\>" . font-lock-keyword-face)
			  ;; Commentaires
			  ("\\<\\(FIXME\\):" 1 font-lock-warning-face prepend)
			  ("\\<\\(BIDOUILLE\\):" 1 font-lock-warning-face prepend)
			  ))

; *** Nom de fonction dans la modebar (merci DM)
(custom-set-variables
 '(which-func-mode-global t nil (which-func)))
; *** Menu des noms de fonctions
(defun my-imenu-enable ()
  (setq imenu-sort-function 'imenu--sort-by-name)
  (imenu-add-to-menubar "Imenu"))

;; *** VC ***
(setq vc-follow-symlinks t)

;; *** EUDC (LDAP et Cie
(require 'eudc-autoloads)

; *** Init variables GNUS
(defconst sendmail-program "/usr/lib/sendmail")
(setq gnus-directory "~/perso/news")

;; end of wrapper (if init-toplevel
    )


--=-=-=
Content-Type: application/emacs-lisp
Content-Disposition: attachment; filename=.gnus.el
Content-Transfer-Encoding: 8bit

; **** Configuration de GNUS
; **** Adaptation par Eric Schwartz
; **** du fichier d'Olivier Aubert
; **** Reprises details de David Mentre et de JP Lesot (IRISA)

;;;
;;; Méthodes d'obtention des messages
;;;
(setq
 gnus-nntp-server nil
 gnus-select-method              '(nntp "news.irisa.fr")
 gnus-subscribe-newsgroup-method 'gnus-subscribe-randomly
 gnus-use-cross-reference t       ;Marquer les articles multiples
 gnus-use-long-file-name nil      ;Pas de nom pour les articles a sauver
 gnus-interactive-exit nil        ;Ne pas confirmer quand on quitte
 ;setq gnus-treat-date-lapsed t   ;Afficher les dates en relatif
 nntp-connection-timeout 15
 gnus-summary-line-format "%3i%U%R%I%[%4L: %-18,18n%] %s\n"
 gnus-score-thread-simplify t
)

(setq
 gnus-secondary-select-methods
 (list
  '(nnfolder "")
  '(nntp "forum"
	 (nntp-address "melimelo.enst-bretagne.fr")
	 (nntp-port-number 7777))
  '(nntp "metaforum"
	 (nntp-address "maisel-gw.enst-bretagne.fr")
	 (nntp-port-number 8899))
  ;'(nntp "sigmadesigns"
  ;(nntp-address "news.sigmadesigns.com"))
  '(nntp "hades-forum"
	 (nntp-address "valerian.irisa.fr")
	 (nntp-port-number 7777))
; '(nntp "kos-forum"
	; (nntp-address "kos.enix.org")
	; (nntp-port-number 7777))
					; '(nntp "freshmeat"
					; (nntp-address "news.freshmeat.net"))
					; '(nntp "linuxfr"
					; (nntp-address "news.linuxfr.org"))
					; '((nnslashdot ""))
  )
 )

;;;
;;; **** Init de BBDB
;;;
(require 'bbdb)
(bbdb-initialize 'gnus 'message 'sc 'w3)
(add-hook 'gnus-startup-hook 'bbdb-insinuate-gnus)
(bbdb-insinuate-message)
(bbdb-insinuate-w3)
(bbdb-insinuate-sc)
(setq bbdb-offer-save 1)
(setq bbdb-north-american-phone-numbers-p nil)
(setq bbdb-user-mail-names "david.decotigny@.*")

(setq sc-preferred-attribution-list
      '("sc-lastchoice" "x-attribution" "sc-consult"
	"firstname" "lastname" "initials"))

(setq sc-attrib-selection-list
      '(("sc-from-address"
	 ((".*" . (bbdb/sc-consult-attr
		   (sc-mail-field "sc-from-address"))))
	 ))
      )

(setq sc-mail-glom-frame
      '((begin                        (setq sc-mail-headers-start (point)))
	("^x-attribution:[ \t]+.*$"   (sc-mail-fetch-field t) nil t)
	("^\\S +:.*$"                 (sc-mail-fetch-field) nil t)
	("^$"                         (progn (bbdb/sc-default)
					     (list 'abort '(step . 0))))
	("^[ \t]+"                    (sc-mail-append-field))
	(sc-mail-warn-if-non-rfc822-p (sc-mail-error-in-mail-field))
	(end                          (setq sc-mail-headers-end (point)))))

;;;
;;; Trucs merdiques pour poster comme il faut la ou il faut
;;;

; Hack for posting on foreign servers (merci Dave)
(add-hook 'message-setup-hook
         (lambda ()
           (local-set-key "\C-c\C-c" 'message-send-and-exit-with-prefix)))
 
(defun message-send-and-exit-with-prefix ()
 "Call the message-send-and-exit function with a positive number argument
to make it post the message on the foreign NNTP server of a group, instead
of the default NNTP server"
 (interactive)
  (message-send-and-exit 1))

; Hack pour poster dans les foreign groups
(add-hook 'gnus-group-mode-hook
        (lambda ()
          (local-set-key "a" 'gnus-group-post-news-with-prefix)))

(defun gnus-group-post-news-with-prefix ()
 "Call the gnus-group-post-news function with an argument to make it
post the message on the foreign NNTP server of a group, instead of the
default NNTP server"
 (interactive)
 (gnus-group-post-news 4))

; Hack pour reconstruire les parents du message courant
(add-hook 'gnus-summary-mode-hook
         (lambda ()
           (local-set-key "\M-+" 'gnus-summary-refer-parent-article-with-prefix)))

; Hack pour chopper les nouveaux messages d'un groupe
(add-hook 'gnus-group-mode-hook
         (lambda ()
           (local-set-key "+" 'gnus-group-get-new-news-this-group)))

(defun gnus-summary-refer-parent-article-with-prefix ()
  "Call the gnus-summary-refer-parent-article function with
   10 as the argument"
   (interactive)
   (gnus-summary-refer-parent-article 10))

; Affichage des headers corrects
(setq gnus-visible-headers nil)  ; Afficher tous les headers, sauf
				 ; ceux de gnus-ignored-headers
(add-hook 'gnus-article-mode-hook
          '(lambda()             ; Ne pas afficher certains headers en
				 ; plus des standards
             (setq gnus-ignored-headers (append gnus-ignored-headers 
                                                '("^X-Content-Length:"
                                                  "^X-Mailer:"
                                                  "^X-Newsreader:"
                                                  "^X-Modappbot-Version:"
                                                  "^Mail-Copies-To:"
                                                  )))))

;;;
;;; Sélection des groupes et des messages
;;;
; On active les topics
(add-hook 'gnus-group-mode-hook 'gnus-topic-mode)

; Demande confirmation s'il y a plus de 50 articles dans le groupe
(setq gnus-large-newsgroup 50)

; Ne pas sélectionner le premier article du groupe
(setq gnus-auto-select-first nil)

; Pas de confirmation sur exit et catchup
(setq gnus-interactive-catchup nil)
(setq gnus-interactive-exit nil)

; On ne peut pas utiliser l'overview du serveur pour gérer les crossposts
(setq nntp-nov-is-evil t)

; On ne sauvegarde pas le fichier .newsrc, le .newsrc.eld suffit.
(setq gnus-save-newsrc-file nil)
(setq gnus-dribble-directory (expand-file-name "~/perso/mail/gnus/tmp/"))

(add-hook 'gnus-save-newsrc-hook '(lambda ()
                                    (make-local-variable 'version-control)
                                    (setq version-control 'never)))
(add-hook 'nnfolder-save-buffer-hook '(lambda ()
                                        (make-local-variable 'version-control)
                                        (setq version-control 'never)))


;;;
;;; Tri mails
;;;

;    Here's a neat feature: If you know that the recipient reads her mail
; with Gnus, and that she has `nnmail-treat-duplicates' set to `delete',
; you can send her as many insults as you like, just by using a
; `Message-ID' of a mail that you know that she's already received.
; Think of all the fun!  She'll never see any of it!  Whee!

(defun date (u) (concat u (format-time-string "-%Y-%m" (current-time))))
 ; I use the "fancy" split (thanks to titi) which allows me not seeing
 ; the crossposted mails in several groups
(setq nnmail-split-methods 'nnmail-split-fancy)
(setq nnmail-split-fancy
      `(|
	("Gnus-Warning" ".*" "duplicates")
	(any ".*\\(studio@maisel-gw\\|studio@b-515\\|studio@rtfm\\|studio@sumthin.nu\\)" ,(date "studio"))
	(any ".*@aitb.org" "aitb")
	(any ".*\\(Cinefil-France@.*.com\\|bot_direct@allocine.fr\\)" "cine")
	(any ".*\\(linux-kernel-announce@vger.*\\|linux-kernel-announce@.*.kernel.org\\)" "Linux.announce")
	(any ".*apodeline@ladl.*" "apodeline")
	(any ".*linux29@.*infini.*" "finix")
	(any ".*linux-kernel-digest@vger.*" "Linux.kernel")
	(any ".*linux-kernel-patch@vger.*" "Linux.patch")
	(any ".*\\(ELKS\\|linux-8086@vger\\).*"  "Linux.elks")
	(any ".*linux-gcc-digest@vger.*"  "Linux.gcc")
	(any ".*debian-hurd@lists.debian.*" "debian.hurd")
	(any ".*grub.*@gnu.*" "grub")
	("Subject" ".*Output from \"cron\" command.*" "cron")
	("X-Cron-Env" ".*" "cron")
	("From" ".*\\(Cron Daemon\\|system PRIVILEGED account\\).*" "cron")
	(any ".*cvsforum@maisel-gw.*" "cvs-forum")
	("Subject" ".*CVS Check.*" "cvs-hades")
	(any ".*gnomecvs@cvs.*redhat.*" "cvs-gnome")
	(any ".*paraski.*@irisa.*" "paraski")
	(any ".*\\(lug-rennes@egroups.com\\|listserv@ifsic\\|gulliver.*@.*ifsic\\).*" "gulliver")
	(any ".*nnl.*@aful.org" "AFUL")
	(any ".*\\(gnu-win32@cygnus\\|cygwin.*@sourceware.cygnus.com\\|cygwin-announce@cygwin.com\\).*" "cygwin")
	(any ".*harddrake.*@linux-mandrake.com" "harddrake")
	(any ".*bochs-.*@\\(redhat.com\\|.*sourceforge.*\\)" "bochs")
	(any ".*atheos.*@.*sourceforge.net" "atheos")
	(any ".*binutils.*@sources.redhat.com" "Soft GNU")
	(any ".*sw-wml@engelschall.com" "wml")
	(any ".*redaction@linux-center.org" "NNL")
	(any ".*\\(null@linuxfr.org\\|slashdot@slashdot.*\\|lettre@budgetelecom.com\\|newslists1@wis.fr\\|.*@ftpresse.fr\\|.*@webencyclo.com\\)" "webnews")
	(any ".*rennesmail@webcity.fr" "rennes")
	(any ".*nanogui@linuxhacker.org" "nano-GUI")
	(any ".*libre@quatramaran.ens.fr" "libre")
	(any ".*\\(rtems-list@OARcorp.com\\|rtems-users@oarcorp.com\\)" "rtems")
	(any ".*pmode-l@phys.uu.nl" "pmode-l")
	(any ".*\\(kos.*@.*\\|.*\@kos..*.org\\)" ,(date "kos"))
	(any ".*Roadrunner.*@lists.sourceforge.net" "roadrunner")
	(any ".*ntic@Eurenet.com" "NTIC")
	(any ".*histoire-fr@list.dolist.net" "histoire")
	(any ".*attac35.*@\\(attac.org\\|ras.eu.org\\)" ,(date "attac35"))
	(any ".*@\\(attac.org\\|ras.eu.org\\)" "attac")
	(any ".*@enst-bretagne.fr" ,(date "TB"))
	(any ".*\\(solidor.*@.*irisa.fr\\)" "solidor")
	("From" ".*David.Decotigny@.*" ,(date "envois"))
	("\\(From\\|Reply-To\\)" ".*@.*irisa.fr" ,(date "irisa"))
	,(date "Divers")
	"Junk+Error"
	)
      )

;;;
;;; Supression automatique des vieux mails
;;;
(setq gnus-auto-expirable-newsgroups
      "OSKit\\|cygwin32\\|cygwin\\|cron\\|finix\\|apodeline\\|Linux\\.announce\\|Linux\\.kernel\\|Linux\\.patch\\|Linux\\.elks\\|Linux\\.gcc\\|debian\\.hurd\\|wml\\|lothar-devel\\|harddrake\\|cuisine-fr\\|nano-gui\\|libre\\|NNL\\|renaud\\|rtems\\|pmode-l\\|duplicates\\|attac\\|cinefil\\|cine\\|grub\\|cvs-.*\\|atheos\\|histoire\\|aitb\\|cron\\|paraski\\|dyndns\\|os-edge\\|rennes\\|webnews\\|linuxfr\\|Soft GNU")

(setq nnmail-expiry-wait-function
      (lambda (group)
        (cond ((string= group "OSKit")
               3)
	      ((string= group "aitb")
               30)
	      ((string= group "paraski")
               30)
	      ((string= group "renaud")
	       3)
	      ((string= group "NNL")
	       14)
	      ((string= group "libre")
	       14)
              ((string= group "cygwin32")
               3)
              ((string= group "cygwin")
               3)
              ((string= group "cron")
               3)
	      ((string= group "duplicates")
	       5)
              ((string= group "finix")
               14)
              ((string= group "attac")
               14)
              ((string= group "attac35")
               14)
              ((string= group "Linux.kernel")
               3)
              ((string= group "Linux.patch")
               3)
              ((string= group "Linux.elks")
               3)
              ((string= group "Linux.gcc")
               14)
              ((string= group "debian.hurd")
               3)
              ((string= group "cvs-gnome")
               3)
	      (t
	       7))))

;;;
;;; Repertoires
;;;
(setq
 nnfolder-directory "~/perso/mail/gnus/nnfolder/"
 nnfolder-active-file "~/perso/mail/gnus/nnfolder/active"
 nnfolder-newgroups-file "~/perso/mail/gnus/nnfolder/newgroups"
 nnmail-spool-file '("/var/mail/ddecotig"
		     "~/perso/mail/procmail/mailing-lists")
 nnmail-tmp-directory "~/perso/mail/gnus/tmp"
 mail-source-directory "~/perso/mail/gnus/tmp"
 nnmail-crash-box "~/perso/mail/gnus/.gnus-crash-box"
 nnmail-message-id-cache-file "~/perso/mail/gnus/.nnmail-cache"
 message-directory "~/perso/mail/gnus/"
 message-autosave-directory "~/perso/mail/gnus/tmp"
 )

;;;
;;; Affichage des messages et des summaries
;;;
; Pas de crosspost: on utilise la premiere regle qui correspond
(setq nnmail-crosspost nil)

(add-hook 'gnus-article-display-hook 'gnus-article-highlight)
(add-hook 'gnus-article-display-hook
          '(lambda ()
             (gnus-article-de-quoted-unreadable)
             (gnus-article-emphasize)
             (gnus-article-hide-boring-headers)
             (gnus-article-hide-headers-if-wanted)
             (gnus-article-hide-pgp)
             (gnus-article-highlight)
             (gnus-article-highlight-citation)
             (gnus-article-date-local)
             ))
;; (setq gnus-thread-hide-subtree t)

;Ne pas afficher les en-têtes d'articles.
(setq gnus-show-all-headers nil)

;Marquer les articles multiples
(setq gnus-use-cross-reference t)
(setq gnus-auto-center-summary nil)

;Ne pas scroller les subjects.
(setq gnus-auto-center-subject nil)

;;;
;;; Utilisations des demons (fonctions automatiques)
;;;
; Activer les demons
(setq gnus-use-demon t)

; Fermer les connexions apres 30 min en idle
(gnus-demon-add-disconnection)

; Automatically scan mail
(gnus-demon-add-scanmail)

; Automatically scan news
(gnus-demon-add-rescan)

;;;
;;; Identite de base
;;;
(setq message-user-organization  "IRISA - Rennes - France")
(setq gnus-use-generic-from t)  ;Ne pas faire apparaître le nom de la
                                ;   machine utilisée pour poster la news
(setq user-mail-address "David.Decotigny@irisa.fr")

;;;
;;; Adaptation identitite suivant destinataires
;;;
(setq gnus-posting-styles
      '((".*"
         (signature-file "~/.signature")
         (name "David Decotigny")
	 (sender "David.Decotigny@irisa.fr")
	 (X-Subliminal "My GNUS is rich")
	 ("X-Home-Page" "http://www.bigfoot.com/~David.Decotigny")
	 ("X-Portrait" "http://www.irisa.fr/PHOTOS/html/ddecotig.html")
	 ("X-VCard" "http://www.bigfoot.com/~David.Decotigny/d2.vcf"))
        ("^fr\\."
         (signature-file "~/.sig/sig.news-fr"))
        ("irisa"
	 (organization
	  "IRISA - Campus de Beaulieu - 35042 Rennes Cedex - France")
         (signature-file "~/.sig/sig.mail-irisa"))
        ("TB"
         (signature-file "~/.sig/sig.mail-tb"))
        (".*.forum\\|kos\\|Gulliver"
         (name "d2")
         (signature-file "~/.sig/sig.mail-tb"))
        ("melimelo\\.forum\\|maisel-gw\\.forum"
	 (signature (call-process "~/.sig/sig-gen.sh" nil t nil "forum")))
        ("Gulliver"
         (organization "Ou je l'ai encore mise, celle-la ?!")
	 (signature (call-process "~/.sig/sig-gen.sh" nil t nil "gulliver")))
       ("paraski"
         (signature "David"))
	("studio"
	 ("To" "Ze studio <studio@sumthin.nu>")
	 (name "d2")
         (organization "(C) Studio Team")
	 (signature-file "~/.sig/sig.ml-studio"))
;	("kos-[^f].*"
;	 ("To" "Mailing list KOS <kos-ml@Eurenet.com>"))
	("attac35"
	 ("To" "Liste de discussion Attac 35 <attac35@attac.org>"))
	("attac"
	 (name "David Decotigny")
	 (organization "ATTAC France - GL Ille et Vilaine")
	 (address "David.Decotigny@attac.org")
	 (sender "David.Decotigny@attac.org")
	 ("Reply-To" "David.Decotigny@attac.org")
	 (signature-file "~/.sig/sig.attac")
	 ("X-Home-Page" "http://www.local.attac.org/35"))
	))

(setq message-generate-headers-first t)
(setq message-kill-buffer-on-exit t)

;;;
;;; Configuration de MIME
;;;
;;; Disable QP for unknown (binary) mime types.
(setq mm-content-transfer-encoding-defaults
  '(("text/x-patch" 8bit)
    ("text/.*" qp-or-base64)
    ("message/rfc822" 8bit)
    ("application/emacs-lisp" 8bit)
    ("application/x-patch" 8bit)
    (".*" base64)))

; Traitement et filtrage des messages
(setq gnus-view-pseudo-asynchronously t)
(setq gnus-view-pseudos 'automatic)
(setq gnus-view-pseudos-separately nil)
(setq gnus-uu-user-view-rules
      (list '("\\\\.au$" "xplay %s")
	    '("\\\\.\(gif\|bmp\|jpg\|jpeg\|png\|tga\|tiff\|xwd\)$" "display %s")
	    '("\\\\.\(ps\|eps\)$" "gv %s")
	    '("\\\\.pdf$" "gv %s")
	    '("\\\\.dvi$" "xdvi %s")
	    '("\\\\.\(mpg\|mpeg\|avi\)$" "xanim %s")))
(setq gnus-uu-tmp-dir "/tmp" )

; Ne pas splitter les gros messages 
(setq mime-editor/split-message nil)

; encodeur/decodeur mime plus rapide
(setq base64-encoder-program "mimencode")
(setq base64-decoder-program "mimencode"
      base64-decoder-switches '("-u"))

; Config mime
(require 'mailcap)
(mailcap-parse-mailcaps nil 'force)
(mailcap-add-mailcap-entry "image" "gif"
                            '((viewer . "showpicture -viewer xli %s")
                              (type . "image/gif")))

;;;
;;; Champs dans les messages postes
;;;
(setq
 message-default-headers "X-Attribution: d2\nX-Mailer: My GNUS is rich\n"
 message-default-mail-headers
   "Reply-To: David.Decotigny@irisa.fr\nX-Loop: David.Decotigny@irisa.fr\n"
 )

;;;
;;; Archivage des messages envoyes
;;;
(setq gnus-message-archive-method		'(nnfolder "Archive"
						  (nnfolder-inhibit-expiry	t)
						  (nnfolder-directory
						   "~/perso/mail/gnus/sent/")
						  (nnfolder-newsgroup-file
						   "~/perso/mail/gnus/sent/.newsgroup")
						  (nnfolder-active-file
						   "~/perso/mail/gnus/sent/active")
						  (nnfolder-get-new-mail	nil)))
(setq gnus-message-archive-group		'((if (message-news-p)
						        (concat "news-" (format-time-string "%Y-%m" (current-time)))
						        (concat "mail-" (format-time-string "%Y-%m" (current-time))))))

;;;
;;; Sauvegarde des messages
;;;
(setq gnus-use-long-file-name t)
 ;Sauver les articles dans un fichier conventionnel mbox
(setq gnus-default-article-saver 'gnus-summary-save-in-mail)
(setq gnus-mail-save-name
      ;;; Automatically generate a mail file for certain newsgroups
      ;;; Just do a ((string-match "criteria" newsgroup) "FOLDERNAME")
      ;;; inside the cond statement to add your own.
      '(lambda (newsgroup headers &optional last-name)
         (cond
          ((string-match "nnfolder" newsgroup) "~/perso/mail/gnus/")
          (t "~/perso/mail/gnus/misc"))))

;;;
;;; Gestion des scores
;;;
(setq message-send-hook 'gnus-score-followup-article)
(add-hook message-send-hook 'gnus-score-followup-thread)
(setq gnus-use-scoring t)
(setq gnus-use-adaptive-scoring nil)
(setq-default gnus-kill-files-directory "~/perso/news/scores")
; Utilisation de la syntaxe type: all.SCORE
(setq gnus-score-find-score-files-function 'gnus-score-find-bnews)
; On trie les articles d'abord par score, puis par date
(setq gnus-thread-sort-functions
      '(gnus-thread-sort-by-date
	gnus-thread-sort-by-total-score))

;; Cite
(require 'gnus-cite) 
(setq message-cite-function 'sc-cite-original)
; (setq message-cite-function 'message-cite-original-without-signature)

;; ++
(add-hook 'gnus-startup-hook 
          '(lambda ()
             (set-face-foreground 'bold "red")
             (message "hacked by d2")
             ))

--=-=-=


Sachant qu'avec les versions recentes de Gnus on peut lire du mime.

Concernant le .gnus, ses caracteristiques, c'est que les mails sont
stockes "ala mbox" (fichiers de folders) dont le nom peut etre
estampille par la date. Que la signature, le champ From, et d'autres
champs sont specialises suivant la ou on poste (par exemple, si
j'envoie un mail alors que le curseur est sur "Divers-xxxxx", le From
sera "David Decotigny" ; si le curseur est sur "kos-xxxx", le From
sera "d2"). Sinon, tous les mails envoyes sont archives dans les
folders envois-xxxx. Les "drafts" (mails rediges non envoyes) sont
egalement stockes en reserve.

Nota : il faut savoir que je suis une grosse buse en emacs, alors tous
       les hacks un peu bourrins ou nuls, c'est normal.

Bonne journee,

-- 
d2

--=-=-=--