Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Location of email addresses #1401

Closed
emonigma opened this issue Apr 11, 2019 · 11 comments
Closed

Location of email addresses #1401

emonigma opened this issue Apr 11, 2019 · 11 comments

Comments

@emonigma
Copy link

Expected or desired behavior

(1) I would like to delete the email address of a contact who changed addresses. (2) I would also like to sync the location of mu4e's email addresses with the database in Contacts.app.

Actual behavior

(1) The first email address that auto-completes is the old address. (2) New addresses that I add in Contacts.app are not seen by mu4e.

Versions of mu, mu4e/emacs, operating system etc.

mu (mail indexer/searcher) version 1.0
Emacs: 26.1 (9.0)
macOS Mojave

Any other detail

I asked on Emacs StackExchange with no answers.

@Chris00
Copy link
Contributor

Chris00 commented Apr 11, 2019

You canb use

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

@djcb
Copy link
Owner

djcb commented Apr 13, 2019

Note, mu4e doesn't really have a "Contact database", it just provides auto-completion of e-mail address that were seen before. But indeed, as @Chris00 mentions, you can filter them.

@djcb djcb closed this as completed Apr 13, 2019
@Chris00
Copy link
Contributor

Chris00 commented Apr 13, 2019

For (2), you may want to write a script periodically runs to generate a ~/.mailrc from your Contacts.app. Alternativelt, you may use BBDB and read “Importing OS X contacts to BBDB”. It should be possible to adapt the code to add a new source of addresses to mu4e.

Maybe, one could provide a standard hook as sources of addresses? @djcb Any opinion on this?

@emonigma
Copy link
Author

emonigma commented Jun 3, 2019

@Chris00 I tried the regular expression approach. My regex selects the target address in a plain-text file with re-builder, and I also see that its value is set right with C-h v. Yet, mu4e still auto-completes the address.

Nevertheless, this approach will be obsolete with version 1.4 (unreleased as of this writing):

The contacts cache (as uses in mu cfind and mu4e contact-completion is now stored as part of the Xapian database rather than as a separate file.

We also moved sorting the contacts to the mu-side, which speeds things up further. However, as a side-effect of this, mu4e-contacts-rewrite-function and mu4e-compose-complete-ignore-address-regexp have been obsoleted; users of those should migrate to mu4e-contact-process-function; see its docstring for details.

@Chris00 The BBDB option looks promising. Have you adapted the code to provide a new source of addresses to mu4e?

@djcb As in the next version contacts will be stored in the Xapian database, can users insert a new contact into that database?

@Chris00
Copy link
Contributor

Chris00 commented Jun 3, 2019 via email

@emonigma
Copy link
Author

emonigma commented Jun 5, 2019

@Chris00 It worked by restarting Emacs to force a restart of mu4e. Thanks!

I would still like to add contacts directly to the database. Maybe that will be easier with 1.4 and the Xapian database.

@Chris00
Copy link
Contributor

Chris00 commented Jun 5, 2019 via email

@djcb
Copy link
Owner

djcb commented Jun 5, 2019

@miguelmorin: as before, a trick is to create a message with all the desired contacts (perhaps with a date in the far future). If mu could add some API for that? Perhaps.

@emonigma
Copy link
Author

emonigma commented Jun 10, 2019

@djcb I just tried that trick with the mu4e-send-delay scheduled 2 hours hence with a new address. The next new email did not auto-complete that new address. I also tried sending immediately without internet connection, which failed and did not enable auto-completion of that address. Which tool do you suggest to schedule emails in the future?

@joukeHijlkema
Copy link

joukeHijlkema commented Jun 19, 2020

I second this demand. My contacts DB is more and more poluted with typos and changed emails. It would be realy nice to be able to clean things up (I'm using 1.5.3)

@haji-ali
Copy link
Contributor

haji-ali commented Dec 3, 2020

I accidentally sent an email to a wrong address once, and now it shows up in my contacts. Based on the above, I thought I could remove that contact if I delete the message that contains this address (so that mu returns no messages when searching for that address). But the auto-completion still shows that contact.

How do I make sure that this address is deleted? Related: How do find all possible messages that contain that contact so I can delete them? I tried "mu find "address@mail.com"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants