Gnus development mailing list
 help / color / mirror / Atom feed
* Re: matching headers with gnus-posting-styles
@ 2000-12-21 20:10 lewst
  2000-12-21 20:31 ` Charles Sebold
  0 siblings, 1 reply; 7+ messages in thread
From: lewst @ 2000-12-21 20:10 UTC (permalink / raw)
  Cc: DING

Nick Papadonis <nick@coelacanth.com> wrote:

> I had the same problem with this.  I spent 3 hours trying to figure
> out what was wrong.  If you can figure out how to post based on header
> information let me know.

Perhaps this is a bug in Gnus then.

Has *anyone* gotten this to work?


__________________________________________________
Do You Yahoo!?
Yahoo! Shopping - Thousands of Stores. Millions of Products.
http://shopping.yahoo.com/



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: matching headers with gnus-posting-styles
  2000-12-21 20:10 matching headers with gnus-posting-styles lewst
@ 2000-12-21 20:31 ` Charles Sebold
  0 siblings, 0 replies; 7+ messages in thread
From: Charles Sebold @ 2000-12-21 20:31 UTC (permalink / raw)


On 24 Kislev 5761, lewst@yahoo.com wrote:

>> I had the same problem with this.  I spent 3 hours trying to figure
>> out what was wrong.  If you can figure out how to post based on
>> header information let me know.
> 
> Perhaps this is a bug in Gnus then.
> 
> Has *anyone* gotten this to work?

I never succeeded; I ended up splitting based on headers and then
setting up posting-styles based on the group.  For the most part, this
is sufficient for me, but I am sure it isn't for many people.
-- 
Charles Sebold
--
24th of Kislev, 5761
--
I've had a perfectly wonderful evening.  But this wasn't it.
		-- Groucho Marx



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: matching headers with gnus-posting-styles
  2000-12-21 20:34 ` ShengHuo ZHU
@ 2000-12-21 21:59   ` Kai Großjohann
  0 siblings, 0 replies; 7+ messages in thread
From: Kai Großjohann @ 2000-12-21 21:59 UTC (permalink / raw)
  Cc: ding

On 21 Dec 2000, ShengHuo ZHU wrote:

> Some packages are written for modifying your mail when sending.  But
> I can not remember what they are.

I remember gnus-pers.el but I forgot the author, and there is
header-action.el by Holger Schauer.  I'm sure I missed some packages.

Isn't there a variable which you can frob so that it asks you for the
To and Subject header in the minibuffer?  I wonder if it helps to let
Gnus do that, maybe the posting styles then have access to those
headers, because they might be entered before the posting styles are
evaluated.

kai
-- 
~/.signature



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: matching headers with gnus-posting-styles
  2000-12-21 19:57 ` Nick Papadonis
@ 2000-12-21 20:52   ` David S. Goldberg
  0 siblings, 0 replies; 7+ messages in thread
From: David S. Goldberg @ 2000-12-21 20:52 UTC (permalink / raw)


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



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: matching headers with gnus-posting-styles
  2000-12-21 19:15 lewst
  2000-12-21 19:57 ` Nick Papadonis
@ 2000-12-21 20:34 ` ShengHuo ZHU
  2000-12-21 21:59   ` Kai Großjohann
  1 sibling, 1 reply; 7+ messages in thread
From: ShengHuo ZHU @ 2000-12-21 20:34 UTC (permalink / raw)


lewst <lewst@yahoo.com> writes:

> Greetings,
> 
> The following posting style isn't working for me:
> 
> (setq gnus-posting-styles
>       '((".*"
>          (signature-file "~/.signature"))
>         (header "^\\(To\\|CC\\|Cc\\):.*" ".*sourceforge.net"
>          (signature-file "~/.signature-sf"))))
> 
> What I'm trying to do is change my .signature based on who I'm sending
> a mail message to.  So, if the address in the To: or Cc: headers has
> "sourceforge.net" in it, I'd like to use .signature-sf instead.
> 
> With the above, I always get just ".signature" no matter who I'm
> sending to.  What am I doing wrong?

gnus-posting-styles is only applied before you start to compose a
mail.  Any modification after that has no effect on the your mail.
Therefore, Gnus will not change the signature according to who you are
sending to.  Though `header' is documented, I don't think it is right.

Some packages are written for modifying your mail when sending.  But I
can not remember what they are.

ShengHuo



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: matching headers with gnus-posting-styles
  2000-12-21 19:15 lewst
@ 2000-12-21 19:57 ` Nick Papadonis
  2000-12-21 20:52   ` David S. Goldberg
  2000-12-21 20:34 ` ShengHuo ZHU
  1 sibling, 1 reply; 7+ messages in thread
From: Nick Papadonis @ 2000-12-21 19:57 UTC (permalink / raw)
  Cc: DING

I had the same problem with this.  I spent 3 hours trying to figure
out what was wrong.  If you can figure out how to post based on header
information let me know.

I was trying to change my From: field based on the To: field of the message.

GNUS v.5.8.8 Xemacs 21.1.12
>>>>> "lewst" == lewst  <lewst@yahoo.com> writes:

    > Greetings, The following posting style isn't working for me:

    > (setq gnus-posting-styles '((".*" (signature-file
    > "~/.signature")) (header "^\\(To\\|CC\\|Cc\\):.*"
    > ".*sourceforge.net" (signature-file "~/.signature-sf"))))

    > What I'm trying to do is change my .signature based on who I'm
    > sending a mail message to.  So, if the address in the To: or Cc:
    > headers has "sourceforge.net" in it, I'd like to use
    > .signature-sf instead.

    > With the above, I always get just ".signature" no matter who I'm
    > sending to.  What am I doing wrong?


    > __________________________________________________ Do You
    > Yahoo!?  Yahoo! Shopping - Thousands of Stores. Millions of
    > Products.  http://shopping.yahoo.com/


-- 
- Nick



^ permalink raw reply	[flat|nested] 7+ messages in thread

* matching headers with gnus-posting-styles
@ 2000-12-21 19:15 lewst
  2000-12-21 19:57 ` Nick Papadonis
  2000-12-21 20:34 ` ShengHuo ZHU
  0 siblings, 2 replies; 7+ messages in thread
From: lewst @ 2000-12-21 19:15 UTC (permalink / raw)


Greetings,

The following posting style isn't working for me:

(setq gnus-posting-styles
      '((".*"
         (signature-file "~/.signature"))
        (header "^\\(To\\|CC\\|Cc\\):.*" ".*sourceforge.net"
         (signature-file "~/.signature-sf"))))

What I'm trying to do is change my .signature based on who I'm sending
a mail message to.  So, if the address in the To: or Cc: headers has
"sourceforge.net" in it, I'd like to use .signature-sf instead.

With the above, I always get just ".signature" no matter who I'm
sending to.  What am I doing wrong?


__________________________________________________
Do You Yahoo!?
Yahoo! Shopping - Thousands of Stores. Millions of Products.
http://shopping.yahoo.com/



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2000-12-21 21:59 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-12-21 20:10 matching headers with gnus-posting-styles lewst
2000-12-21 20:31 ` Charles Sebold
  -- strict thread matches above, loose matches on Subject: below --
2000-12-21 19:15 lewst
2000-12-21 19:57 ` Nick Papadonis
2000-12-21 20:52   ` David S. Goldberg
2000-12-21 20:34 ` ShengHuo ZHU
2000-12-21 21:59   ` Kai Großjohann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).