Gnus development mailing list
 help / color / mirror / Atom feed
* Header dependant headers?
@ 1998-03-13 12:44 Edvard Majakari
  1998-03-13 23:21 ` Paul Franklin
  0 siblings, 1 reply; 5+ messages in thread
From: Edvard Majakari @ 1998-03-13 12:44 UTC (permalink / raw)



Feature suggestion. The Ultimate Tool(TM) in Gnus? If a mail message
contains some header (rexexp), it inserts/changes some headers in
reply. Main reason for this is that when some people send me mail via
cc: header, they fail to include reply-to header pointing to the
list.. what I was thinking was something like

(gnus-magic-header-include
  ("rexexp_matching_some_header" "foo")
)

Which would include header foo to reply or change header to foo if it
already existed. Like, suppose you'd want to include header Reply-to:
foo@baf.org to any mails pointed to ding.* mailing lists when
replying. You'd say something like

(gnus-magic-header-include
  ("To: ding@.*" "Reply-To: foo@baf.org")
)

-- 
//Ed               GSM: 040 5960810     URL: http://lodge.ton.tut.fi/%7Eed/
in hoc cognoscent omnes quia mei discipuli estis si dilectionem
habueritis ad invicem
 -- John 13:35


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

* Re: Header dependant headers?
  1998-03-13 12:44 Header dependant headers? Edvard Majakari
@ 1998-03-13 23:21 ` Paul Franklin
  1998-03-16 12:16   ` Edvard Majakari
  0 siblings, 1 reply; 5+ messages in thread
From: Paul Franklin @ 1998-03-13 23:21 UTC (permalink / raw)


I'm sure there's some hook you can use for this, but gnus already
includes a nice mechanism for handling followups & postings to mailing
lists.

All you have to do is to split each list into a separate group; then
just add this group parameter:
  (to-address . "ding@gnus.org")
It also works for groups you read via NNTP but are gatewayed from an
email list and you want to followup to the email list (SMTP) instead
of the newsgroup (NNTP).

--Paul

>>>>> Edvard Majakari writes:

 > Feature suggestion. The Ultimate Tool(TM) in Gnus? If a mail message
 > contains some header (rexexp), it inserts/changes some headers in
 > reply. Main reason for this is that when some people send me mail via
 > cc: header, they fail to include reply-to header pointing to the
 > list.. what I was thinking was something like

 > (gnus-magic-header-include
 >   ("rexexp_matching_some_header" "foo")
 > )

 > Which would include header foo to reply or change header to foo if it
 > already existed. Like, suppose you'd want to include header Reply-to:
 > foo@baf.org to any mails pointed to ding.* mailing lists when
 > replying. You'd say something like

 > (gnus-magic-header-include
 >   ("To: ding@.*" "Reply-To: foo@baf.org")
 > )


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

* Re: Header dependant headers?
  1998-03-13 23:21 ` Paul Franklin
@ 1998-03-16 12:16   ` Edvard Majakari
  1998-03-21 19:21     ` Hans de Graaff
  0 siblings, 1 reply; 5+ messages in thread
From: Edvard Majakari @ 1998-03-16 12:16 UTC (permalink / raw)


>>>>> "Paul" == Paul Franklin <paul@cs.washington.edu> writes:

One more thing about Group parameters:

 Paul> All you have to do is to split each list into a separate group;
 Paul> then just add this group parameter: (to-address
 Paul> . "ding@gnus.org") It also works for groups you read via NNTP
 Paul> but are gatewayed from an email list and you want to followup

Works fine, yep; but that won't allow me to include custom Reply-To
header when answering mails in that group. I'd need one for my work,
so I think I just have to write a hook for that, and call it from
Group Parameters?

-- 
//Ed               GSM: 040 5960810     URL: http://lodge.ton.tut.fi/%7Eed/
Lispers are among the best grads of the Sweep-It-Under-Someone-Else's-Carpet
School of Simulated Simplicity.  [Was that sufficiently incendiary?  :-)]
         --Larry Wall in <1992Jan10.201804.11926@netlabs.com


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

