Gnus development mailing list
 help / color / mirror / Atom feed
* Always copying a mailing list
@ 2004-08-02 12:33 Kai Grossjohann
  2004-08-02 13:29 ` David S Goldberg
  2004-08-04  8:15 ` Reiner Steib
  0 siblings, 2 replies; 3+ messages in thread
From: Kai Grossjohann @ 2004-08-02 12:33 UTC (permalink / raw)


I can set mail-self-blind to get "Bcc: kais.address" in outgoing
messages.  But I have a special group where I'd rather like to have
"Cc: some.mailinglist".

I've tried to frob the posting style for the group, saying (("Gcc" .
nil) ("Cc" . "some.mailinglist")).  But this does not work as I like,
because it also removes other recipients that I would like to keep.

The behavior I'm looking for is: After I've hit R or F (or S W or S
V), add the following address to the list of recipients if not yet
present.

How to do that?

Kai



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

* Re: Always copying a mailing list
  2004-08-02 12:33 Always copying a mailing list Kai Grossjohann
@ 2004-08-02 13:29 ` David S Goldberg
  2004-08-04  8:15 ` Reiner Steib
  1 sibling, 0 replies; 3+ messages in thread
From: David S Goldberg @ 2004-08-02 13:29 UTC (permalink / raw)


>>>>> On Mon, 02 Aug 2004 14:33:12 +0200, Kai Grossjohann <kai@emptydomain.de> said:

> I can set mail-self-blind to get "Bcc: kais.address" in outgoing
> messages.  But I have a special group where I'd rather like to have
> "Cc: some.mailinglist".

> I've tried to frob the posting style for the group, saying (("Gcc" .
> nil) ("Cc" . "some.mailinglist")).  But this does not work as I like,
> because it also removes other recipients that I would like to keep.

> The behavior I'm looking for is: After I've hit R or F (or S W or S
> V), add the following address to the list of recipients if not yet
> present.

> How to do that?

I don't have a complete answer, but this might help.  I have had
difficulty getting mml-secure-message-encrypt-smime to work with
multiple addresses.  However mml-secure-encrypt-smime works because it
prompts for each address and certificate file.  Going through the
prompts is tiresome and occasionally error prone.  However the
function that does the prompting is akin to a hook and so can be
replaced.  I did so with one that parses the headers into a list of
bare addresses (I use the address with .pem tagged as the name of the
certificate file).  The piece that creates this list could, I think,
be used in a posting style that tests the value of gnus-article-reply
and if t, creates the list, searches for the mailing-list address and
adds it if it isn't already there.  To build the list of addresses I
did the following:

(mapcar 'cadr (mail-extract-address-components
			    (concat (message-fetch-field "to") ","
				    (message-fetch-field "cc")) t))

I hope that is helpful.

-- 
Dave Goldberg
david.goldberg6@verizon.net





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

* Re: Always copying a mailing list
  2004-08-02 12:33 Always copying a mailing list Kai Grossjohann
  2004-08-02 13:29 ` David S Goldberg
@ 2004-08-04  8:15 ` Reiner Steib
  1 sibling, 0 replies; 3+ messages in thread
From: Reiner Steib @ 2004-08-04  8:15 UTC (permalink / raw)


On Mon, Aug 02 2004, Kai Grossjohann wrote:

> I can set mail-self-blind to get "Bcc: kais.address" in outgoing
> messages.  But I have a special group where I'd rather like to have
> "Cc: some.mailinglist".
>
> I've tried to frob the posting style for the group, saying (("Gcc" .
> nil) ("Cc" . "some.mailinglist")).  But this does not work as I like,
> because it also removes other recipients that I would like to keep.
>
> The behavior I'm looking for is: After I've hit R or F (or S W or S
> V), add the following address to the list of recipients if not yet
> present.
>
> How to do that?

(defun rs-message-replace-header (header new-value)
  "Remove HEADER and insert the NEW-VALUE."
  ;; Similar to `nnheader-replace-header' but for message buffers.
  (save-excursion
    (save-restriction
      (message-narrow-to-headers)
      (message-remove-header header))
    (message-position-on-field header)
    (insert new-value)))

(defun kai-message-add-cc (cc)
  "Insert an additional address in Cc field."
  (interactive "MAddress: \n")
  (save-excursion
    (let ((occ (message-fetch-field "Cc")))
      (rs-message-replace-header
       "Cc" (concat occ (when (and occ cc) ", ") cc)))))

Wrapping this function in a suitable message hook and taking the
address from posting styles is left as an exercise to the reader.
(You may also find `message-carefully-insert-headers' and
`message-header-synonyms' useful.)

BTW, I wonder if there is no builtin function for...

,----
| (defun rs-message-replace-header (header new-value)
|   "Remove HEADER and insert the NEW-VALUE."
|   ;; Similar to `nnheader-replace-header' but for message buffers.
`----

Should we add this as `message-replace-header' in `message.el'?

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo--- PGP key available via WWW   http://rsteib.home.pages.de/




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

end of thread, other threads:[~2004-08-04  8:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-08-02 12:33 Always copying a mailing list Kai Grossjohann
2004-08-02 13:29 ` David S Goldberg
2004-08-04  8:15 ` Reiner Steib

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