;;; [[ 個人情報の設定 ]]
;基本的に太字になってるところを自分の環境に合わせて保存すれば
;動くと思います。
;Headerをつける
;(setq mime-edit-user-agent-value "REMI/1.14.2
(Hokuhoku-oshima) Chao/1.14.1 (Rokujizo)
Emacs/20.4 MULE/4.1 (AOI) (sun-sparc-solaris8)")
;アイコンをおくディレクトリ指定
;パッケージで入れたら指定しなくてもいいらしい
(setq wl-icon-dir "~/etc/icons")
;無駄なヘッダは制限して必要最小限に
;; summary-mode ですべての header を一旦除去
(setq mime-view-ignored-field-list '("^.*"))
;; そのうえで必要なものだけを表示
(setq mime-view-visible-field-list
'("^Subject:" "^From:"
"^To:" "^Cc:"
"^X-Mailer:" "^User-Agent:"))
;HTMLをインライン表示しない。
(setq mime-setup-enable-inline-html nil)
;添付ファイルを文字化けしないようにする
(defadvice mime-entity-fetch-field
(after mime-decode-entity activate)
"MIME decode fetched field of entity."
(if ad-return-value
(setq ad-return-value (eword-decode-string
(namajis-decode ad-return-value)))))
(defun namajis-decode (s)
(with-temp-buffer
(insert s)
(beginning-of-buffer)
(while (re-search-forward "\033$[@B][^\033]+\033([BJ]"
nil t)
(decode-coding-region (match-beginning 0)
(match-end 0) 'junet))
(buffer-substring 1 (point-max))))
;(defvar my-mime-filename-coding-system-for-decode
; '(iso-2022-jp japanese-shift-jis japanese-iso-8bit))
;
;(defun my-mime-decode-filename (filename)
; (let ((rest (eword-decode-string filename)))
; (or (when (and my-mime-filename-coding-system-for-decode
; (string= rest filename))
; (let ((dcs (mapcar (function coding-system-base)
; (detect-coding-string filename))))
; (unless (memq 'emacs-mule dcs)
; (let ((pcs my-mime-filename-coding-system-for-decode))
; (while pcs
; (if (memq (coding-system-base (car pcs))
dcs)
; (setq rest (decode-coding-string filename
(car pcs))
; pcs nil)
; (setq pcs (cdr pcs))))))))
; rest)))
;(eval-after-load "mime"
; '(defadvice mime-entity-filename (after
eword-decode-for-broken-MUA activate)
; "Decode encoded file name for BROKEN
MUA."
; (when (stringp ad-return-value)
; (setq ad-return-value (my-mime-decode-filename
ad-return-value)))))
;(defadvice mime-entity-fetch-field
; (after mime-decode-entity activate)
; "MIME decode fetched field of entity."
; (if ad-return-value
; (setq ad-return-value (eword-decode-string
(namajis-decode ad-return-value)))))
;(defun namajis-decode (s)
; (with-temp-buffer
; (insert s)
; (beginning-of-buffer)
; (while (re-search-forward "\033$[@B][^\033]+\033([BJ]"
nil t)
; (decode-coding-region (match-beginning
0) (match-end 0) 'junet))
; (buffer-substring 1 (point-max))))
;添付ファイルを分割しないようにする
(setq mime-edit-split-message nil)
;Wanderlustでは,SubjectやFrom行が "=?ISO-2022-JP?B?GyRCJTUhPCVQJEslYSUkJWskcjtEJDlAX0RqGyhC?="
;のように,"でクオートされたものは,デコードされません.以下のように設定すると,"
;でクオートされたものもデコードするようになります.
(setq eword-lexical-analyzer
'(;;eword-analyze-quoted-string
eword-analyze-domain-literal
eword-analyze-comment
eword-analyze-spaces
eword-analyze-special
eword-analyze-encoded-word
eword-analyze-atom))
;メール着信を自動でチェック
;(setq wl-biff-check-folder-list '("%inbox"))
;(setq wl-biff-check-folder-list '("&your-account@your.domain"))
;; From の設定
(setq wl-from "Your Name<your-account@your.domain>")
;; Organization の設定
;(setq wl-organization "")
;;; [[ 基本的な設定 ]]
;; メッセージデータベースを作るディレクトリ
(setq elmo-msgdb-dir "~/.elmo")
;; MH (localdir) のホーム
(setq elmo-localdir-folder-path "~/Mail")
;; IMAP4サーバの設定
;(setq elmo-default-imap4-server "localhost")
;; ニュースサーバの設定
;(setq elmo-default-nntp-server "localhost")
;; 投稿先の ニュースサーバ
;(setq wl-nntp-posting-server elmo-default-nntp-server)
;; メールを送信する先の (SMTP)サーバ
(setq wl-smtp-posting-server "Your SMTP
server")
(setq wl-local-domain "your.domain")
(setq smtp-local-domain "your.domain")
(setq wl-default-folder "+inbox")
;; wl-summary-goto-folder の時に選択する
;; デフォルトのフォルダ
(setq wl-default-spec "+") ;; フォルダ名補完時に使用する
;; デフォルトのスペック
(setq wl-fcc "+sent") ;; Folder
Carbon Copy
(setq wl-interactive-exit t) ;; 終了時に確認する
(setq wl-interactive-send t) ;; メール送信時には確認する
(setq wl-summary-move-order 'unread) ;; 未読メッセージを優先的に読む
(setq wl-thread-insert-opened t) ;; thread作成時は常にopenにする
(setq wl-auto-select-first t) ;; サマリ移動後に先頭メッセージを表示する
(setq wl-auto-select-next t) ;; サマリ内の移動で未読メッセージがないと
;; 次のフォルダに移動する
(setq wl-stay-folder-window t) ;; サマリに移動したときにフォルダバッファ
;; の右にサマリのバッファを表示する
(setq wl-folder-window-width 25) ;; ↑の幅
(setq wl-summary-width 140) ;; summaryの幅
(setq wl-no-cache-folder-list '("^[-$].*"))
;; アーカイブフォルダとニュースフォルダ
;; はキャッシュしない
(setq wl-message-window-size '(4 . 6)) ;;
サマリとメッセージの比率
;; IMAP フォルダなどでのオフライン操作を有効にする
;(setq elmo-enable-disconnected-operation
t)
;; unplugged 状態で送信すると,キュー(`wl-queue-folder')に格納する
(setq wl-draft-enable-queueing t)
;; unplugged から plugged に変えると,キューにあるメッセージを送信する
;; "+queue" フォルダをあらかじめ作っておきましょう
(setq wl-auto-flush-queue t)
(setq wl-auto-check-folder-name "%inbox")
;; highlightの設定 (明るい背景色の場合です)
(setq wl-highlight-message-header-alist
'(("Subject[ \t]*:" . wl-highlight-message-subject-header-contents)
("From[ \t]*:" . wl-highlight-message-from-header-contents)
("\\(.*Reply-To\\|.*Followup-To\\)[
\t]*:" . wl-highlight-message-replyto-header-contents)
("\\(.*To\\|Cc\\|Newsgroups\\)[ \t]*:"
. wl-highlight-message-to-header-contents)
("\\(User-Agent\\|X-Mailer\\|X-Newsreader\\)[
\t]*:" .
wl-highlight-message-important-header-contents)
))
;; 引用レベルで色分けしない
;(setq wl-highlight-citation-face-list
; '(wl-highlight-message-cited-text-1))
;; メッセージヘッダ
(copy-face 'bold 'wl-highlight-message-subject-header-contents)
(set-face-foreground 'wl-highlight-message-subject-header-contents
"blue2")
(copy-face 'bold 'wl-highlight-message-from-header-contents)
(set-face-foreground 'wl-highlight-message-from-header-contents
"red3")
(copy-face 'bold 'wl-highlight-message-to-header-contents)
(set-face-foreground 'wl-highlight-message-to-header-contents
"DarkOrange2")
(copy-face 'default 'wl-highlight-message-replyto-header-contents)
(set-face-foreground 'wl-highlight-message-replyto-header-contents
"DarkOrange2")
(copy-face 'bold 'wl-highlight-message-important-header-contents)
(set-face-foreground 'wl-highlight-message-important-header-contents
"purple")
(copy-face 'default 'wl-highlight-message-unimportant-header-contents)
(set-face-foreground 'wl-highlight-message-unimportant-header-contents
"RoyalBlue")
(copy-face 'bold 'wl-highlight-message-headers)
(set-face-foreground 'wl-highlight-message-headers
"magenta3")
(copy-face 'default 'wl-highlight-message-header-contents)
(set-face-foreground 'wl-highlight-message-header-contents
"brown")
;; 引用
(set-face-foreground 'wl-highlight-message-citation-header
"DarkGreen")
(set-face-foreground 'wl-highlight-message-cited-text-1
"forest green")
(set-face-foreground 'wl-highlight-message-cited-text-2
"SaddleBrown")
(set-face-foreground 'wl-highlight-message-cited-text-3
"orchid3")
(set-face-foreground 'wl-highlight-message-cited-text-4
"purple1")
(set-face-foreground 'wl-highlight-message-cited-text-5
"MediumPurple1")
(set-face-foreground 'wl-highlight-message-cited-text-6
"PaleVioletRed")
(set-face-foreground 'wl-highlight-message-cited-text-7
"LightPink")
(set-face-foreground 'wl-highlight-message-cited-text-8
"salmon")
(set-face-foreground 'wl-highlight-message-cited-text-9
"SandyBrown")
(set-face-foreground 'wl-highlight-message-cited-text-10
"wheat")
;; サマリ
(set-face-foreground 'wl-highlight-summary-important-face
"purple")
(set-face-foreground 'wl-highlight-summary-new-face
"tomato")
(set-face-foreground 'wl-highlight-summary-displaying-face
"blue2")
(set-face-foreground 'wl-highlight-summary-unread-face
"RoyalBlue")
(set-face-foreground 'wl-highlight-summary-deleted-face
"blue")
(set-face-foreground 'wl-highlight-summary-refiled-face
"blue")
(set-face-foreground 'wl-highlight-summary-temp-face
"salmon")
;; (スレッド)
(set-face-foreground 'wl-highlight-summary-thread-top-face
"green4")
(set-face-foreground 'wl-highlight-summary-normal-face
"SeaGreen")
;; フォルダ
(set-face-foreground 'wl-highlight-folder-unknown-face
"RoyalBlue")
(set-face-foreground 'wl-highlight-folder-killed-face
"blue")
(set-face-foreground 'wl-highlight-folder-unread-face
"brown")
(set-face-foreground 'wl-highlight-folder-zero-face
"blue4")
(set-face-foreground 'wl-highlight-folder-few-face
"orange")
(set-face-foreground 'wl-highlight-folder-many-face
"HotPink1")
;; グループ
(set-face-foreground 'wl-highlight-folder-opened-face
"forest green")
(set-face-foreground 'wl-highlight-folder-closed-face
"DarkOliveGreen4")
;; デモ
(set-face-foreground 'wl-highlight-demo-face
"red")
;;; [[ 特殊な設定 ]]
;;; グループをcheckした後に未読があるフォルダのグループを自動的に開く
(add-hook 'wl-folder-check-entity-hook
'(lambda ()
(wl-folder-open-unread-folder entity)
))
;; 自分が送信したメッセージであれば,サマリの差出人表示に
;; 宛先(To,Newsgroups)を表示する
;; wl-fcc など,送信したメッセージを残しているフォルダ
(setq my-wl-summary-from-outgoing-folder-list
'("+sent" "%#mh/sent"))
;; Newsgroupsフィールドをoverview情報に入れる設定(ただし,localフォルダのみ)
;(setq elmo-msgdb-extra-fields '("newsgroups"))
;; サマリの表示関数を変更する
(setq wl-summary-from-func 'my-wl-summary-from-func-petname)
(defun my-wl-summary-from-func-petname (from)
(let (retval tos ng)
(if (and (wl-string-member wl-summary-buffer-folder-name
my-wl-summary-from-outgoing-folder-list)
(member (wl-address-header-extract-address
from)
wl-user-mail-address-list))
(cond ((setq tos (elmo-msgdb-overview-entity-get-to
entity))
(setq retval
(concat "To:"
(mapconcat
'identity
(mapcar
'(lambda (to)
(if wl-use-petname
(wl-address-get-petname to)
(car (std11-extract-address-components to))))
(wl-parse-addresses tos))
","))))
((setq ng (elmo-msgdb-overview-entity-get-extra-field
entity "newsgroups"))
(setq retval (concat "Ng:" ng))))
(if wl-use-petname
(setq retval (wl-address-get-petname from))
(setq retval from)))))
;; imput により非同期で送信する
;; (utils/im-wl.el をインストールしておく必要があります)
;; また,~/.im/Config の設定(Smtpservers)の変更を忘れずに。
;(autoload 'wl-draft-send-with-imput-async
"im-wl")
;(setq wl-draft-send-func 'wl-draft-send-with-imput-async)
;; Mail-Followup-To と Mail-Reply-To を自動的に変更する(付ける)
(defun wl-ml-draft-config-func ()
(wl-draft-replace-field
"Mail-Followup-To" (wl-match-buffer
1) t)
(wl-draft-replace-field
"Mail-Reply-To" (wl-address-header-extract-address
wl-from) t))
;; メールの返信時に宛先を付ける方針の設定
;; 下記変数の alist の要素
;; ('返信元に存在するフィールド' .
;; ('Toフィールド' 'Ccフィールド' 'Newsgroupsフィールド'))
;; "a" (without-argument)では Reply-To
や From などで指定された唯一人
;; または唯一つの投稿先に返信する。また,X-ML-Name
と Reply-To がつい
;; ているなら Reply-To 宛にする。
; (setq wl-draft-reply-without-argument-list
; '((("X-ML-Name" "Reply-To")
. (("Reply-To") nil nil))
; ("X-ML-Name" . (("To"
"Cc") nil nil))
; ("Followup-To" . (nil nil ("Followup-To")))
; ("Newsgroups" . (nil nil ("Newsgroups")))
; ("Reply-To" . (("Reply-To")
nil nil))
; ("Mail-Reply-To" . (("Mail-Reply-To")
nil nil))
; ("From" . (("From")
nil nil))))
;
;; "C-u a" (with-argument)であれば関係する全ての人・投稿先に返信する。
; (setq wl-draft-reply-with-argument-list
; '(("Followup-To" . (("From")
nil ("Followup-To")))
; ("Newsgroups" . (("From")
nil ("Newsgroups")))
; ("Mail-Followup-To" . (("Mail-Followup-To")
nil ("Newsgroups")))
; ("From" . (("From")
("To" "Cc") ("Newsgroups")))))
;; X-Face を表示する (要 x-face (and x-face-mule))
;(when (and window-system
; (module-installed-p 'x-face))
; (cond (wl-on-xemacs ;; for XEmacs
; (autoload 'x-face-xmas-mew-display-x-face
"x-face" nil t)
; (setq wl-highlight-x-face-func
; 'x-face-xmas-mew-display-x-face))
; ((module-installed-p 'x-face-mule) ;; for
Mule (GNU Emacs)
; ;; x-face-mule 0.20以後
; (setq wl-highlight-x-face-func
; (function
; (lambda (beg end)
; (x-face-mule-x-face-decode-message-header
beg end))))
; (setq x-face-mule-highlight-x-face-style
'xmas)
; (require 'x-face-mule)
; )))
;; Refile(リファイル)
;; WL と mew でリファイル はいっしょ
;;もし参考にされるんでしたらしたのメールの振り分けの書き方を真似してみてください。
;(wl-summary-auto-refile)
;(setq wl-summary-auto-refile-skip-marks
nil)
;(setq elmo-msgdb-extra-fields
;'("x-ml-name"
;"X-ML-Name"
;"X-Mailing-List"
;"x-mailing-list"
;"X-Loop"
; "newsgroup"
;"x-loop"))
(setq wl-refile-rule-alist
'(
;("To"
;("impress-direct-customers@ips.co.jp"
. "+impress")
;("cyberflash-readers@newsboy.jal.co.jp"
. "+JCF")
;("ind_all@jdc.sun.co.jp" . "+sdc")
;("ASP@ml.users.gr.jp" . "+asp")
;("cgi-lst@y7.net" . "+cgi")
;("DHTML@ml.users.gr.jp" . "+DHTML")
;("xmluser@xml.gr.jp" . "+xml-users")
;("mew-dist@mew.org" . "+mew-dist")
;("meadow-users-jp@meadowy.org"
. "+meadow")
;("fml-support@ffs.fml.org" . "+fml")
;("cgi-lst@y7.net" . "+cgi")
;("mew-win32@Mew.org" . "+mew-win32")
;("apache@ecc.u-tokyo.ac.jp" .
"+apache")
;("kakasi-dev@namazu.org" . "+kakasi")
;("namazu-users-ja@namazu.org"
. "+namazu-users")
;("q-beginners@kita-q.com" . "+qmail-beinner")
;("redhat@sl.sakura.ne.jp" . "+redhat")
;("linux-users@" . "+linux-users")
;("rakuten.co.jp" . "+rakuten")
;("wl@" . "+wanderlust")
;("sofmap.co.jp" . "+sofmap")
;("sdcind@jdc.sun.co.jp" . "+SDC")
;("dbi-japan@" . "+dbi-japan")
;("apache-users@" . "+apache-users")
;)
;("CC"
;("impress-direct-customers@ips.co.jp"
. "+impress")
;("cyberflash-readers@newsboy.jal.co.jp"
. "+JCF")
;("ind_all@jdc.sun.co.jp" . "+sdc")
;("ASP@ml.users.gr.jp" . "+asp")
;("cgi-lst@y7.net" . "+cgi")
;("DHTML@ml.users.gr.jp" . "+DHTML")
;("xmluser@xml.gr.jp" . "+xml-users")
;("mew-dist@mew.org" . "+mew-dist")
;("meadow-users-jp@meadowy.org"
. "+meadow")
;("fml-support@ffs.fml.org" . "+fml")
;("cgi-lst@y7.net" . "+cgi")
;("mew-win32@Mew.org" . "+mew-win32")
;("apache@ecc.u-tokyo.ac.jp" .
"+apache")
;("kakasi-dev@namazu.org" . "+kakasi")
;("namazu-users-ja@namazu.org"
. "+namazu-users")
;("q-beginners@kita-q.com" . "+qmail-beinner")
;("redhat@sl.sakura.ne.jp" . "+redhat")
;("linux-users@" . "+linux-users")
;("rakuten.co.jp" . "+rakuten")
;("wl@" . "+wanderlust")
;("sofmap.co.jp" . "+sofmap")
;("sdcind@jdc.sun.co.jp" . "+SDC")
;("dbi-japan@" . "+dbi-japan")
;("apache-users@" . "+apache-users")
;)
;("From"
;("iland@yk.rim.or.jp" . "+iland")
;("DI-upgradecenter@sony.co.jp"
. "+sony")
;("hannsui_spnews@sofmap.co.jp"
. "+sofmap")
;("rakuten.co.jp" . "+rakuten")
;("yamamoto@admin.gokinjo.net"
. "+GOKINJO")
;("news@hotwired.co.jp" . "+hotwired")
;("magazine@linuxml.net" . "+linux")
;("market@planex.co.jp" . "+PCI")
;("dmservice@hisago.co.jp" . "+hisago")
;("mori@pool.co.jp" . "+kamenosuke")
;("sofmap.com" . "+sofmap")
;("linux-users@" . "+sofmap")
;)
;("Subject"
;("mag2" . "+mag2")
;("solaris-packages" . "+solpackage")
;)
;))
;(wl-summary-auto-refile)
;ML名やカウント数も表示させる
;===================ここから================-
(setq elmo-msgdb-extra-fields
'("x-ml-name" "x-mail-count"
"x-ml-count" "x-sequence"))
(defun TT:wl-summary-subject-func (subject-string)
(let ((folder wl-summary-buffer-folder-name)
(subj subject-string)
(sequence) (ml-name) (ml-count))
(if (boundp 'entity)
(setq sequence (elmo-msgdb-overview-entity-get-extra-field
entity "x-sequence")
ml-name (or (elmo-msgdb-overview-entity-get-extra-field
entity "x-ml-name")
(and sequence
(car (split-string sequence " "))))
ml-count (or (elmo-msgdb-overview-entity-get-extra-field
entity "x-mail-count")
(elmo-msgdb-overview-entity-get-extra-field
entity "x-ml-count")
(and sequence
(cadr (split-string sequence " "))))))
;; もとからついてる ML名 等を除去
(if (string-match
"^\\(\\[\\|(\\)\\(.+\\)[ :]\\([0-9]+\\)\\(\\]\\|)\\)[
\t]+"
subject-string)
(progn
(setq subj (substring subject-string (match-end
0)))
(if (not ml-name) (setq ml-name (match-string
2 subject-string)))
(if (not ml-count) (setq ml-count (match-string
3 subject-string)))))
;; extra-field から取得した data を付加
(if (and ml-name ml-count)
(if (string= folder wl-default-folder)
(format "(%s %05d) %s"
(car (split-string ml-name " "))
(string-to-int ml-count)
subj)
(format "#%05d %s"
(string-to-int ml-count) subj))
subj)))
(setq wl-summary-subject-func 'TT:wl-summary-subject-func)
;===============ここまで====================