From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/39872 Path: main.gmane.org!not-for-mail From: "Matt Armstrong" Newsgroups: gmane.emacs.gnus.general Subject: Re: OT: make bbdb shut up about different email addresses? Date: Fri, 2 Nov 2001 12:44:03 -0700 (MST) Sender: owner-ding@hpc.uh.edu Message-ID: <20011102194403.CCF2ABD25@squeaker.lickey.com> References: <87y9m9fs6b.fsf@squeaker.lickey.com> <87elo1exsd.fsf@squeaker.lickey.com> <20011102160930.CC3D1BD52@squeaker.lickey.com> <87wv192jzh.fsf_-_@mclinux.com> <20011102173752.B4E85BD2B@squeaker.lickey.com> NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1035175514 30286 80.91.224.250 (21 Oct 2002 04:45:14 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 04:45:14 +0000 (UTC) Return-Path: Original-Received: (qmail 11469 invoked from network); 2 Nov 2001 19:45:24 -0000 Original-Received: from malifon.math.uh.edu (mail@129.7.128.13) by mastaler.com with SMTP; 2 Nov 2001 19:45:24 -0000 Original-Received: from sina.hpc.uh.edu ([129.7.128.10] ident=lists) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 15zkFA-0006ez-00; Fri, 02 Nov 2001 13:44:44 -0600 Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Fri, 02 Nov 2001 13:44:25 -0600 (CST) Original-Received: from sclp3.sclp.com (qmailr@sclp3.sclp.com [209.196.61.66]) by sina.hpc.uh.edu (8.9.3/8.9.3) with SMTP id NAA27861 for ; Fri, 2 Nov 2001 13:44:11 -0600 (CST) Original-Received: (qmail 11459 invoked by alias); 2 Nov 2001 19:44:22 -0000 Original-Received: (qmail 11454 invoked from network); 2 Nov 2001 19:44:22 -0000 Original-Received: from hank.lickey.com (64.81.100.235) by gnus.org with SMTP; 2 Nov 2001 19:44:22 -0000 Original-Received: from squeaker.lickey.com (squeaker.lickey.com [192.168.100.10]) by hank.lickey.com (Postfix) with ESMTP id 636A2EE30 for ; Fri, 2 Nov 2001 12:44:07 -0700 (MST) Original-Received: from localhost (localhost [127.0.0.1]) by squeaker.lickey.com (Postfix) with ESMTP id 33614BD52 for ; Fri, 2 Nov 2001 12:44:05 -0700 (MST) Original-Received: by squeaker.lickey.com (Postfix, from userid 1000) id CCF2ABD25; Fri, 2 Nov 2001 12:44:03 -0700 (MST) Original-To: ding@gnus.org User-Agent: Gnus/5.090004 (Oort Gnus v0.04) Emacs/21.1 (i386-debian-linux-gnu) Mail-Followup-To: ding@gnus.org X-Delivery-Agent: TMDA v0.40/Python 1.5.2 (linux2) X-Virus-Scanned: by AMaViS snapshot-20010714 Precedence: list X-Majordomo: 1.94.jlt7 Original-Lines: 44 Xref: main.gmane.org gmane.emacs.gnus.general:39872 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:39872 "Jason R. Mastaler" writes: > "Matt Armstrong" writes: > >> But you can also set it to a function that (I assume) gets the >> address and returns 't, nil or 'never. It could use some regexp >> magic to avoid asking about the dated address. > > Yes, BBDB provides a hook for filtering email addresses before adding > them to the database. > > See for > the details. > > I should probably add this to the TMDA FAQ as well. Yes, much better than using bbdb-always-add-addresses as I suggested earlier. My version below deals only with "dated" addresses; deals with those that use any recipient delimiter (not just -); and is a tighter regexp to minimize risk of false simplifications. P.S., please let me know if there is any standard emacs function equivalent to (defun extract-match (str index) (substring str (match-beginning index) (match-end index))) (defun my-bbdb-canonicalize-net-hook (addr) (cond ;; take care of TMDA dated addresses ((string-match "^\\(.+?\\)\\(.\\)dated\\2[0-9]+\\.[0-9a-fA-F]+\\(@.*\\)" addr) (concat (substring addr (match-beginning 1) (match-end 1)) (substring addr (match-beginning 3) (match-end 3)))) ;; by default, leave it alone (t addr))) (setq bbdb-canonicalize-net-hook 'my-bbdb-canonicalize-net-hook) -- matt