]> git.cworth.org Git - notmuch-wiki/commitdiff
Add notes on using gnus-alias with notmuch
authorSvend Sorensen <svend@ciffer.net>
Sun, 10 Jun 2012 22:02:09 +0000 (15:02 -0700)
committerSvend Sorensen <svend@ciffer.net>
Sun, 10 Jun 2012 22:02:09 +0000 (15:02 -0700)
emacstips.mdwn

index 18f1c66540de47ee08f9a5848553fb921a29d784..074c593dfa27286c12a67b67f553bbe69a6f509f 100644 (file)
@@ -459,3 +459,37 @@ part.
   2011-02-02.  Note that if you have the Debian package easypg
   installed, it will shadow the fixed version of easypg included with
   emacs.
+
+## Multiple identities using gnus-alias
+
+gnus-alias allows you to define multiple identities when using
+message-mode. You can specify the from address, organization, extra
+headers (including Bcc), extra body text, and signature for each
+identity. Identities are chosen based on a set of rules. When you are
+in message mode, you can switch identities using gnus-alias.
+
+Here is an example configuration.
+
+        ;; Define two identities, "home" and "work"
+        (setq gnus-alias-identity-alist
+              '(("home"
+                nil ;; Does not refer to any other identity
+                "John Doe <jdoe@example.net>"
+                nil ;; No organization header
+                nil ;; No extra headers
+                nil ;; No extra body text
+                "~/.signature")
+               ("work"
+                nil
+                "John Doe <john.doe@example.com>"
+                "Example Corp."
+                (("Bcc"        .       "john.doe@example.com"))
+                nil
+                "~/.signature.work")))
+        ;; Use "home" identity by default
+        (setq gnus-alias-default-identity "home")
+        ;; Define rules to match work identity
+        (setq gnus-alias-identity-rules
+              '(("work" ("any" "john.doe@\\(example\\.com\\|help\\.example.com\\)" both) "work"))
+        ;; Determine identity when message-mode loads
+        (add-hook 'message-setup-hook 'gnus-alias-determine-identity)