Using mutt alias files for email address completion
written on Saturday, October 24, 2015
I use mutt as mail client at home and at work and I'm quite happy with it. One thing that bugs me though is the built-in alias support. Its email address completion is rather limited. Luckily, mutt supports QueryCommand that can be used to connect an arbitrary data source for external email address completion. I use a tiny wrapper for grep to search multiple alias files at once:
The query_command option in mutt must be set accordingly to use the script:
Mutt and the above script expect an alias file to be in the mutt query format. This format is rather simple and looks as follows (described here):
Most of my alias files are autogenerated using various scripts. One of those scripts connects to an LDAP server, finds the name and the email address of all company employees and converts them to the mutt query format described above (tested on Exchange):
Have fun.