Re: add sender without mail if mail is in some ignored-list?

"Roland Winkler" <[email protected]> Tue, 28 Dec 2021 23:57:02 -0600
Newsgroups gmane.emacs.bbdb.user
Message-ID <[email protected]>
On Fri, Mar 27 2020, Michael Richardson wrote:
> This might be what I'd like.
>
> Roland Winkler <[email protected]> wrote:
>     > If gets an email from
>     > John Doe <[email protected]>
>
> 1) look up [email protected] in BBDB, see flag that says this is an
>     ignorable "role" address.
>               -> do nothing
>
> If there is a second flag "show-name" (maybe) set then:
>
> 2) Lookup the name in BBDB, and show that entry instead.

I am sorry for the long delay with this old thread.  Finally, when I
looked into the code, I found the function
`bbdb-clean-address-components'.  It massages the name and mail address
in a mail message before BBDB tries to find a record matching the name
and/or mail address.  For this, it passes the name through a
(customizable) `bbdb-message-clean-name-function' and the mail address
through a (customizable) `bbdb-canonicalize-mail-function'.

The docstring of the variable `bbdb-canonicalize-mail-function' says"

If this function returns nil, BBDB assumes that there is no mail address.

So it seems to me, the best way to ignore mail addresses like
<[email protected]> 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 <[email protected]> with the record
for this name.

Or am I still misunderstanding the nature of this issue?

(I thought about adding a new feature along these lines to BBDB, when I
realized that the feature is already in place, though the name
`bbdb-canonicalize-mail-function' suggests that historically it got
developed for a different purpose.)

> 3) maybe, if there is no reply-To, and the user asks to reply,
>    use the email from that entry.

That goes beyond BBDB because it needs to hook into how a message buffer
is set up by a MUA if one wants to reply to such a message.  I expect
that this works differently for Gnus, Rmail, etc.  But if BBDB displays
the record for the name, one can easily copy the mail address into the
reply buffer (use `bbdb-mail-address', bound to M in BBDB).