From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/33840 Path: main.gmane.org!not-for-mail From: dsg@world.std.com (David S. Goldberg) Newsgroups: gmane.emacs.gnus.general Subject: Re: matching headers with gnus-posting-styles Date: 21 Dec 2000 15:52:32 -0500 Sender: owner-ding@hpc.uh.edu Message-ID: References: <20001221191503.10216.qmail@web2103.mail.yahoo.com> NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1035169871 27237 80.91.224.250 (21 Oct 2002 03:11:11 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 03:11:11 +0000 (UTC) Return-Path: Original-Received: from spinoza.math.uh.edu (spinoza.math.uh.edu [129.7.128.18]) by mailhost.sclp.com (Postfix) with ESMTP id 99E63D04A1 for ; Thu, 21 Dec 2000 15:53:20 -0500 (EST) Original-Received: from sina.hpc.uh.edu (lists@Sina.HPC.UH.EDU [129.7.3.5]) by spinoza.math.uh.edu (8.9.1/8.9.1) with ESMTP id OAB26791; Thu, 21 Dec 2000 14:53:06 -0600 (CST) Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Thu, 21 Dec 2000 14:52:28 -0600 (CST) Original-Received: from mailhost.sclp.com (postfix@66-209.196.61.interliant.com [209.196.61.66] (may be forged)) by sina.hpc.uh.edu (8.9.3/8.9.3) with ESMTP id OAA15706 for ; Thu, 21 Dec 2000 14:52:15 -0600 (CST) Original-Received: from smtpproxy1.mitre.org (mb-20-100.mitre.org [129.83.20.100]) by mailhost.sclp.com (Postfix) with ESMTP id 26A65D049D for ; Thu, 21 Dec 2000 15:52:38 -0500 (EST) Original-Received: from avsrv1.mitre.org (avsrv1.mitre.org [129.83.20.58]) by smtpproxy1.mitre.org (8.9.3/8.9.3) with ESMTP id PAA09211 for ; Thu, 21 Dec 2000 15:52:35 -0500 (EST) Original-Received: from linus.mitre.org (linus.mitre.org [129.83.10.1]) by smtpsrv1.mitre.org (8.9.3/8.9.3) with ESMTP id PAA26240 for ; Thu, 21 Dec 2000 15:52:34 -0500 (EST) Original-Received: from blackbird.mitre.org (blackbird.mitre.org [129.83.10.221]) by linus.mitre.org (8.9.3/8.9.3) with ESMTP id PAA15168 for ; Thu, 21 Dec 2000 15:52:33 -0500 (EST) Original-Received: (from dsg@localhost) by blackbird.mitre.org (8.9.3/8.9.3) id PAA18898; Thu, 21 Dec 2000 15:52:33 -0500 (EST) X-Authentication-Warning: blackbird.mitre.org: dsg set sender to dsg@mitre.org using -f 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 Original-Lines: 64 Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:33840 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:33840 posting-styles is applied before (well, while) the message buffer is generated. In general that means the To: header will not be filled in during processing of posting-styles. To do what you want you either want one of the addons that sets headers after the fact (search through the list archives; I don't use them) or, for a reply, here's an example from my gnus-posting-styles that works (mostly) for me. This may be over complicated with all the bbdb stuff; feel free to mail me direct if you have questions about it. Be aware, though, that I might not be able to reply for a while... (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 ".*:.*personal.*" (or gnus-newsgroup-name "")) "~/.signature-personal") ((string-match ".*emacs.*" (or gnus-newsgroup-name "")) "~/.signature-personal") ((string-match ".*fvwm.*" (or gnus-newsgroup-name "")) "~/.signature-personal") (t "~/.signature-work")))) ("From" (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))) (mail-from (if rec (bbdb-record-getprop rec 'mail-from)))) (cond (mail-from mail-from) ((string-match ".*:.*personal.*" (or gnus-newsgroup-name "")) "dsg@world.std.com (David S. Goldberg)") ((string-match ".*emacs.*" (or gnus-newsgroup-name "")) "dsg@world.std.com (David S. Goldberg)") (t (concat user-mail-address " (David S. Goldberg)")))))) -- Dave Goldberg dsg@world.std.com