From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/57896 Path: main.gmane.org!not-for-mail From: "Ted Zlatanov" Newsgroups: gmane.emacs.gnus.general Subject: Re: qmail bounce information in summary, plus a nnheader.el fake message ID question Date: 14 Jun 2004 13:23:39 -0400 Organization: =?utf-8?B?0KLQtdC+0LTQvtGAINCX0LvQsNGC0LDQvdC+0LI=?= @ Cienfuegos Sender: ding-owner@lists.math.uh.edu Message-ID: <4n4qpeyrxg.fsf@lifelogs.com> References: <4nwu2ejh7m.fsf@lifelogs.com> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1087234989 20602 80.91.224.253 (14 Jun 2004 17:43:09 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 14 Jun 2004 17:43:09 +0000 (UTC) Original-X-From: ding-owner+M6437@lists.math.uh.edu Mon Jun 14 19:42:55 2004 Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BZvTz-00030j-00 for ; Mon, 14 Jun 2004 19:42:55 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by malifon.math.uh.edu with smtp (Exim 3.20 #1) id 1BZvT7-0001Uq-00; Mon, 14 Jun 2004 12:42:01 -0500 Original-Received: from util2.math.uh.edu ([129.7.128.23]) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 1BZvT3-0001Ul-00 for ding@lists.math.uh.edu; Mon, 14 Jun 2004 12:41:57 -0500 Original-Received: from justine.libertine.org ([66.139.78.221] ident=postfix) by util2.math.uh.edu with esmtp (Exim 4.30) id 1BZvT0-0003ik-VU for ding@lists.math.uh.edu; Mon, 14 Jun 2004 12:41:54 -0500 Original-Received: from mail.bwh.harvard.edu (sysblade0.bwh.harvard.edu [134.174.9.44]) by justine.libertine.org (Postfix) with ESMTP id CBBEE3A005F for ; Mon, 14 Jun 2004 12:41:53 -0500 (CDT) Original-Received: (qmail 6644 invoked from network); 14 Jun 2004 17:35:37 -0000 Envelope-Sender: tzz@lifelogs.com Envelope-Recipients: ding@gnus.org, Original-Received: from asimov.bwh.harvard.edu (HELO asimov) ([134.174.9.63]) (envelope-sender ) by mail.bwh.harvard.edu (qmail-ldap-1.03) with SMTP for ; 14 Jun 2004 17:35:37 -0000 Mail-Followup-To: "Ding Mailing List" Original-To: "Ding Mailing List" X-Face: bd.DQ~'29fIs`T_%O%C\g%6jW)yi[zuz6;d4V0`@y-~$#3P_Ng{@m+e4o<4P'#(_GJQ%TT= D}[Ep*b!\e,fBZ'j_+#"Ps?s2!4H2-Y"sx" In-Reply-To: <4nwu2ejh7m.fsf@lifelogs.com> (Ted Zlatanov's message of "Fri, 11 Jun 2004 10:35:09 -0400") User-Agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.3.50 (gnu/linux) Precedence: bulk Xref: main.gmane.org gmane.emacs.gnus.general:57896 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:57896 On Fri, 11 Jun 2004, tzz@lifelogs.com wrote: > 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). Attached is the updated version of this function. NB: it conflicts with bbdb-gnus.el, which also defines a -B user format function. > 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). It turns out that nnrss specifically is not a problem, but generally these unique IDs are a nice thing for nnimap, for example, where you don't want to download every article every time. They work well, and I added code today to support generating fake message IDs that are repeatable w.r.t. the gnus-newsgroup-name and the article number. If you notice any problems with the function below or with my patches to allow for repeatable fake message IDs, let me know please. Thanks Ted ;; this function uses the gnus-registry to cache data; you need a recent Gnus in order to use that (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 (cdr-safe (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 or group name"))