* Re: Header dependant headers?
  1998-03-16 12:16   ` Edvard Majakari
@ 1998-03-21 19:21     ` Hans de Graaff
  1998-03-23 13:23       ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 5+ messages in thread
From: Hans de Graaff @ 1998-03-21 19:21 UTC (permalink / raw)


Edvard Majakari <ed@a41a.otanner.ton.tut.fi> writes:

> Works fine, yep; but that won't allow me to include custom Reply-To
> header when answering mails in that group. I'd need one for my work,
> so I think I just have to write a hook for that, and call it from
> Group Parameters?

I use the following, which kinda works but also has some problems. I
originally got something like it from the newsgroup, but I forgot to
save the name. Since then I've ripped it apart myself to better suit
what I wanted.

Comments, etc, are welcome. I'm not a lisp hacker by any standard, but 
I would like to see some kind of customization of all headers
based on characteristics. (In my case below the group I'm in).

Which reminds me: Lars, there is only an nnml-current-group, but there 
is no such thing for nntp groups. Shouldn't there be a
gnus-current-group variable?

Hans





;; JJDG: Got this off of gnu.emacs.gnus, not sure who wrote it...
;; Hacked it so that naming is more safe, ripped out signature stuff, 
;; since I don't need it, and also allow outgoing mail to be customized 
;; based on To: header.

(setq jjdg-postspecs
      '(("mail.forum" .
	 ((headers . "Reply-To: forum@graaff.xs4all.nl\nOrganization: Forum Distribution, Main Branch\n"))
         )
	("\\(list\\.\\(chi\\.\\|ui-patterns\\).*\\|mail\\.acm\\..*\\)" .
	 ((headers . "From: Hans de Graaff <j.j.degraaff@acm.org>\n")))
	(t .
           ((headers . "From: Hans de Graaff <graaff@xs4all.nl>\n")))
	))

(defun jjdg-find-postspec (speclist groups)
  (cond ((null speclist) nil)
        ((null groups) (cdr-safe (assq t speclist)))
        (t (let ((spec (car speclist)))
	     (if (or (eq t (car spec)) (string-match (car spec) groups))
                 (cdr spec)
               (jjdg-find-postspec (cdr speclist) groups))))
        ))


(defun jjdg-electric-from (header-alist)
;  (let* ((groups        (or (cdr-safe (assq 'Newsgroups header-alist))
;			    (cdr-safe (assq 'To header-alist))))
  (let* ((groups        nnml-current-group)
         (postspec      (jjdg-find-postspec jjdg-postspecs groups))
         (headers       (cdr-safe (assq 'headers postspec))))
    (if headers
        (save-excursion
          (goto-char (point-min))
          (insert headers)))
  ))


(add-hook 'message-signature-setup-hook 
          (lambda () (jjdg-electric-from headers)))


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

* Re: Header dependant headers?
  1998-03-21 19:21     ` Hans de Graaff
@ 1998-03-23 13:23       ` Lars Magne Ingebrigtsen
  0 siblings, 0 replies; 5+ messages in thread
From: Lars Magne Ingebrigtsen @ 1998-03-23 13:23 UTC (permalink / raw)


Hans de Graaff <graaff@xs4all.nl> writes:

> Which reminds me: Lars, there is only an nnml-current-group, but there 
> is no such thing for nntp groups. Shouldn't there be a
> gnus-current-group variable?

`gnus-newsgroup-name'.

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen


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

end of thread, other threads:[~1998-03-23 13:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-03-13 12:44 Header dependant headers? Edvard Majakari
1998-03-13 23:21 ` Paul Franklin
1998-03-16 12:16   ` Edvard Majakari
1998-03-21 19:21     ` Hans de Graaff
1998-03-23 13:23       ` Lars Magne Ingebrigtsen

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).