Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Post History

50%
+0 −0
Q&A How to get a mailto: URI out of abook(1)

I store my address book with abook(1). https://manpages.debian.org/bookworm/abook/abook.1.en.html Let's say I want to introduce some contact in some field that accepts the usual name <email&gt...

1 answer  ·  posted 1y ago by alx‭  ·  last activity 1y ago by alx‭

Question abook mailto
#2: Post edited by user avatar alx‭ · 2023-09-30T14:15:52Z (about 1 year ago)
Add example of expected result
  • I store my address book with abook(1).
  • <https://manpages.debian.org/bookworm/abook/abook.1.en.html>
  • Let's say I want to introduce some contact in some field that accepts the usual `name <email>` format.
  • How can I ask abook(1) to produce that format?
  • The addressbook entry is the following:
  • ```
  • [0]
  • name=Alejandro Colomar
  • email=alx@kernel.org,alx.manpages@gmail.com
  • nick=alx
  • ```
  • (I hope it's a valid one.)
  • With --mutt-query, I can get something similar:
  • ```
  • $ abook --mutt-query alx
  • alx@kernel.org Alejandro Colomar
  • alx.manpages@gmail.com Alejandro Colomar
  • ```
  • Then, I can do some magic with custom formats, but I get a wrong email:
  • ```
  • $ abook --mutt-query=alx --outformat=vcard \
  • | abook --convert --infile=- --informat=vcard \
  • --outformat=custom --outformatstr='{name} <{email}>';
  • Alejandro Colomar <alx@kernel.org,alx.manpages@gmail.com>
  • ```
  • The above pipeline works only for contacts with a single email. Is there a way to make it work for every contact?
  • I store my address book with abook(1).
  • <https://manpages.debian.org/bookworm/abook/abook.1.en.html>
  • Let's say I want to introduce some contact in some field that accepts the usual `name <email>` format.
  • How can I ask abook(1) to produce that format?
  • The addressbook entry is the following:
  • ```
  • [0]
  • name=Alejandro Colomar
  • email=alx@kernel.org,alx.manpages@gmail.com
  • nick=alx
  • ```
  • (I hope it's a valid one.)
  • With --mutt-query, I can get something similar:
  • ```
  • $ abook --mutt-query alx
  • alx@kernel.org Alejandro Colomar
  • alx.manpages@gmail.com Alejandro Colomar
  • ```
  • Then, I can do some magic with custom formats, but I get a wrong email:
  • ```
  • $ abook --mutt-query=alx --outformat=vcard \
  • | abook --convert --infile=- --informat=vcard \
  • --outformat=custom --outformatstr='{name} <{email}>';
  • Alejandro Colomar <alx@kernel.org,alx.manpages@gmail.com>
  • ```
  • The above pipeline works only for contacts with a single email. Is there a way to make it work for every contact?
  • EDIT:
  • This is what I'd expect:
  • ```
  • $ abook --mutt-query=alx --outformat=mailto
  • Alejandro Colomar <alx@kernel.org>
  • Alejandro Colomar <alx.manpages@gmail.com>
  • ```
#1: Initial revision by user avatar alx‭ · 2023-09-24T13:18:40Z (about 1 year ago)
How to get a mailto: URI out of abook(1)
I store my address book with abook(1).

<https://manpages.debian.org/bookworm/abook/abook.1.en.html>

Let's say I want to introduce some contact in some field that accepts the usual `name <email>` format.

How can I ask abook(1) to produce that format?

The addressbook entry is the following:

```
[0]
name=Alejandro Colomar
email=alx@kernel.org,alx.manpages@gmail.com
nick=alx
```

(I hope it's a valid one.)

With --mutt-query, I can get something similar:

```
$ abook --mutt-query alx

alx@kernel.org	Alejandro Colomar	 
alx.manpages@gmail.com	Alejandro Colomar	 
```

Then, I can do some magic with custom formats, but I get a wrong email:

```
$ abook --mutt-query=alx --outformat=vcard \
  | abook --convert --infile=- --informat=vcard \
          --outformat=custom --outformatstr='{name} <{email}>';
Alejandro Colomar <alx@kernel.org,alx.manpages@gmail.com>
```

The above pipeline works only for contacts with a single email.  Is there a way to make it work for every contact?