Gnus development mailing list
 help / color / mirror / Atom feed
* qmail bounce information in summary, plus a nnheader.el fake message ID question
@ 2004-06-11 14:35 Ted Zlatanov
  2004-06-14 17:23 ` Ted Zlatanov
  0 siblings, 1 reply; 2+ messages in thread
From: Ted Zlatanov @ 2004-06-11 14:35 UTC (permalink / raw)


I deal with qmail bounces a lot, being a qmail administrator.  Here's
a user-format-function to analyze a bounce message and give the first
bounce address found.  You just put %uB in your summary format line (I
do this for just the "root" group where bounces go).

I wanted to use the registry, but the "fake+none" message IDs Gnus
generates are not consistent.  It would be nice if the fake message
ID, generated in nnheader.el:

(concat "fake+none+" (int-to-string (incf nnheader-fake-message-id)))

could incorporate the real article number and group name, so that when
you re-enter the group, the fake message ID is the same as before.  I
think this would help make Gnus more consistent, and the registry
more useful (e.g. for nnrss groups).

Ted

;; note: we try to use the gnus-registry to cache this, but qmail doesn't give valid message IDs to bounces!
(defun gnus-user-format-function-B (headers)
  (if (and headers gnus-newsgroup-name)
      (let* ((article (spam-fetch-field-fast -4332 'number headers)) ; -4332 is a fake article number
	     (id (spam-fetch-field-message-id-fast article headers))
	     (bounce (gnus-registry-fetch-extra id 'qmail-bounce-address)))
	(if (and bounce (stringp bounce))
	    (format "C_BOUNCE %s" bounce)
	  (with-temp-buffer
	    (gnus-request-article-this-buffer
	     article
	     gnus-newsgroup-name)
	    (if (and
		 (search-forward "Hi. This is the" nil t)
		 (search-forward-regexp "<\\(.*\\)>:" nil t))
		(progn
		  (setq bounce (match-string 1))
		  (gnus-registry-store-extra-entry id 'qmail-bounce-address bounce)
		  (format "BOUNCE %s" bounce))
	      "no match"))))
    "invalid headers"))



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

end of thread, other threads:[~2004-06-14 17:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-06-11 14:35 qmail bounce information in summary, plus a nnheader.el fake message ID question Ted Zlatanov
2004-06-14 17:23 ` Ted Zlatanov

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