Changes between Version 1 and Version 2 of MuttGuide/Aliases


Ignore:
Timestamp:
Oct 27, 2013 6:17:15 PM (4 years ago)
Author:
MichaelRay
Comment:

RFC 2606, minor grammar & wikiml fixes

Legend:

Unmodified
Added
Removed
Modified
  • MuttGuide/Aliases

    v1 v2  
    11Keywords to fill:
    22* alias_file, source
    3 * group alias: "<tt>alias aliasname groupname: list of addr, addr, ... </tt><b>;</b>"
     3* group alias: "'''alias aliasname groupname: list of addr, addr, ... ''' ''';'''"
    44* QueryCommand
    55* reverse_alias
     
    1313nickname or alias and a long name (optional) and an email address.
    1414
    15 <tt>alias <nickname> [ <long name> ] <address></tt>
     15'''alias <nickname> [ <long name> ] <address>'''
    1616
    1717Since the name can consist of several whitespace-separated words,
     
    2020
    2121For example:
    22 <tt>alias mumon My dear pupil Mumon foobar@mu.org</tt>
     22'''alias mumon My dear pupil Mumon foobar@example.com'''
    2323
    2424will be parsed in this way:
    25 <pre>
    26 alias mumon      My dear pupil Mumon foobar@mu.org
     25{{{
     26alias mumon      My dear pupil Mumon foobar@example.com
    2727      ^          ^                   ^
    2828      nickname   long name           email address
    29 </pre>
     29}}}
    3030
    3131The nickname (or alias) will be used to select a corresponding long
     
    3737way:
    3838
    39 <pre>
     39{{{
    4040alias mumon      foobar@mu.org
    4141      ^          ^
    4242      nickname   email address
    43 </pre>
     43}}}
    4444
    4545The mutt aliases mechanism works in this way: you select an alias
     
    4848header of the mail in this way:
    4949
    50 <tt>To: <long name> <email address></tt>
     50'''To: <long name> <email address>'''
    5151
    5252If the alias command doesn't specify a long name, then it will fill
    5353the To: header in this way:
    5454
    55 <tt>To: <email address></tt>
     55'''To: <email address>'''
    5656
    5757=== Aliases management setup ===
     
    6161The $alias_file variable let you define this file. For example:
    6262
    63 <tt>set alias_file=~/.mutt/aliases      # where I keep my aliases</tt>
    64 
    65 In order to load them (e.g to get auto-completion working with 'em)
     63'''set alias_file=~/.mutt/aliases       # where I keep my aliases'''
     64
     65In order to load them with auto-completion
    6666you need to source the file with:
    6767
    68 <tt>source ~/.mutt/aliases</tt>
     68'''source ~/.mutt/aliases'''
    6969
    7070or even better (this works only with variable expansion, available in mutt >=1.5.12) with:
    7171
    72 <tt>source $alias_file</tt>
    73 
    74 The <tt>$sort_alias</tt> variable let you decide how you want to see the list of
    75 aliases sorted, according to aliases or nicknames (<tt>set
    76 sort_alias=alias</tt>), to addresses (<tt>set sort_alias = address</tt>) or unsorted (<tt>set
    77 sort_alias= unsorted</tt>) to keep the same order of the aliases file.
    78 
    79 <tt>$alias_format</tt> lets you specify the format of the aliases menu (similar
    80 to the <tt>$folder_format</tt> and <tt>$index_format</tt> variables).
     72'''source $alias_file'''
     73
     74The '''$sort_alias''' variable let you decide how you want to see the list of
     75aliases sorted, according to aliases or nicknames ('''set
     76sort_alias=alias'''), to addresses ('''set sort_alias = address''') or unsorted ('''set
     77sort_alias= unsorted''') to keep the same order of the aliases file.
     78
     79'''$alias_format''' lets you specify the format of the aliases menu (similar
     80to the '''$folder_format''' and '''$index_format''' variables).
    8181
    8282A reasonable aliases setup could consists of the following lines:
    83 <pre>
     83{{{
    8484set alias_file= ~/.mutt/aliases
    8585set sort_alias= alias
    8686set reverse_alias=yes
    8787source $alias_file
    88 </pre>
     88}}}
    8989
    9090=== Aliases menu ===
     
    101101this way:
    102102
    103 <tt>To: <long name> <email address></tt>
     103'''To: <long name> <email address>'''
    104104
    105105The long name specified in the alias command is what is displayed in
    106106the To field for example as in:
    107107
    108 <tt>To: My dear pupil Mumon <foobar@mu.org></tt>
     108'''To: My dear pupil Mumon <foobar@example.com>
    109109
    110110that is it uses the following format:
    111111
    112 <tt>To: <long name> <address></tt>
     112'''To: <long name> <address>'''
    113113
    114114If the long name isn't specified, as in:
    115 <tt>alias mumon <foobar@mu.org></tt>
     115'''alias mumon <foobar@example.com>'''
    116116
    117117then the To: field will be filled in this way:
    118 <tt>To: mumon <foobar@mu.org></tt>
     118'''To: mumon <foobar@example.com>'''
    119119 
    120120Please note that the auto-completion performed by mutt is always
     
    144144
    145145If you're getting hairy, for example if you want to keep a sort of
    146 address book containing not only the few informations the mutt aliases
    147 file let you bookkeep, you can use mutt in combination with an external
     146address book containing not only the information the mutt aliases
     147file let you track, you can use mutt in combination with an external
    148148contact bookkeeper program like abook or ximian evolution.
    149149
    150 For example you would get bored to have to keep the email addresses
    151 and other contacts informations (e.g. telephone numbers, sip
     150For example you might get bored to have to keep the email addresses
     151and other contacts information (e.g. telephone numbers, sip
    152152addresses, geographical addresses) duplicated in different record
    153153formats, and have to manually and painfully synchronize them.
     
    164164
    165165In order to integrate mutt with an external program you need to define
    166 the <tt>$query_command variable</tt> (a more meaningful name could be:
    167 <tt>$external_addressbook_query_command</tt>).
     166the '''$query_command variable''' (a more meaningful name could be:
     167'''$external_addressbook_query_command''').
    168168
    169169It is the program executed when calling the function <query>
     
    172172consisting of lines of the format:
    173173
    174 <pre>
     174{{{
    175175<email address> <tab> <long name> <tab> <other info> <newline>
    176 </pre>
     176}}}
    177177
    178178This output will be parsed by mutt to fill the so called query menu with the
     
    180180
    181181For example if the $query_command is set in this way:
    182 <pre>
     182{{{
    183183set query_command = "abook --mutt-query '%s'"
    184 </pre>
     184}}}
    185185
    186186the corresponding <query> function will prompt for a search string,
    187187then will call the command:
    188188
    189 <pre>
     189{{{
    190190abook --mutt-query '<search string>'
    191 </pre>
     191}}}
    192192
    193193and will display the output in the query menu.
     
    216216A simple setup for using abook as an external addressbook program:
    217217
    218 <pre>
     218{{{
    219219set query_command = "abook --mutt-query '%s'"
    220220macro generic,index,pager \ca "<shell-escape>abook<return>" "launch abook"
    221221macro index,pager A "<pipe-message>abook --add-email<return>" "add the sender address to abook"
    222 </pre>
     222}}}
    223223
    224224You can also use the abook convert facility to import the content of a mutt aliases file into abook.
    225225This is the syntax:
    226 <pre>
     226{{{
    227227abook --convert [ --informat <input format>  ]  [  --infile  <input file>  ]  [ --outformat <output format> ] [ --outfile <output file> ]
    228 </pre>
     228}}}
    229229
    230230It will convert <input file> in <input format> to <output file> in <output format>.
    231231
    232232So for example:
    233 <pre>
     233{{{
    234234 abook --convert --informat mutt --infile ~/.mutt/aliases --outformat abook --outfile ~/.abook/addressbook
    235 </pre>
     235}}}