From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/26973 Path: main.gmane.org!not-for-mail From: dsg@mitre.org (David S. Goldberg) Newsgroups: gmane.emacs.gnus.general Subject: Re: Message access from gnus-posting-styles? Date: 16 Nov 1999 12:53:39 -0500 Sender: owner-ding@hpc.uh.edu Message-ID: References: <3182-Tue16Nov1999103748-0500-ndw@nwalsh.com> NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1035164081 22175 80.91.224.250 (21 Oct 2002 01:34:41 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 01:34:41 +0000 (UTC) Return-Path: Original-Received: from bart.math.uh.edu (bart.math.uh.edu [129.7.128.48]) by sclp3.sclp.com (8.8.5/8.8.5) with ESMTP id MAA02954 for ; Tue, 16 Nov 1999 12:54:45 -0500 (EST) Original-Received: from sina.hpc.uh.edu (lists@Sina.HPC.UH.EDU [129.7.3.5]) by bart.math.uh.edu (8.9.1/8.9.1) with ESMTP id LAB02991; Tue, 16 Nov 1999 11:54:35 -0600 (CST) Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Tue, 16 Nov 1999 11:54:22 -0600 (CST) Original-Received: from sclp3.sclp.com (root@sclp3.sclp.com [204.252.123.139]) by sina.hpc.uh.edu (8.9.3/8.9.3) with ESMTP id LAA21598 for ; Tue, 16 Nov 1999 11:54:10 -0600 (CST) Original-Received: from linus.mitre.org (linus.mitre.org [129.83.10.1]) by sclp3.sclp.com (8.8.5/8.8.5) with ESMTP id MAA02926 for ; Tue, 16 Nov 1999 12:53:41 -0500 (EST) Original-Received: from blackbird.mitre.org (blackbird [129.83.65.14]) by linus.mitre.org (8.8.7/8.8.7) with ESMTP id MAA00720 for ; Tue, 16 Nov 1999 12:53:39 -0500 (EST) Original-Received: (from dsg@localhost) by blackbird.mitre.org (8.8.7/8.8.7) id MAA02603; Tue, 16 Nov 1999 12:53:39 -0500 (EST) Mail-Copies-To: never Original-To: The Gnus Mailing List X-Face: GUaHTH@nS>[7,ME@-gYZ4#Wl{z"99k@[[Y8AcP0x1paqu.,z9,XSV1WI>{q3f6^e5(zrit <4fV&VHhmE`uidRqtmG27;si9&r;#KSF~E#$%W8w(xdp)H4tW=\2XOk~3=@oGqqpj;m4xf Ow;y26396&,34@9#~4;@*S;E0cq"LM9N(us4P%F(Nxis'Vvfm9?KufH;:Q$dMa-QWGLR&K d0`LJZE8xb*>^yN>b]_NcU:E=Zn\1=#/(OS2 In-Reply-To: Norman Walsh's message of "Tue, 16 Nov 1999 10:37:48 -0500" Original-Lines: 54 User-Agent: Gnus/5.070098 (Pterodactyl Gnus v0.98) XEmacs/21.1 (Biscayne) Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:26973 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:26973 > In particular, can I get access to the headers? If the message is > being created as a reply, can I get the address(es) of the > recipients of the message? > They don't appear to be in the current buffer when mail-signature is > called, but I might have missed something. They're not, but that doesn't mean you can't get them... Here's a snippet from my gnus-posting-styles that should give you an idea of how to do what you want: (gnus-article-reply (signature-file (let* ((net (save-excursion (set-buffer gnus-article-buffer) (car (cdr (mail-extract-address-components (message-fetch-field "From")))))) (rec (car (bbdb-search (bbdb-records) nil nil net nil nil))) (sig (if rec (bbdb-record-getprop rec 'signature)))) (cond (sig sig) ((string-match "@.*\\.?mitre\\.org" net) "~/.signature-mitre-i") ((string-match "nnml:personal.*" gnus-newsgroup-name) "~/.signature-personal") (t "~/.signature-mitre")))) What does it do? If the message is a reply (that's the gnus-article-reply part), set signature file in a particular way. It goes to the article buffer and gets the From line (who I'm replying to; I ignore Reply-To for this purpose; haven't been burned yet, but I know it will happen :-) Then I look for that person in my bbdb. If I find her, I look for a signature-file record in bbdb. If there is one I use it, otherwise I set signature file based on whether the person is someone I work with or if the gnusgroup is one I use for non-work mail and finally, if all else fails, I put my work address in the sig. I do have to change that last one by hand occasionally, but haven't come up with a perfect formula for determining it otherwise. Hope this helps, -- Dave Goldberg Post: The Mitre Corporation\MS B325\202 Burlington Rd.\Bedford, MA 01730 Phone: 781-271-3887 Email: dsg@mitre.org