Gnus development mailing list
 help / color / mirror / Atom feed
From: "Ted Zlatanov" <tzz@lifelogs.com>
Subject: qmail bounce information in summary, plus a nnheader.el fake message ID question
Date: 11 Jun 2004 10:35:09 -0400	[thread overview]
Message-ID: <4nwu2ejh7m.fsf@lifelogs.com> (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"))



             reply	other threads:[~2004-06-11 14:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-11 14:35 Ted Zlatanov [this message]
2004-06-14 17:23 ` Ted Zlatanov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4nwu2ejh7m.fsf@lifelogs.com \
    --to=tzz@lifelogs.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).