diff --git a/email/.config/khard/khard.conf b/email/.config/khard/khard.conf new file mode 100644 index 0000000..57eaf11 --- /dev/null +++ b/email/.config/khard/khard.conf @@ -0,0 +1,17 @@ +[addressbooks] +[[Nextcloud]] +path = ~/.local/share/vdirsyncer/nextcloud_contacts_local/contacts/ + +[general] +debug = no +default_action = list +editor = nvim +merge_editor = delta + +[contact table] +display = first_name +show_nicknames = no +sort = last_name + +[vcard] +search_in_source_files = yes diff --git a/email/.config/neomutt/neomuttrc b/email/.config/neomutt/neomuttrc index 80372e5..5fa38d6 100644 --- a/email/.config/neomutt/neomuttrc +++ b/email/.config/neomutt/neomuttrc @@ -3,7 +3,8 @@ set from = "andrew@amd.im" set realname = "Andrew Davidson" -#### Connectivity +#### Remote Connectivity +#### use this instead of the local storage section below. #set imap_user = "andrew@amd.im" #set imap_pass = "`pass show email/amd.im/andrew`" #set folder = "imaps://mail.amd.im" @@ -13,12 +14,17 @@ set realname = "Andrew Davidson" #set imap_check_subscribed # automatically check subscribed folders #mailboxes +INBOX +#### Local storage of emails +#### Use this with isync/mbsync to store email locally set mbox_type = Maildir set folder = "~/.local/share/email/andrew@amd.im" mailboxes =INBOX =Archive =Sent =Trash =Spam mailboxes =Automatic.DMARC mailboxes =Lists.Money\ Stuff =Lists.NYT =Lists.SWICG =Lists.Evergreen\ MBA mailboxes =NeedleandFoot +macro index $ "mbsync andrew@amd.imnotmuch new" "sync email" +macro index \\\\ "" "Search mail" + ### Mailbox Locations set spoolfile = "+INBOX" @@ -30,8 +36,13 @@ set trash = "=Trash" ### Local Folders set header_cache = "~/.cache/neomutt/headers" set message_cachedir = "~/.cache/neomutt/messages" -macro index $ "mbsync andrew@amd.imnotmuch new" "sync email" -macro index \\\\ "" "Search mail" + + +### Use `khard` for contact lookup +### To query an address use ctrl-t +set query_command= "khard email --parsable --search-in-source-files %s" +bind editor complete-query + ### Local Settings set mail_check = 60 # check for mail every XX seconds diff --git a/email/.config/vdirsyncer/config b/email/.config/vdirsyncer/config new file mode 100644 index 0000000..6d368dd --- /dev/null +++ b/email/.config/vdirsyncer/config @@ -0,0 +1,19 @@ +[general] +status_path = "~/.local/share/vdirsyncer/status" + +[pair nextcloud_contacts] +a = "nextcloud_contacts_local" +b = "nextcloud_contacts_remote" +collections = ["from a", "from b"] +metadata = ["displayname"] + +[storage nextcloud_contacts_local] +type = "filesystem" +path = "~/.local/share/vdirsyncer/nextcloud_contacts_local/" +fileext = ".vcf" + +[storage nextcloud_contacts_remote] +type = "carddav" +url = "https://cloud.andr3w.net/remote.php/dav/addressbooks/users/andrew/" +username = "andrew" +password.fetch = ["command", "pass", "nextcloud"] diff --git a/email/bin/sync_email.sh b/email/.local/bin/sync_email.sh similarity index 74% rename from email/bin/sync_email.sh rename to email/.local/bin/sync_email.sh index 74813c5..58701db 100755 --- a/email/bin/sync_email.sh +++ b/email/.local/bin/sync_email.sh @@ -2,3 +2,4 @@ mbsync andrew@amd.im notmuch new +vdirsyncer sync