On Sun, Dec 07 2008, Sven Joachim wrote: > On 2008-12-07 06:50 +0100, Lars Magne Ingebrigtsen wrote: >> When the same message comes from two mailing lists, and there's not >> enough information in them to identify them as such (to crosspost the >> message between the list), the Message-ID has to be renamed. Remove the >> bit after __ to find the original ID. > > Here is some Emacs lisp code that does this automatically when replying > in Gnus: > > (defun sj-unmangle-gmane-message-id () > "Undo the Message-ID mangling that Gmane does on some postings." > (save-excursion > (save-restriction > (message-narrow-to-headers) > (goto-char (point-min)) > (while > (re-search-forward "\\(<.*\\)" (point-max) t) > (replace-match "\\1"))))) I would have expected a search for an expression like "__[0-9.]+\\$gmane\\$org@" or similar. What am I missing? > ;; Fix up References header > (add-hook 'message-header-setup-hook > 'sj-unmangle-gmane-message-id) > > ;; Fix up In-Reply-To header > (add-hook 'message-send-mail-hook > 'sj-unmangle-gmane-message-id) > > Note that your own Gcc'ed copy will still have the mangled Message-ID in > the In-Reply-To header, because message.el inserts that very late. I > can live with that, but if somebody has a better idea, please let me > know. I'd guess the unmangling should be done when `message-id' (fixing References should not be necessary, I think) is put into `message-reply-headers' (in `message-cite-original-1', `message-reply', `message-followup'?). Here's a very rough, untested patch: