[Top][All Lists]

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

Re: bbdb and storing emails

From: Dan Griswold
Subject: Re: bbdb and storing emails
Date: Sat, 24 Jan 2009 20:33:50 -0500
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux)

I accomplished this by defining advice to certain key functions
involved with bbdb and mail.

Like so:

/--------------- begin code snippet

(defvar hold nil
  "Variable for keeping default value of gnus-message-archive-group")

(defadvice bbdb-send-mail (before dmg-change-gcc activate)
  (if (string-equal (buffer-name) "*BBDB*")
      (let ((gcc (save-excursion
                   (set-buffer bbdb-buffer-name)
                   (bbdb-record-getprop (bbdb-current-record) 'gnus-private))))
        (print gcc)
        (if gcc (progn
                  (setq hold gnus-message-archive-group)
                  (setq gnus-message-archive-group (concat "nnml:" gcc))

(defadvice gnus-inews-insert-archive-gcc (after dmg-reset-gcc activate)
  (setq gnus-message-archive-group hold)
  (setq hold nil))

(ad-activate 'bbdb-send-mail)
(ad-activate 'gnus-inews-insert-archive-gcc)

\----------------- end code snippet

To use this, I make sure a bbdb record has the gnus-private field set
to the nnml folder I want for that individual. As a result, not only
will mail from that person get stored in that folder, but so too will
mail sent to that person, provided I execute bbdb-send-mail on that
record (`m' in the *BBDB* buffer).

If you want to use a different bbdb field besides gnus-private, simply
replace `gnus-private' with the name of the field you desire.



Dan Griswold
Rochester, NY

reply via email to

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