From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/45078 Path: main.gmane.org!not-for-mail From: David S Goldberg Newsgroups: gmane.emacs.gnus.general Subject: Re: Two gnus-posting-styles problems Date: Mon, 03 Jun 2002 11:36:54 -0400 Organization: I Yam What I Yam Sender: owner-ding@hpc.uh.edu Message-ID: References: NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1023118702 22095 127.0.0.1 (3 Jun 2002 15:38:22 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 3 Jun 2002 15:38:22 +0000 (UTC) Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 17EtuX-0005kA-00 for ; Mon, 03 Jun 2002 17:38:22 +0200 Original-Received: from sina.hpc.uh.edu ([129.7.128.10] ident=lists) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 17Ettf-0006gT-00; Mon, 03 Jun 2002 10:37:27 -0500 Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Mon, 03 Jun 2002 10:37:45 -0500 (CDT) Original-Received: from sclp3.sclp.com (qmailr@sclp3.sclp.com [209.196.61.66]) by sina.hpc.uh.edu (8.9.3/8.9.3) with SMTP id KAA29484 for ; Mon, 3 Jun 2002 10:37:31 -0500 (CDT) Original-Received: (qmail 8260 invoked by alias); 3 Jun 2002 15:37:09 -0000 Original-Received: (qmail 8255 invoked from network); 3 Jun 2002 15:37:09 -0000 Original-Received: from smtpproxy1.mitre.org (192.160.51.75) by gnus.org with SMTP; 3 Jun 2002 15:37:09 -0000 Original-Received: from avsrv1.mitre.org (avsrv1.mitre.org [129.83.20.58]) by smtpproxy1.mitre.org (8.11.3/8.11.3) with ESMTP id g53Fb5x21671 for ; Mon, 3 Jun 2002 11:37:06 -0400 (EDT) Original-Received: from MAILHUB2 (mailhub2.mitre.org [129.83.221.18]) by smtpsrv1.mitre.org (8.11.3/8.11.3) with ESMTP id g53Fb3825879 for ; Mon, 3 Jun 2002 11:37:04 -0400 (EDT) Original-Received: from mm107410-2k.mitre.org (129.83.3.29) by mailhub2.mitre.org with SMTP id 10404435; Mon, 03 Jun 2002 11:36:56 -0400 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: (Hrvoje Niksic's message of "Mon, 03 Jun 2002 16:55:31 +0200") Original-Lines: 114 User-Agent: Gnus/5.090007 (Oort Gnus v0.07) XEmacs/21.4 (Common Lisp, i686-pc-cygwin) Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:45078 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:45078 I ran into this ages ago and came up with this, which is very convoluted, but works around the problem reasonably well. Much as I love programming in lisp, I don't consider myself very good at it, so while this may be an appropriate framework, it could probably do with some optimization. (gnus-article-reply (signature-file (let* ((net-from (save-excursion (set-buffer gnus-article-buffer) (car (cdr (mail-extract-address-components (message-fetch-field "From")))))) (net-to (save-excursion (set-buffer gnus-article-buffer) (or (message-fetch-field "to") ""))) (net-cc (save-excursion (set-buffer gnus-article-buffer) (or (message-fetch-field "cc") ""))) (rec (car (bbdb-search (bbdb-records) nil nil net-from nil nil))) (sig (if rec (bbdb-record-getprop rec 'signature)))) (cond ((and (string-match "@.*\\.?mitre\\.org" net-from) (or (string-match "dsg@.*\\.?mitre\\.org" net-to) (string-match "dsg@.*\\.?mitre\\.org" net-cc))) "~/.signature-mitre-i") ((or (string-match "dsg@.*\\.?mitre\\.org" net-to) (string-match "dsg@.*\\.?mitre\\.org" net-cc)) "~/.signature-mitre") (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") ((string-match "nnml:missedmail" (or gnus-newsgroup-name "")) "~/.signature-personal") (t "~/.signature-mitre")))) (address (let* ((net-from (save-excursion (set-buffer gnus-article-buffer) (car (cdr (mail-extract-address-components (message-fetch-field "From")))))) (net-to (save-excursion (set-buffer gnus-article-buffer) (or (message-fetch-field "to") ""))) (net-cc (save-excursion (set-buffer gnus-article-buffer) (or (message-fetch-field "cc") ""))) (rec (car (bbdb-search (bbdb-records) nil nil net-from nil nil))) (mail-from (if rec (bbdb-record-getprop rec 'mail-from)))) (cond ((or (string-match "dsg@.*\\.?mitre\\.org" net-to) (string-match "dsg@.*\\.?mitre\\.org" net-cc)) ,dsg-mitre-address) (mail-from mail-from) ((string-match ".*:.*personal.*" (or gnus-newsgroup-name "")) ,dsg-personal-address) ((string-match ".*emacs.*" (or gnus-newsgroup-name "")) ,dsg-personal-address) ((string-match ".*fvwm.*" (or gnus-newsgroup-name "")) ,dsg-personal-address) ((string-match "nnml:missedmail" (or gnus-newsgroup-name "")) ,dsg-personal-address) (t ,dsg-mitre-address))))) -- Dave Goldberg david.goldberg6@verizon.net