Email address aliases

19 views
Skip to first unread message

Silvan Jegen

unread,
Jul 6, 2019, 5:02:13 PM7/6/19
to mbl...@googlegroups.com
Heyho

Ideally I don't want to type out people's whole email addresses when
composing emails. My first thought was to use an alias file with my
SMTP client (msmtp). This works fine for sending emails, except that
the aliases are not replaced in the mail headers. That means if a person
replies to all people in a mail from me, and the CC header contains an
alias like 'friend1', the email addressed to 'friend1' one will never
arrive since it's not a valid email address.

Currently I am using a new approach where I simply run 'sed' over the
headers of an email at composiition time to replace all my aliases with
the proper email addresses.

I feel like there should be a more elegant solution to this (involving
'msed' being invoked before passing an email to the sendmail program
perhaps?). Is there an easy way to get simple email address aliases
working that I am missing?


Cheers,

Silvan

Pierre Bellec

unread,
Jun 24, 2020, 4:07:09 PM6/24/20
to mblaze
Hi Silvan,

The following works with vim. It requires fzf and fzf.vim.

Once in a while, you can use
    maddr \| sort \| uniq > ~/my.contacts
to dump all contacts found in your emails in that file.

Then in .vimrc:
   inoremap <expr> <c-x><c-k> fzf#vim#complete('cat ~/my.contacts')
will let you complete emails inside vim using fzf when writing an email in vim.

Best wishes,
Pierre

Silvan Jegen

unread,
Dec 30, 2020, 5:53:00 AM12/30/20
to mbl...@googlegroups.com, Pierre Bellec
Hi Pierre

Long after the fact but here is my reply.

> The following works with vim. It requires fzf and fzf.vim.
>
> Once in a while, you can use
> maddr \| sort \| uniq > ~/my.contacts
> to dump all contacts found in your emails in that file.
>
> Then in .vimrc:
> inoremap <expr> <c-x><c-k> fzf#vim#complete('cat ~/my.contacts')
> will let you complete emails inside vim using fzf when writing an email in
> vim.

Thank you for this! I have switched to vis[0] as my email editor but it
looks like there is a fzf plugin[1] for it as well.

I may try this approach in the future!


Cheers,

Silvan

[0] https://git.sr.ht/~martanne/vis
[1] https://github.com/guillaumeboudon/vis-fzf
Reply all
Reply to author
Forward
0 new messages