bbdb-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Establish record-addresses associations before annotating records


From: Bob Newell
Subject: Re: Establish record-addresses associations before annotating records
Date: Mon, 21 Feb 2022 19:17:24 -1000

Aloha,

I might be missing the point entirely here so apologies if that is the
case. But this is what I have done for a long time and it has worked
for me.

(setq bbdb-ignore-message-alist
      '(("From" . "donotreply")
        ("Mail-Followup-to" . "donotreply")
        ("Reply-to" . "donotreply")
        ("From" . "noreply")
        ("Mail-Followup-to" . "noreply")
        ("Reply-to" . "noreply")
        ("From" . "no-reply")
        ("Mail-Followup-to" . "no-reply")
        ("Reply-to" . "no-reply")
        ("From" . "no_reply")
        ("Mail-Followup-to" . "no_reply")
        ("Reply-to" . "no_reply")
        ))

Perhaps the intent was something different, but this always seemed an
easy way to keep nearly all of those messages from injecting things
into the database.

-- 
Bob Newell
Honolulu, Hawai`i

Via Linux/Emacs/Gnus/BBDB.

On Sun, Feb 20, 2022 at 7:05 PM Roland Winkler <winkler@gnu.org> wrote:
>
> On Wed, Dec 29 2021, Roland Winkler wrote:
> > On Tue, Dec 28 2021, Roland Winkler wrote:
> >> So it seems to me, the best way to ignore mail addresses like
> >> <no-reply@exmple.com> is to define a function for
> >> `bbdb-canonicalize-mail-function' that returns nil in such a case.
> >> Then, BBDB should look up the record that matches the name, but it will
> >> not associate the bogus address <no-reply@exmple.com> with the record
> >> for this name.
> >>
> >> Or am I still misunderstanding the nature of this issue?
> >
> > If such a thing does solve the problem, it can also be made more
> > user-friendly by adding code to `bbdb-clean-address-components' that
> > will match the mail address against a customizable regexp.  If this
> > succeeds, the mail address is ignored.
>
> Lately I have been annoyed myself by emails using mail addresses like
> no-reply@example.com, which I took as an incentive to try to solve this
> problem more carefully.  The issue is how BBDB annotates records and
> creates new ones when it inspects the From and To headers of in- and
> outgoing messages and compares these headers with the records in BBDB.
> Previously, BBDB processed these headers one by one, searching for
> matching records on the fly.  There was no well-defined interface for
> inspecting what BBDB wanted to do before it actually annotated the
> records.  The central idea of the new patch is to first establish the
> record-addresses associations for all addresses in the relevant headers
> of a message before BBDB starts to process these associations.  Then the
> new user variable bbdb-record-address-alist-function allows one to first
> massage these associations in whatever way before they are processed.
>
> Maybe such a user-defined function will often be too sophisticated if
> one just wants to ignore mail addresses like no-reply@example.com, and a
> cheaper, easier-to-use solution for just this is provided by the new
> user variable bbdb-message-ignore-mail-re.
>
> While the internals have changed by a fair amount, the user-visible
> behavior of how BBDB processes in- and outgoing mail should have
> remained in most cases the same.  In rare cases when one address matches
> multiple records or multiple addresses match the same record, the new
> code may behave different from the old code.  But if the behavior
> differs, the new behavior should be more meaningful than the old
> behavior.
>
> However, there may still be bugs hidden in the new code.  As always,
> please post them here.  (On GNU Elpa, the commit is "hidden" because I
> have not yet increased the BBDB version number.  So you need to fetch it
> from the elpa git repository.  Or get it from savannah.)
>
> Along the way, I also cleaned up the code and removed a rather obscure
> throw-catch that always annoyed me.
>
> Moreover, the entire patch looks bigger than it is, because I also
> replaced the odd names of several user variables, see the Changelog
> below.  The old names have been declared obsolete.  This brought the
> code closer to standard emacs coding conventions.
>
> Roland
>
>
> 2022-02-20  Roland Winkler  <winkler@gnu.org>
>         Establish record-addresses associations before annotating records.
>         * lisp/bbdb.el (bbdb-mua-interactive-action): Renamed from
>         bbdb-mua-update-interactive-p.
>         (bbdb-mua-auto-action): Renamed from bbdb-mua-auto-update-p.
>         (bbdb-mua-action): Renamed from bbdb-update-records-p.
>         (bbdb-message-clean-mail-function): Renamed from
>         bbdb-canonicalize-mail-function.
>         (bbdb-message-ignore-mail-re, bbdb-message-ignore-name-re)
>         (bbdb-record-address-alist-function): New variables.
>         (bbdb-offer-to-create): Internal variable removed.
>         (bbdb-clean-address-components): Use bbdb-message-ignore-mail-re
>         and bbdb-message-ignore-name-re.
>         * lisp/bbdb-mua.el (bbdb-mua-interactive-action): Renamed from
>         bbdb-mua-update-interactive-p.
>         (bbdb-update-records): Establish record-addresses associations
>         before annotating records.  Use
>         bbdb-record-address-alist-function.
>         (bbdb-query-create): Provide return value.
>         (bbdb-annotate-message): Perform action per record and
>         address-list.
>         * README: Update lingo.
>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]