~rek2/Hispagatos-wiki

#Configurar libreta de direcciones de Protonmail con AERC

#Instalar proxy para sincronizar IMAP y CALDAV desde protonmail, hydroxide y aerc
paru -S aerc
paru -S hydroxide
paru -S khard
paru -S vdirsyncer
paru -S gopass
  • No voy a entrar de momento en como configurar AERC y Hydroxide ya que es muy facil y esta en la documentacion oficial alomejor mas adelante
#Configurar aerc
#Hydroxide
  • Lo mismo que arriba mirar la doc de mientras es muy facil
#Configurar vdirsyncer
  • vdirsyncer es para bajarnos los contactos a nuestro ordenador
  • la configuracion esta en ~/.config/vdirsyncer
  • vamos a crear la base
cd ~/.config
mkdir vdirsyncer
cd vdirsyncer/
wget https://raw.githubusercontent.com/pimutils/vdirsyncer/master/config.example -O config
mkdir status
mkdir contacts
  • Aqui editamos el config que es por defecto de muestra tenemos que cambiar los PATH a ~/.config/vdirsyncer por poner un ejemplo de algo que nos toca hacer.
  • Para ayudar un ejemplo de mi configuracion usando GOPASS para no tener credenciales en claro en el disco duro.
  • pero para cambios mirar mi dotfiles con chezmoi en mi repo de https://sr.ht/~rek2
# Move it to ~/.vdirsyncer/config or ~/.config/vdirsyncer/config and edit it.
# Run `vdirsyncer --help` for CLI usage.
#
# http://vdirsyncer.pimutils.org/ for the rest of them.

[general]
# A folder where vdirsyncer can store some metadata about each pair.
status_path = "~/.config/vdirsyncer/status/"

# CARDDAV
[pair protonmail]
# A `[pair <name>]` block defines two storages `a` and `b` that should be
# synchronized. The definition of these storages follows in `[storage <name>]`
# blocks. This is similar to accounts in OfflineIMAP.
a = "protonmail_contacts_local"
b = "protonmail_contacts_remote"

# Synchronize all collections that can be found.
# You need to run `vdirsyncer discover` if new calendars/addressbooks are added
# on the server.

collections = ["from a", "from b"]

# Synchronize the "display name" property into a local file (~/.contacts/displayname).
metadata = ["displayname"]

# To resolve a conflict the following values are possible:
#   `null` - abort when collisions occur (default)
#   `"a wins"` - assume a's items to be more up-to-date
#   `"b wins"` - assume b's items to be more up-to-date
#conflict_resolution = null

[storage protonmail_contacts_local]
# A storage references actual data on a remote server or on the local disk.
# Similar to repositories in OfflineIMAP.
type = "filesystem"
path = "~/.config/vdirsyncer/contacts/"
fileext = ".vcf"

[storage protonmail_contacts_remote]
type = "carddav"
#url = "https://owncloud.example.com/remote.php/carddav/"
url = "http://127.0.0.1:8080/"
username = "rek2@hispagatos.org"
# The password can also be fetched from the system password storage, netrc or a
# custom command. See http://vdirsyncer.pimutils.org/en/stable/keyring.html
password.fetch = ["command", "gopass", "show", "-o", "-f", "email/rek2@hispagatos.org"]
  • Ojo que el password.fetch no viene en el config de ejemplo, he sido yo que me he RTFM la documentacion para poder usar pass o gopass y asi no tener passwords en lo claro en ningun sitio en mi sistema. no me seais lamers PASSWORDS NUNCA SIN CIFRAR EN NINGUN LADO.

  • Ahora primero hacemos el discovery para encontrar los address-books remotos

  • Y seguido hacemos el sync para bajarlos

vdirsyncer discover
Discovering collections for pair protonmail
protonmail_contacts_local:
  - "127.0.0.1:8080"
protonmail_contacts_remote:
  - "127.0.0.1:8080" ("ProtonMail")
Saved for protonmail: collections = ["127.0.0.1:8080"]
vdirsyncer sync
Syncing protonmail/127.0.0.1:8080
  • Ahora lo podemos poner en un crontab
*/180 * * * * vdirsyncer sync
#Configurar Khard
  • la configuracion es en ~/.config/khard/khard.config
mkdir ~/.config/khard
cd ~/.config/khard
wget https://raw.githubusercontent.com/scheibler/khard/develop/doc/source/examples/khard.conf.example -O khard.conf
  • Ahora a editar la configuracion leer la documentacion original y comparar con mi configuracion abajo:
# Place it under ~/.config/khard/khard.conf
# This file is parsed by the configobj library.  The syntax is described at
# https://configobj.readthedocs.io/en/latest/configobj.html#the-config-file-format

[general]
debug = no
default_action = list
# These are either strings or comma seperated lists
editor = vim, -i, NONE
merge_editor = vimdiff

[addressbooks]

[[Personal]]
path = ~/.config/vdirsyncer/contacts/127.0.0.1:8080

[contact table]
# display names by first or last name: first_name / last_name / formatted_name
display = first_name
# group by address book: yes / no
group_by_addressbook = no
# reverse table ordering: yes / no
reverse = no
# append nicknames to name column: yes / no
show_nicknames = no
# show uid table column: yes / no
show_uids = yes
# sort by first or last name: first_name / last_name / formatted_name
sort = first_name
# localize dates: yes / no
localize_dates = yes
# set a comma separated list of preferred phone number types in descending priority
# or nothing for non-filtered alphabetical order
preferred_phone_number_type = pref, cell, home
# set a comma separated list of preferred email address types in descending priority
# or nothing for non-filtered alphabetical order
preferred_email_address_type = pref, work, home

[vcard]
# extend contacts with your own private objects
# these objects are stored with a leading "X-" before the object name in the vcard files
# every object label may only contain letters, digits and the - character
# example:
#   private_objects = Jabber, Skype, Twitter
# default: ,  (the empty list)
private_objects = Jabber, Mastodon, Matrix, Signal
# preferred vcard version: 3.0 / 4.0
preferred_version = 3.0
# Look into source vcf files to speed up search queries: yes / no
search_in_source_files = no
# skip unparsable vcard files: yes / no
skip_unparsable = no
  • Si ahora corremos khard nos muestra todos los contactos de protonmail:
khard
  • Para editar un contacto
khard edit rek2
  • Leeros la documentacion :)
#Configurar Aerc para que lea de Khar las direcciones:
  • Si leememos el man aerc.conf vemos:
[compose]
...
address-book-cmd=khard email --parsable --remove-first-line %s
  • Tambien lo pone en el wiki de Arch para aerc
#GnuPG configuracion para aerc
#Enlaces a documentacion original

About this wiki

commit f332885e5ace0304b004520b125917c224344019
Author: rek2 <rek2@hispagatos.org>
Date:   2022-06-26T06:00:13+02:00

xdg-mime default aerc.desktop x-scheme-handler/mailto
Clone this wiki
https://git.sr.ht/~rek2/Hispagatos-wiki (read-only)
git@git.sr.ht:~rek2/Hispagatos-wiki (read/write)