Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
* group specific message IDs
@ 2008-07-02 18:06 Richard G Riley
  2008-07-03 13:47 ` Ted Zlatanov
  2008-07-06 19:38 ` renaudr
  0 siblings, 2 replies; 3+ messages in thread
From: Richard G Riley @ 2008-07-02 18:06 UTC (permalink / raw)
  To: info-gnus-english


I read here

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

that I can generate my own message IDs like this:

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


But how can I do this ONLY for specific groups?

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

* Re: group specific message IDs
  2008-07-02 18:06 group specific message IDs Richard G Riley
@ 2008-07-03 13:47 ` Ted Zlatanov
  2008-07-06 19:38 ` renaudr
  1 sibling, 0 replies; 3+ messages in thread
From: Ted Zlatanov @ 2008-07-03 13:47 UTC (permalink / raw)
  To: info-gnus-english

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

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

* Re: group specific message IDs
  2008-07-02 18:06 group specific message IDs Richard G Riley
  2008-07-03 13:47 ` Ted Zlatanov
@ 2008-07-06 19:38 ` renaudr
  1 sibling, 0 replies; 3+ messages in thread
From: renaudr @ 2008-07-06 19:38 UTC (permalink / raw)
  To: info-gnus-english

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


> (defun message-make-message-id()
>    (concat "<"(message-unique-id)"@yourmachine.yourdomain.tld>"))
>
> But how can I do this ONLY for specific groups?


I am sure Ted's answer is nice but not sufficient for most purposes where one
sends news from different providers, use different mail adresses and so... I
thus don't rely on system settings for mail sending and use smtpmail instead,
for news I customize the server to connect too.

I have a little library that I am using for almost 10 years now which allows
me to customize an X-Fake header that I set in a group/topic parameter. This
basically change some sensible fields such as the From and Message-Id fields
of the header.

For message id's I use

(defun message-fake-message-id (&optional faked-config-name env)
  "Fakes a unique message id base on faked configuration's machine's opinion"
  (flet ((message-make-fqdn () (message-fake-fqdn faked-config-name env)))
    (message-make-message-id)))

to rewrite how id's are generated.

I can send it to the group if there is some interest.

-- 
		Renaud

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

end of thread, other threads:[~2008-07-06 19:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-07-02 18:06 group specific message IDs Richard G Riley
2008-07-03 13:47 ` Ted Zlatanov
2008-07-06 19:38 ` renaudr

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