I am using BBDB3 with Gnus. I want to make BBDB to update the recipient address in its database for each mail I send (just like Gmail does). Is it possible?
Asked
Active
Viewed 1,325 times
2 Answers
5
Certainly, this is Emacs ! :)
(bbdb-initialize 'gnus 'message)
(bbdb-mua-auto-update-init 'message) ;; use 'gnus for incoming messages too
(setq bbdb-mua-auto-update-p 'query) ;; or 'create to create without asking
This will parse fields in outgoing messages, and suggest creation of corresponding BBDB entries

Sigma
- 4,520
- 22
- 27
2
I don't have automatic but if you wanted to have it in a quick one key here how you can have that :
(defun my-gnus-bbdb-snarf-sender ()
(interactive)
(gnus-with-article-buffer
(let ((from (mail-fetch-field "from")))
(bbdb-snarf from 'mail))))
and add in a hook for gnus-summary-hook to a key, like for example :
(defun my-gnus-summary-mode-hook ()
(local-set-key '[(\')] 'my-gnus-bbdb-snarf-sender))
(add-hook 'gnus-summary-mode-hook 'my-gnus-summary-mode-hook)
which bind it to the quote ' keyboard to add the sender directly to BBDB

Chmouel Boudjnah
- 160
- 4
message-sent-hook
? – kindahero Sep 24 '14 at 14:02(bbdb-mua-auto-update-init 'message)
and not(bbdb-mua-auto-update-init 'message 'gnus)
. The former hooks intomessage-send-hook
(only outgoing messages), while the latter hooks also intognus-article-prepare-hook
(all displayed articles, hence incoming ones too) – Sigma Sep 24 '14 at 14:06gnus-article-prepare-hook
and eliminate any occurrence ofbbdb-mua-auto-update
(they might come from other parts of your config, most likely another call tobbdb-mua-auto-update-init
) – Sigma Sep 24 '14 at 15:34