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

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

Re: group specific message IDs


From: Ted Zlatanov
Subject: Re: group specific message IDs
Date: Thu, 03 Jul 2008 08:47:43 -0500
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.0.60 (gnu/linux)

On Wed, 02 Jul 2008 20:06:13 +0200 Richard G Riley <rileyrgdev@gmail.com> 
wrote: 

RGR> I read here

RGR> http://gnus.org/manual/gnus_367.html

RGR> that I can generate my own message IDs like this:

RGR> (defun message-make-message-id()
RGR>    (concat "<"(message-unique-id)"@yourmachine.yourdomain.tld>"))

RGR> But how can I do this ONLY for specific groups?

(defun riley-message-make-message-id()
  (if (string-match "your-pattern-here" gnus-newsgroup-name)
      (concat "<"(message-unique-id)"@yourmachine.yourdomain.tld>")
    (message-make-message-id)))

You could also just set user-mail-address instead of overriding
message-make-message-id, if you just want to change your domain name.
This will do it every time you enter a group:

(add-hook 'gnus-select-group-hook 'tzz-gnus-conditional-settings)

(defun tzz-gnus-conditional-settings ()
  "conditional gnus settings"
  (interactive)
  (let ((group (if (stringp gnus-newsgroup-name) gnus-newsgroup-name "")))
    (setq user-mail-address
          (cond
           ((string-match "A" group) "joe@here.com")
           ((string-match "B" group) "jim@there.com")
           (t "default@everywhere.com")))))

In the same way you could do fancier things with
message-make-message-id, but I generally avoid overriding functions if
possible, I'd rather customize variables.

Ted


reply via email to

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