info-gnus-english
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: splitting outgoing mail depending on To: field


From: Alexander Syrov
Subject: Re: splitting outgoing mail depending on To: field
Date: Tue, 14 Sep 2004 22:22:31 +0400

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.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]