* Re: splitting outgoing mail depending on To: field
[not found] <m3hdq1qwp0.fsf@free.fr>
@ 2004-09-14 18:22 ` Alexander Syrov
0 siblings, 0 replies; only message in thread
From: Alexander Syrov @ 2004-09-14 18:22 UTC (permalink / raw)
Hello, oli.
On Tue, 14 Sep 2004 06:52:11 +0200
oli wrote:
o> I would like to split my outgoing mails depending on the To: field ...
...
o> The splitting on outgoing mail I have seen in the doc, is done before
o> the mail is written ... but what I would like is to do it after ...
Gnus doesn't seem to have a built-in functionality for this. But it can
be done with a hook. Currently I have a following piece of code in my
~/.gnus (simplified):
,----[ ~/.gnus ]
| (setq
| gnus-message-archive-group nil
| gnus-gcc-mark-as-read t)
| (add-hook
| 'message-send-hook
| '(lambda ()
| (save-excursion
| (let ((to (save-restriction
| (message-narrow-to-headers)
| (message-fetch-field "To")))))
| (cond
| ((message-news-p)
| (message-add-header "Gcc: nnml:sent.news")) ;; posted news articles
| ((string-match "user1@domain1" to)
| (message-add-header "Gcc: nnml:User1"))
| ((string-match "user2@domain2" to)
| (message-add-header "Gcc: nnml:User2"))
| (t
| (message-add-header "Gcc: nnml:sent.misc")))))) ;; default for mail
`----
--
Regards,
Alexander Syrov.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2004-09-14 18:22 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <m3hdq1qwp0.fsf@free.fr>
2004-09-14 18:22 ` splitting outgoing mail depending on To: field Alexander Syrov
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).