1

I use mu4e to read and write email. One email address that was in the LDAP server before no longer exists, but it still shows and auto-completes in mu4e.

How can I remove that address from the local database? And where is that database stored?

1

For mu version > 1.3.2. you need to define a filtering function and store its name in mu4e-contact-process-function, e.g. like in this example

(defun my-mu4e-contact-filter-function (addr)
  (if (string-match-p
        (concat "\\(?:no-?reply\\|.*\\.unwanted\\.domain\\.com\\|"
        "unwanted\\.user@somedomain\\.com\\)")
        addr)
     nil
  addr))
(setq mu4e-contact-process-function 'my-mu4e-contact-filter-function)

Note that the contact list only seems to get renewed when mu4e is started. So you will need to stop/restart mu4e upon changes.

| improve this answer | |
  • I confirm that this works as of mu4e 1.14.13. I couldn't find how to stop and restart mu4e, so I restarted Emacs. – miguelmorin Sep 7 at 10:27
0

Following the GitHub issue, one solution is to ignore that address in address completion. Add this code in ~/.emacs:

(setq mu4e-compose-complete-ignore-address-regexp
      (concat "\\(?:no-?reply\\|.*\\.unwanted\\.domain\\.com\\|"
              "unwanted.email@domain\\.com\\)"))

and notice the escaping of periods with (\\.). Then restart mu4e.

The database of contacts will be stored in the Xapian database starting with mu4e 1.4.

| improve this answer | |
  • 1
    Note for others finding this answer: mu4e-compose-complete-ignore-address-regexp has been obsoleted since mu 1.3.2. You need now to define the name of a filtering function in the variable mu4e-contact-process-function. – dfeich Sep 3 at 8:24
  • @dfeich Correct, could you write an answer with a reference and a code snippet? – miguelmorin Sep 4 at 9:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.