-
Notifications
You must be signed in to change notification settings - Fork 163
Address Book Examples
Here are some examples how users configured their address books. The most basic examples can also be found in the official docs. But maybe you can find some more specialized ways to do it here :)
I (@lucc) use a custom shell script which queries email addresses from several sources much like the old lbdb. But my script also caches the email addresses in order to be fast even with slow backends. It is published here
The alot config for this is strait forward, because the script uses mutt's format.
[[[abook]]]
type = shellcommand
command = abq.sh
regexp = '^(?P<email>[^@]+@[^\t]+?) *\t *(?P<name>[^\t]+)(\t.*)?'
Import contact "From: address email.address@xxx.com" to abook
The abook integration of alot is great, but manually adding new contacts is tedious.
The following hook extracts the contact of a sender and imports it to the default abook addressbook:
add_to_abook.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
import os
from email import policy
from email.parser import BytesParser
raw = sys.stdin.buffer.read()
msg = BytesParser(policy=policy.default).parsebytes(raw)
text = str(msg.get('From'))
myCmd = 'echo "From: ' + text + '"| abook --add-email-quiet'
print(myCmd)
os.system(myCmd)
in the config
:
[bindings]
x = pipeto /home/rob/.config/alot/add_to_abook.py
Behaviour: With the email open (tread mode
), press x
to e(x)tract the Sender name/ address (From: ) and to import it to the abook. This hook should work on platforms that support the command line syntax: echo "From: Donald D. Duck <dduck.jr@disney.com>" | abook --add-email-quiet
.
Contact management with khard https://github.com/scheibler/khard/
- Synchronizing local contacts with my Nextcloud vCard DB is possible. https://vdirsyncer.pimutils.org/en/latest/tutorials/
- Contacts locally and remotely stored (redundancy/backup).
- Same address book on all computers.
- Editing of vCard contacts with kaddressbook (https://apps.kde.org/kaddressbook/).
- export abook DB to vCard file (.vcf) https://pypi.org/project/abook/
- import to NextCloud contacts.
Entry in the .config/alot/config
(for each account):
[[account]]
...
[[[abook]]]
type = shellcommand
command = khard email --remove-first-line --parsable
regexp = '^(?P<email>[^@]+@[^\t]+)\t+(?P<name>[^\t]+)'