~ubuntu-dev/ubuntu/lucid/mutt/lucid-201002110857

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179
6180
6181
6182
6183
6184
6185
6186
6187
6188
6189
6190
6191
6192
6193
6194
6195
6196
6197
6198
6199
6200
6201
6202
6203
6204
6205
6206
6207
6208
6209
6210
6211
6212
6213
6214
6215
6216
6217
6218
6219
6220
6221
6222
6223
6224
6225
6226
6227
6228
6229
6230
6231
6232
6233
6234
6235
6236
6237
6238
6239
6240
6241
6242
6243
6244
6245
6246
6247
6248
6249
6250
6251
6252
6253
6254
6255
6256
6257
6258
6259
6260
6261
6262
6263
6264
6265
6266
6267
6268
6269
6270
6271
6272
6273
6274
6275
6276
6277
6278
6279
6280
6281
6282
6283
6284
6285
6286
6287
6288
6289
6290
6291
6292
6293
6294
6295
6296
6297
6298
6299
6300
6301
6302
6303
6304
6305
6306
6307
6308
6309
6310
6311
6312
6313
6314
6315
6316
6317
6318
6319
6320
6321
6322
6323
6324
6325
6326
6327
6328
6329
6330
6331
6332
6333
6334
6335
6336
6337
6338
6339
6340
6341
6342
6343
6344
6345
6346
6347
6348
6349
6350
6351
6352
6353
6354
6355
6356
6357
6358
6359
6360
6361
6362
6363
6364
6365
6366
6367
6368
6369
6370
6371
6372
6373
6374
6375
6376
6377
6378
6379
6380
6381
6382
6383
6384
6385
6386
6387
6388
6389
6390
6391
6392
6393
6394
6395
6396
6397
6398
6399
6400
6401
6402
6403
6404
6405
6406
6407
6408
6409
6410
6411
6412
6413
6414
6415
6416
6417
6418
6419
6420
6421
6422
6423
6424
6425
6426
6427
6428
6429
6430
6431
6432
6433
6434
6435
6436
6437
6438
6439
6440
6441
6442
6443
6444
6445
6446
6447
6448
6449
6450
6451
6452
6453
6454
6455
6456
6457
6458
6459
6460
6461
6462
6463
6464
6465
6466
6467
6468
6469
6470
6471
6472
6473
6474
6475
6476
6477
6478
6479
6480
6481
6482
6483
6484
6485
6486
6487
6488
6489
6490
6491
6492
6493
6494
6495
6496
6497
6498
6499
6500
6501
6502
6503
6504
6505
6506
6507
6508
6509
6510
6511
6512
6513
6514
6515
6516
6517
6518
6519
6520
6521
6522
6523
6524
6525
6526
6527
6528
6529
6530
6531
6532
6533
6534
6535
6536
6537
6538
6539
6540
6541
6542
6543
6544
6545
6546
6547
6548
6549
6550
6551
6552
6553
6554
6555
6556
6557
6558
6559
6560
6561
6562
6563
6564
6565
6566
6567
6568
6569
6570
6571
6572
6573
6574
6575
6576
6577
6578
6579
6580
6581
6582
6583
6584
6585
6586
6587
6588
6589
6590
6591
6592
6593
6594
6595
6596
6597
6598
6599
6600
6601
6602
6603
6604
6605
6606
6607
6608
6609
6610
6611
6612
6613
6614
6615
6616
6617
6618
6619
6620
6621
6622
6623
6624
6625
6626
6627
6628
6629
6630
6631
6632
6633
6634
6635
6636
6637
6638
6639
6640
6641
6642
6643
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653
6654
6655
6656
6657
6658
6659
6660
6661
6662
6663
6664
6665
6666
6667
6668
6669
6670
6671
6672
6673
6674
6675
6676
6677
6678
6679
6680
6681
6682
6683
6684
6685
6686
6687
6688
6689
6690
6691
6692
6693
6694
6695
6696
6697
6698
6699
6700
6701
6702
6703
6704
6705
6706
6707
6708
6709
6710
6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
6723
6724
6725
6726
6727
6728
6729
6730
6731
6732
6733
6734
6735
6736
6737
6738
6739
6740
6741
6742
6743
6744
6745
6746
6747
6748
6749
6750
6751
6752
6753
6754
6755
6756
6757
6758
6759
6760
6761
6762
6763
6764
6765
6766
6767
6768
6769
6770
6771
6772
6773
6774
6775
6776
6777
6778
6779
6780
6781
6782
6783
6784
6785
6786
6787
6788
6789
6790
6791
6792
6793
6794
6795
6796
6797
6798
6799
6800
6801
6802
6803
6804
6805
6806
6807
6808
6809
6810
6811
6812
6813
6814
6815
6816
6817
6818
6819
6820
6821
6822
6823
6824
6825
6826
6827
6828
6829
6830
6831
6832
6833
6834
6835
6836
6837
6838
6839
6840
6841
6842
6843
6844
6845
6846
6847
6848
6849
6850
6851
6852
6853
6854
6855
6856
6857
6858
6859
6860
6861
6862
6863
6864
6865
6866
6867
6868
6869
6870
6871
6872
6873
6874
6875
6876
6877
6878
6879
6880
6881
6882
6883
6884
6885
6886
6887
6888
6889
6890
6891
6892
6893
6894
6895
6896
6897
6898
6899
6900
6901
6902
6903
6904
6905
6906
6907
6908
6909
6910
6911
6912
6913
6914
6915
6916
6917
6918
6919
6920
6921
6922
6923
6924
6925
6926
6927
6928
6929
6930
6931
6932
6933
6934
6935
6936
6937
6938
6939
6940
6941
6942
6943
6944
6945
6946
6947
6948
6949
6950
6951
6952
6953
6954
6955
6956
6957
6958
6959
6960
6961
6962
6963
6964
6965
6966
6967
6968
6969
6970
6971
6972
6973
6974
6975
6976
6977
6978
6979
6980
6981
6982
6983
6984
6985
6986
6987
6988
6989
6990
6991
6992
6993
6994
6995
6996
6997
6998
6999
7000
7001
7002
7003
7004
7005
7006
7007
7008
7009
7010
7011
7012
7013
7014
7015
7016
7017
7018
7019
7020
7021
7022
7023
7024
7025
7026
7027
7028
7029
7030
7031
7032
7033
7034
7035
7036
7037
7038
7039
7040
7041
7042
7043
7044
7045
7046
7047
7048
7049
7050
7051
7052
7053
7054
7055
7056
7057
7058
7059
7060
7061
7062
7063
7064
7065
7066
7067
7068
7069
7070
7071
7072
7073
7074
7075
7076
7077
7078
7079
7080
7081
7082
7083
7084
7085
7086
7087
7088
7089
7090
7091
7092
7093
7094
7095
7096
7097
7098
7099
7100
7101
7102
7103
7104
7105
7106
7107
7108
7109
7110
7111
7112
7113
7114
7115
7116
7117
7118
7119
7120
7121
7122
7123
7124
7125
7126
7127
7128
7129
7130
7131
7132
7133
7134
7135
7136
7137
7138
7139
7140
7141
7142
7143
7144
7145
7146
7147
7148
7149
7150
7151
7152
7153
7154
7155
7156
7157
7158
7159
7160
7161
7162
7163
7164
7165
7166
7167
7168
7169
7170
7171
7172
7173
7174
7175
7176
7177
7178
7179
7180
7181
7182
7183
7184
7185
7186
7187
7188
7189
7190
7191
7192
7193
7194
7195
7196
7197
7198
7199
7200
7201
7202
7203
7204
7205
7206
7207
7208
7209
7210
7211
7212
7213
7214
7215
7216
7217
7218
7219
7220
7221
7222
7223
7224
7225
7226
7227
7228
7229
7230
7231
7232
7233
7234
7235
7236
7237
7238
7239
7240
7241
7242
7243
7244
7245
7246
7247
7248
7249
7250
7251
7252
7253
7254
7255
7256
7257
7258
7259
7260
7261
7262
7263
7264
7265
7266
7267
7268
7269
7270
7271
7272
7273
7274
7275
7276
7277
7278
7279
7280
7281
7282
7283
7284
7285
7286
7287
7288
7289
7290
7291
7292
7293
7294
7295
7296
7297
7298
7299
7300
7301
7302
7303
7304
7305
7306
7307
7308
7309
7310
7311
7312
7313
7314
7315
7316
7317
7318
7319
7320
7321
7322
7323
7324
7325
7326
7327
7328
7329
7330
7331
7332
7333
7334
7335
7336
7337
7338
7339
7340
7341
7342
7343
7344
7345
7346
7347
7348
7349
7350
7351
7352
7353
7354
7355
7356
7357
7358
7359
7360
7361
7362
7363
7364
7365
7366
7367
7368
7369
7370
7371
7372
7373
7374
7375
7376
7377
7378
7379
7380
7381
7382
7383
7384
7385
7386
7387
7388
7389
7390
7391
7392
7393
7394
7395
7396
7397
7398
7399
7400
7401
7402
7403
7404
7405
7406
7407
7408
7409
7410
7411
7412
7413
7414
7415
7416
7417
7418
7419
7420
7421
7422
7423
7424
7425
7426
7427
7428
7429
7430
7431
7432
7433
7434
7435
7436
7437
7438
7439
7440
7441
7442
7443
7444
7445
7446
7447
7448
7449
7450
7451
7452
7453
7454
7455
7456
7457
7458
7459
7460
7461
7462
7463
7464
7465
7466
7467
7468
7469
7470
7471
7472
7473
7474
7475
7476
7477
7478
7479
7480
7481
7482
7483
7484
7485
7486
7487
7488
7489
7490
7491
7492
7493
7494
7495
7496
7497
7498
7499
7500
7501
7502
7503
7504
7505
7506
7507
7508
7509
7510
7511
7512
7513
7514
7515
7516
7517
7518
7519
7520
7521
7522
7523
7524
7525
7526
7527
7528
7529
7530
7531
7532
7533
7534
7535
7536
7537
7538
7539
7540
7541
7542
7543
7544
7545
7546
7547
7548
7549
7550
7551
7552
7553
7554
7555
7556
7557
7558
7559
7560
7561
7562
7563
7564
7565
7566
7567
7568
7569
7570
7571
7572
7573
7574
7575
7576
7577
7578
7579
7580
7581
7582
7583
7584
7585
7586
7587
7588
7589
7590
7591
7592
7593
7594
7595
7596
7597
7598
7599
7600
7601
7602
7603
7604
7605
7606
7607
7608
7609
7610
7611
7612
7613
7614
7615
7616
7617
7618
7619
7620
7621
7622
7623
7624
7625
7626
7627
7628
7629
7630
7631
7632
7633
7634
7635
7636
7637
7638
7639
7640
7641
7642
7643
7644
7645
7646
7647
7648
7649
7650
7651
7652
7653
7654
7655
7656
7657
7658
7659
7660
7661
7662
7663
7664
7665
7666
7667
7668
7669
7670
7671
7672
7673
7674
7675
7676
7677
7678
7679
7680
7681
7682
7683
7684
7685
7686
7687
7688
7689
7690
7691
7692
7693
7694
7695
7696
7697
7698
7699
7700
7701
7702
7703
7704
7705
7706
7707
7708
7709
7710
7711
7712
7713
7714
7715
7716
7717
7718
7719
7720
7721
7722
7723
7724
7725
7726
7727
7728
7729
7730
7731
7732
7733
7734
7735
7736
7737
7738
7739
7740
7741
7742
7743
7744
7745
7746
7747
7748
7749
7750
7751
7752
7753
7754
7755
7756
7757
7758
7759
7760
7761
7762
7763
7764
7765
7766
7767
7768
7769
7770
7771
7772
7773
7774
7775
7776
7777
7778
7779
7780
7781
7782
7783
7784
7785
7786
7787
7788
7789
7790
7791
7792
7793
7794
7795
7796
7797
7798
7799
7800
7801
7802
7803
7804
7805
7806
7807
7808
7809
7810
7811
7812
7813
7814
7815
7816
7817
7818
7819
7820
7821
7822
7823
7824
7825
7826
7827
7828
7829
7830
7831
7832
7833
7834
7835
7836
7837
7838
7839
7840
7841
7842
7843
7844
7845
7846
7847
7848
7849
7850
7851
7852
7853
7854
7855
7856
7857
7858
7859
7860
7861
7862
7863
7864
7865
7866
7867
7868
7869
7870
7871
7872
7873
7874
7875
7876
7877
7878
7879
7880
7881
7882
7883
7884
7885
7886
7887
7888
7889
7890
7891
7892
7893
7894
7895
7896
7897
7898
7899
7900
7901
7902
7903
7904
7905
7906
7907
7908
7909
7910
7911
7912
7913
7914
7915
7916
7917
7918
7919
7920
7921
7922
7923
7924
7925
7926
7927
7928
7929
7930
7931
7932
7933
7934
7935
7936
7937
7938
7939
7940
7941
7942
7943
7944
7945
7946
7947
7948
7949
7950
7951
7952
7953
7954
7955
7956
7957
7958
7959
7960
7961
7962
7963
7964
7965
7966
7967
7968
7969
7970
7971
7972
7973
7974
7975
7976
7977
7978
7979
7980
7981
7982
7983
7984
7985
7986
7987
7988
7989
7990
7991
7992
7993
7994
7995
7996
7997
7998
7999
8000
8001
8002
8003
8004
8005
8006
8007
8008
8009
8010
8011
8012
8013
8014
8015
8016
8017
8018
8019
8020
8021
8022
8023
8024
8025
8026
8027
8028
8029
8030
8031
8032
8033
8034
8035
8036
8037
8038
8039
8040
8041
8042
8043
8044
8045
8046
8047
8048
8049
8050
8051
8052
8053
8054
8055
8056
8057
8058
8059
8060
8061
8062
8063
8064
8065
8066
8067
8068
8069
8070
8071
8072
8073
8074
8075
8076
8077
8078
8079
8080
8081
8082
8083
8084
8085
8086
8087
8088
8089
8090
8091
8092
8093
8094
8095
8096
8097
8098
8099
8100
8101
8102
8103
8104
8105
8106
8107
8108
8109
8110
8111
8112
8113
8114
8115
8116
8117
8118
8119
8120
8121
8122
8123
8124
8125
8126
8127
8128
8129
8130
8131
8132
8133
8134
8135
8136
8137
8138
8139
8140
8141
8142
8143
8144
8145
8146
8147
8148
8149
8150
8151
8152
8153
8154
8155
8156
8157
8158
8159
8160
8161
8162
8163
8164
8165
8166
8167
8168
8169
8170
8171
8172
8173
8174
8175
8176
8177
8178
8179
8180
8181
8182
8183
8184
8185
8186
8187
8188
8189
8190
8191
8192
8193
8194
8195
8196
8197
8198
8199
8200
8201
8202
8203
8204
8205
8206
8207
8208
8209
8210
8211
8212
8213
8214
8215
8216
8217
8218
8219
8220
8221
8222
8223
8224
8225
8226
8227
8228
8229
8230
8231
8232
8233
8234
8235
8236
8237
8238
8239
8240
8241
8242
8243
8244
8245
8246
8247
8248
8249
8250
8251
8252
8253
8254
8255
8256
8257
8258
8259
8260
8261
8262
8263
8264
8265
8266
8267
8268
8269
8270
8271
8272
8273
8274
8275
8276
8277
8278
8279
8280
8281
8282
8283
8284
8285
8286
8287
8288
8289
8290
8291
8292
8293
8294
8295
8296
8297
8298
8299
8300
8301
8302
8303
8304
8305
8306
8307
8308
8309
8310
8311
8312
8313
8314
8315
8316
8317
8318
8319
8320
8321
8322
8323
8324
8325
8326
8327
8328
8329
8330
8331
8332
8333
8334
8335
8336
8337
8338
8339
8340
8341
8342
8343
8344
8345
8346
8347
8348
8349
8350
8351
8352
8353
8354
8355
8356
8357
8358
8359
8360
8361
8362
8363
8364
8365
8366
8367
8368
8369
8370
8371
8372
8373
8374
8375
8376
8377
8378
8379
8380
8381
8382
8383
8384
8385
8386
8387
8388
8389
8390
8391
8392
8393
8394
8395
8396
8397
8398
8399
8400
8401
8402
8403
8404
8405
8406
8407
8408
8409
8410
8411
8412
8413
8414
8415
8416
8417
8418
8419
8420
8421
8422
8423
8424
8425
8426
8427
8428
<?xml version="1.0" standalone="no"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
  "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
<book>

<bookinfo>
<title>The Mutt E-Mail Client</title>
<author>
<firstname>Michael</firstname><surname>Elkins</surname>
<email>me@cs.hmc.edu</email>
</author>
<releaseinfo>version @VERSION@</releaseinfo>

<abstract>
<para>
<quote>All mail clients suck.  This one just sucks less.</quote> &mdash; me, circa 1995
</para>
</abstract>
</bookinfo>

<chapter id="intro">
<title>Introduction</title>

<para>
<emphasis role="bold">Mutt</emphasis> is a small but very powerful text-based MIME mail client.  Mutt is
highly configurable, and is well suited to the mail power user with advanced
features like key bindings, keyboard macros, mail threading, regular
expression searches and a powerful pattern matching language for selecting
groups of messages.
</para>

<sect1 id="homepage">
<title>Mutt Home Page</title>

<para>
The official homepage can be found at
<ulink url="http://www.mutt.org/">http://www.mutt.org/</ulink>.
</para>

</sect1>

<sect1 id="muttlists">
<title>Mailing Lists</title>

<para>
To subscribe to one of the following mailing lists, send a message with the
word <emphasis>subscribe</emphasis> in the body to
<literal>list-name</literal><emphasis>-request</emphasis><literal>@mutt.org</literal>.
</para>

<itemizedlist>
<listitem>

<para>
<email>mutt-announce-request@mutt.org</email> -- low traffic list for announcements
</para>
</listitem>
<listitem>

<para>
<email>mutt-users-request@mutt.org</email> -- help, bug reports and feature requests
</para>
</listitem>
<listitem>

<para>
<email>mutt-dev-request@mutt.org</email> -- development mailing list
</para>
</listitem>

</itemizedlist>

<note>
<para>
All messages posted to
<emphasis>mutt-announce</emphasis> are automatically forwarded to
<emphasis>mutt-users</emphasis>, so you do not need to be subscribed to
both lists.
</para>
</note>

</sect1>

<sect1 id="distribution">
<title>Getting Mutt</title>

<para>
Mutt releases can be downloaded from
<ulink url="ftp://ftp.mutt.org/mutt/">ftp://ftp.mutt.org/mutt/</ulink>.
For a list of mirror sites, please refer to
<ulink url="http://www.mutt.org/download.html">http://www.mutt.org/download.html</ulink>.
</para>

<para>
For nightly tarballs and version control access, please refer to the
<ulink url="http://dev.mutt.org/">Mutt development site</ulink>.
</para>

</sect1>

<sect1 id="irc">
<title>Mutt Online Resources</title>

<variablelist>

<varlistentry>
<term>Bug Tracking System</term>
<listitem>
<para>
The official Mutt bug tracking system can be found at
<ulink url="http://bugs.mutt.org/">http://bugs.mutt.org/</ulink>
</para>
</listitem>
</varlistentry>

<varlistentry>
<term>Wiki</term>
<listitem>
<para>
An (unofficial) wiki can be found
at <ulink url="http://wiki.mutt.org/">http://wiki.mutt.org/</ulink>.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term>IRC</term>
<listitem>
<para>
For the IRC user community, visit channel <emphasis>&num;mutt</emphasis> on
<ulink url="http://www.freenode.net/">irc.freenode.net</ulink>.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term>USENET</term>
<listitem>
<para>
For USENET, see the newsgroup <ulink url="news:comp.mail.mutt">comp.mail.mutt</ulink>.
</para>
</listitem>
</varlistentry>

</variablelist>

</sect1>

<sect1 id="contrib">
<title>Contributing to Mutt</title>

<para>
There are various ways to contribute to the Mutt project.
</para>

<para>
Especially for new users it may be helpful to meet other new and
experienced users to chat about Mutt, talk about problems and share
tricks.
</para>

<para>
Since translations of Mutt into other languages are highly appreciated,
the Mutt developers always look for skilled translators that help
improve and continue to maintain stale translations.
</para>

<para>
For contributing code patches for new features and bug fixes, please
refer to the developer pages at
<ulink url="http://dev.mutt.org/">http://dev.mutt.org/</ulink> for more details.
</para>

</sect1>

<sect1 id="typo">
<title>Typograhical Conventions</title>

<para>
This section lists typographical conventions followed throughout this
manual. See table <xref linkend="tab-typo"/> for typographical
conventions for special terms.
</para>

<table id="tab-typo">
<title>Typographical conventions for special terms</title>
<tgroup cols="2">
<thead>
<row><entry>Item</entry><entry>Refers to...</entry></row>
</thead>
<tbody>
<row><entry><literal>printf(3)</literal></entry><entry>UNIX manual pages, execute <literal>man 3 printf</literal></entry></row>
<row><entry><literal>&lt;PageUp&gt;</literal></entry><entry>named keys</entry></row>
<row><entry><literal>&lt;create-alias&gt;</literal></entry><entry>named Mutt function</entry></row>
<row><entry><literal>&circ;G</literal></entry><entry>Control+G key combination</entry></row>
<row><entry>&dollar;mail&lowbar;check</entry><entry>Mutt configuration option</entry></row>
<row><entry><literal>&dollar;HOME</literal></entry><entry>environment variable</entry></row>
</tbody>
</tgroup>
</table>

<para>
Examples are presented as:
</para>

<screen>
mutt -v
</screen>

<para>
Within command synopsis, curly brackets (<quote>&lcub;&rcub;</quote>) denote a set
of options of which one is mandatory, square brackets
(<quote>&lsqb;&rsqb;</quote>) denote optional arguments, three dots
denote that the argument may be repeated arbitrary times.
</para>

</sect1>

<sect1 id="copyright">
<title>Copyright</title>

<para>
Mutt is Copyright &copy; 1996-2009 Michael R. Elkins
<email>me@mutt.org</email> and others.
</para>

<para>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
</para>

<para>
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.
</para>

<para>
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
</para>

</sect1>

</chapter>

<chapter id="gettingstarted">
<title>Getting Started</title>

<para>
This section is intended as a brief overview of how to use Mutt.  There are
many other features which are described elsewhere in the manual.  There
is even more information available in the Mutt FAQ and various web
pages. See the <ulink url="http://www.mutt.org/">Mutt homepage</ulink> for more details.
</para>

<para>
The keybindings described in this section are the defaults as distributed.
Your local system administrator may have altered the defaults for your site.
You can always type <quote>?</quote> in any menu to display the current bindings.
</para>

<para>
The first thing you need to do is invoke Mutt, simply by typing <literal>mutt</literal>
at the command line.  There are various command-line options, see
either the Mutt man page or the <link linkend="commandline">reference</link>.
</para>

<sect1 id="core-concepts">
<title>Core Concepts</title>

<para>
Mutt is a text-based application which interacts with users through
different menus which are mostly line-/entry-based or page-based. A
line-based menu is the so-called <quote>index</quote> menu (listing all messages of
the currently opened folder) or the <quote>alias</quote> menu (allowing you to
select recipients from a list). Examples for page-based menus are the
<quote>pager</quote> (showing one message at a time) or the <quote>help</quote> menu listing
all available key bindings.
</para>

<para>
The user interface consists of a context sensitive help line at the top,
the menu's contents followed by a context sensitive status line and
finally the command line. The command line is used to display
informational and error messages as well as for prompts and for entering
interactive commands.
</para>

<para>
Mutt is configured through variables which, if the user wants to
permanently use a non-default value, are written to configuration
files. Mutt supports a rich config file syntax to make even complex
configuration files readable and commentable.
</para>

<para>
Because Mutt allows for customizing almost all key bindings, there are
so-called <quote>functions</quote> which can be executed manually (using the
command line) or in macros. Macros allow the user to bind a sequence of
commands to a single key or a short key sequence instead of repeating a
sequence of actions over and over.
</para>

<para>
Many commands (such as saving or copying a message to another folder)
can be applied to a single message or a set of messages (so-called
<quote>tagged</quote> messages). To help selecting messages, Mutt provides a rich
set of message patterns (such as recipients, sender, body contents, date
sent/received, etc.) which can be combined into complex expressions
using the boolean <emphasis>and</emphasis> and <emphasis>or</emphasis>
operations as well as negating. These patterns can also be used to (for
example) search for messages or to limit the index to show only matching
messages.
</para>

<para>
Mutt supports a <quote>hook</quote> concept which allows the user to execute
arbitrary configuration commands and functions in certain situations
such as entering a folder, starting a new message or replying to an
existing one. These hooks can be used to highly customize Mutt's
behaviour including managing multiple identities, customizing the
display for a folder or even implementing auto-archiving based on a
per-folder basis and much more.
</para>

<para>
Besides an interactive mode, Mutt can also be used as a command-line
tool only send messages. It also supports a
<literal>mailx(1)</literal>-compatible interface, see <xref
linkend="tab-commandline-options"/> for a complete list of command-line
options.
</para>

</sect1>

<sect1 id="concept-screens-and-menus">
<title>Screens and Menus</title>

<sect2 id="intro-index">
<title>Index</title>

<para>
The index is the screen that you usually see first when you start
Mutt. It gives an overview over your emails in the currently opened
mailbox. By default, this is your system mailbox.  The information you
see in the index is a list of emails, each with its number on the left,
its flags (new email, important email, email that has been forwarded or
replied to, tagged email, ...), the date when email was sent, its
sender, the email size, and the subject. Additionally, the index also
shows thread hierarchies: when you reply to an email, and the other
person replies back, you can see the other's person email in a
"sub-tree" below.  This is especially useful for personal email between
a group of people or when you've subscribed to mailing lists.
</para>

</sect2>

<sect2 id="intro-pager">
<title>Pager</title>

<para>
The pager is responsible for showing the email content. On the top of
the pager you have an overview over the most important email headers
like the sender, the recipient, the subject, and much more
information. How much information you actually see depends on your
configuration, which we'll describe below.
</para>

<para>
Below the headers, you see the email body which usually contains the
message. If the email contains any attachments, you will see more
information about them below the email body, or, if the attachments are
text files, you can view them directly in the pager.
</para>

<para>
To give the user a good overview, it is possible to configure Mutt to
show different things in the pager with different colors. Virtually
everything that can be described with a regular expression can be
colored, e.g. URLs, email addresses or smileys.
</para>

</sect2>

<sect2 id="intro-browser">
<title>File Browser</title>

<para>
The file browser is the interface to the local or remote file
system. When selecting a mailbox to open, the browser allows custom
sorting of items, limiting the items shown by a regular expression and a
freely adjustable format of what to display in which way. It also allows
for easy navigation through the file system when selecting file(s) to
attach to a message, select multiple files to attach and many more.
</para>

</sect2>

<sect2 id="intro-help">
<title>Help</title>

<para>
The help screen is meant to offer a quick help to the user. It lists the
current configuration of key bindings and their associated commands
including a short description, and currently unbound functions that
still need to be associated with a key binding (or alternatively, they
can be called via the Mutt command prompt).
</para>

</sect2>

<sect2 id="intro-compose">
<title>Compose Menu</title>

<para>
The compose menu features a split screen containing the information
which really matter before actually sending a message by mail: who gets
the message as what (recipients and who gets what kind of
copy). Additionally, users may set security options like deciding
whether to sign, encrypt or sign and encrypt a message with/for what
keys. Also, it's used to attach messages, to re-edit any attachment
including the message itself.
</para>

</sect2>

<sect2 id="intro-alias">
<title>Alias Menu</title>

<para>
The alias menu is used to help users finding the recipients of
messages. For users who need to contact many people, there's no need to
remember addresses or names completely because it allows for searching,
too. The alias mechanism and thus the alias menu also features grouping
several addresses by a shorter nickname, the actual alias, so that users
don't have to select each single recipient manually.
</para>

</sect2>

<sect2 id="intro-attach">
<title>Attachment Menu</title>

<para>
As will be later discussed in detail, Mutt features a good and stable
MIME implementation, that is, it supports sending and receiving messages
of arbitrary MIME types. The attachment menu displays a message's
structure in detail: what content parts are attached to which parent
part (which gives a true tree structure), which type is of what type and
what size.  Single parts may saved, deleted or modified to offer great
and easy access to message's internals.
</para>

</sect2>

</sect1>

<sect1 id="menus">
<title>Moving Around in Menus</title>

<para>
The most important navigation keys common to line- or entry-based menus
are shown in <xref linkend="tab-keys-nav-line"/> and in
<xref linkend="tab-keys-nav-page"/> for page-based menus.
</para>

<table id="tab-keys-nav-line">
<title>Most common navigation keys in entry-based menus</title>
<tgroup cols="3">
<thead>
<row><entry>Key</entry><entry>Function</entry><entry>Description</entry></row>
</thead>
<tbody>
<row><entry>j or &lt;Down&gt;</entry><entry><literal>&lt;next-entry&gt;</literal></entry><entry>move to the next entry</entry></row>
<row><entry>k or &lt;Up&gt;</entry><entry><literal>&lt;previous-entry&gt;</literal></entry><entry>move to the previous entry</entry></row>
<row><entry>z or &lt;PageDn&gt;</entry><entry><literal>&lt;page-down&gt;</literal></entry><entry>go to the next page</entry></row>
<row><entry>Z or &lt;PageUp&gt;</entry><entry><literal>&lt;page-up&gt;</literal></entry><entry>go to the previous page</entry></row>
<row><entry>= or &lt;Home&gt;</entry><entry><literal>&lt;first-entry&gt;</literal></entry><entry>jump to the first entry</entry></row>
<row><entry>* or &lt;End&gt;</entry><entry><literal>&lt;last-entry&gt;</literal></entry><entry>jump to the last entry</entry></row>
<row><entry>q</entry><entry><literal>&lt;quit&gt;</literal></entry><entry>exit the current menu</entry></row>
<row><entry>?</entry><entry><literal>&lt;help&gt;</literal></entry><entry>list all keybindings for the current menu</entry></row>
</tbody>
</tgroup>
</table>

<table id="tab-keys-nav-page">
<title>Most common navigation keys in page-based menus</title>
<tgroup cols="3">
<thead>
<row><entry>Key</entry><entry>Function</entry><entry>Description</entry></row>
</thead>
<tbody>
<row><entry>J or &lt;Return&gt;</entry><entry><literal>&lt;next-line&gt;</literal></entry><entry>scroll down one line</entry></row>
<row><entry>&lt;Backspace&gt;</entry><entry><literal>&lt;previous-line&gt;</literal></entry><entry>sroll up one line</entry></row>
<row><entry>K, &lt;Space&gt; or &lt;PageDn&gt;</entry><entry><literal>&lt;next-page&gt;</literal></entry><entry>move to the next page</entry></row>
<row><entry>- or &lt;PageUp&gt;</entry><entry><literal>&lt;previous-page&gt;</literal></entry><entry>move the previous page</entry></row>
<row><entry>&lt;Home&gt;</entry><entry><literal>&lt;top&gt;</literal></entry><entry>move to the top</entry></row>
<row><entry>&lt;End&gt;</entry><entry><literal>&lt;bottom&gt;</literal></entry><entry>move to the bottom</entry></row>
</tbody>
</tgroup>
</table>

</sect1>

<sect1 id="editing">
<title>Editing Input Fields</title>

<sect2 id="editing-intro">
<title>Introduction</title>

<para>
Mutt has a built-in line editor for inputting text, e.g. email
addresses or filenames. The keys used to manipulate text input are
very similar to those of Emacs. See <xref linkend="tab-keys-editor"/> for a full
reference of available functions, their default key bindings, and
short descriptions.
</para>

<table id="tab-keys-editor">
<title>Most common line editor keys</title>
<tgroup cols="3">
<thead>
<row><entry>Key</entry><entry>Function</entry><entry>Description</entry></row>
</thead>
<tbody>
<row><entry>&circ;A or &lt;Home&gt;</entry><entry><literal>&lt;bol&gt;</literal></entry><entry>move to the start of the line</entry></row>
<row><entry>&circ;B or &lt;Left&gt;</entry><entry><literal>&lt;backward-char&gt;</literal></entry><entry>move back one char</entry></row>
<row><entry>Esc B</entry><entry><literal>&lt;backward-word&gt;</literal></entry><entry>move back one word</entry></row>
<row><entry>&circ;D or &lt;Delete&gt;</entry><entry><literal>&lt;delete-char&gt;</literal></entry><entry>delete the char under the cursor</entry></row>
<row><entry>&circ;E or &lt;End&gt;</entry><entry><literal>&lt;eol&gt;</literal></entry><entry>move to the end of the line</entry></row>
<row><entry>&circ;F or &lt;Right&gt;</entry><entry><literal>&lt;forward-char&gt;</literal></entry><entry>move forward one char</entry></row>
<row><entry>Esc F</entry><entry><literal>&lt;forward-word&gt;</literal></entry><entry>move forward one word</entry></row>
<row><entry>&lt;Tab&gt;</entry><entry><literal>&lt;complete&gt;</literal></entry><entry>complete filename or alias</entry></row>
<row><entry>&circ;T</entry><entry><literal>&lt;complete-query&gt;</literal></entry><entry>complete address with query</entry></row>
<row><entry>&circ;K</entry><entry><literal>&lt;kill-eol&gt;</literal></entry><entry>delete to the end of the line</entry></row>
<row><entry>Esc d</entry><entry><literal>&lt;kill-eow&gt;</literal></entry><entry>delete to the end of the word</entry></row>
<row><entry>&circ;W</entry><entry><literal>&lt;kill-word&gt;</literal></entry><entry>kill the word in front of the cursor</entry></row>
<row><entry>&circ;U</entry><entry><literal>&lt;kill-line&gt;</literal></entry><entry>delete entire line</entry></row>
<row><entry>&circ;V</entry><entry><literal>&lt;quote-char&gt;</literal></entry><entry>quote the next typed key</entry></row>
<row><entry>&lt;Up&gt;</entry><entry><literal>&lt;history-up&gt;</literal></entry><entry>recall previous string from history</entry></row>
<row><entry>&lt;Down&gt;</entry><entry><literal>&lt;history-down&gt;</literal></entry><entry>recall next string from history</entry></row>
<row><entry>&lt;BackSpace&gt;</entry><entry><literal>&lt;backspace&gt;</literal></entry><entry>kill the char in front of the cursor</entry></row>
<row><entry>Esc u</entry><entry><literal>&lt;upcase-word&gt;</literal></entry><entry>convert word to upper case</entry></row>
<row><entry>Esc l</entry><entry><literal>&lt;downcase-word&gt;</literal></entry><entry>convert word to lower case</entry></row>
<row><entry>Esc c</entry><entry><literal>&lt;capitalize-word&gt;</literal></entry><entry>capitalize the word</entry></row>
<row><entry>&circ;G</entry><entry>n/a</entry><entry>abort</entry></row>
<row><entry>&lt;Return&gt;</entry><entry>n/a</entry><entry>finish editing</entry></row>
</tbody>
</tgroup>
</table>

<para>
You can remap the <emphasis>editor</emphasis> functions using the
<link linkend="bind"><command>bind</command></link> command.  For example, to make
the &lt;Delete&gt; key delete the character in front of
the cursor rather than under, you could use:
</para>

<screen>
bind editor &lt;delete&gt; backspace
</screen>

</sect2>

<sect2 id="editing-history">
<title>History</title>

<para>
Mutt maintains a history for the built-in editor.  The number of items
is controlled by the <link linkend="history">&dollar;history</link>
variable and can be made persistent using an external file specified
using <link linkend="history-file">&dollar;history&lowbar;file</link>.
You may cycle through them at an editor prompt by using the
<literal>&lt;history-up&gt;</literal> and/or
<literal>&lt;history-down&gt;</literal> commands. But notice that Mutt
does not remember the currently entered text, it only cycles through
history and wraps around at the end or beginning.
</para>

<para>
Mutt maintains several distinct history lists, one for each of the
following categories:
</para>

<itemizedlist>
<listitem><para><literal>.muttrc</literal> commands</para></listitem>
<listitem><para>addresses and aliases</para></listitem>
<listitem><para>shell commands</para></listitem>
<listitem><para>filenames</para></listitem>
<listitem><para>patterns</para></listitem>
<listitem><para>everything else</para></listitem>
</itemizedlist>

<para>
Mutt automatically filters out consecutively repeated items from the history. It
also mimics the behavior of some shells by ignoring items starting
with a space. The latter feature can be useful in macros to not clobber
the history's valuable entries with unwanted entries.
</para>

</sect2>

</sect1>

<sect1 id="reading">
<title>Reading Mail</title>

<para>
Similar to many other mail clients, there are two modes in which mail is
read in Mutt.  The first is a list of messages in the mailbox, which is
called the <quote>index</quote> menu in Mutt.  The second mode is the display of the
message contents.  This is called the <quote>pager.</quote>
</para>

<para>
The next few sections describe the functions provided in each of these
modes.
</para>

<sect2 id="index-menu">
<title>The Message Index</title>

<para>
Common keys used to navigate through and manage messages in the index
are shown in <xref linkend="tab-key-index"/>. How messages are presented
in the index menu can be customized using the
<link linkend="index-format">&dollar;index&lowbar;format</link> variable.
</para>

<table id="tab-key-index">
<title>Most common message index keys</title>
<tgroup cols="2">
<thead>
<row><entry>Key</entry><entry>Description</entry></row>
</thead>
<tbody>
<row><entry>c</entry><entry>change to a different mailbox</entry></row>
<row><entry>Esc c</entry><entry>change to a folder in read-only mode</entry></row>
<row><entry>C</entry><entry>copy the current message to another mailbox</entry></row>
<row><entry>Esc C</entry><entry>decode a message and copy it to a folder</entry></row>
<row><entry>Esc s</entry><entry>decode a message and save it to a folder</entry></row>
<row><entry>D</entry><entry>delete messages matching a pattern</entry></row>
<row><entry>d</entry><entry>delete the current message</entry></row>
<row><entry>F</entry><entry>mark as important</entry></row>
<row><entry>l</entry><entry>show messages matching a pattern</entry></row>
<row><entry>N</entry><entry>mark message as new</entry></row>
<row><entry>o</entry><entry>change the current sort method</entry></row>
<row><entry>O</entry><entry>reverse sort the mailbox</entry></row>
<row><entry>q</entry><entry>save changes and exit</entry></row>
<row><entry>s</entry><entry>save-message</entry></row>
<row><entry>T</entry><entry>tag messages matching a pattern</entry></row>
<row><entry>t</entry><entry>toggle the tag on a message</entry></row>
<row><entry>Esc t</entry><entry>toggle tag on entire message thread</entry></row>
<row><entry>U</entry><entry>undelete messages matching a pattern</entry></row>
<row><entry>u</entry><entry>undelete-message</entry></row>
<row><entry>v</entry><entry>view-attachments</entry></row>
<row><entry>x</entry><entry>abort changes and exit</entry></row>
<row><entry>&lt;Return&gt;</entry><entry>display-message</entry></row>
<row><entry>&lt;Tab&gt;</entry><entry>jump to the next new or unread message</entry></row>
<row><entry>@</entry><entry>show the author's full e-mail address</entry></row>
<row><entry>$</entry><entry>save changes to mailbox</entry></row>
<row><entry>/</entry><entry>search</entry></row>
<row><entry>Esc /</entry><entry>search-reverse</entry></row>
<row><entry>&circ;L</entry><entry>clear and redraw the screen</entry></row>
<row><entry>&circ;T</entry><entry>untag messages matching a pattern</entry></row>
</tbody>
</tgroup>
</table>

<para>
In addition to who sent the message and the subject, a short summary of
the disposition of each message is printed beside the message number.
Zero or more of the <quote>flags</quote> in <xref linkend="tab-msg-status-flags"/>
may appear, some of which can be turned on or off using these functions:
<literal>&lt;set-flag&gt;</literal> and
<literal>&lt;clear-flag&gt;</literal>
bound by default to <quote>w</quote> and <quote>W</quote> respectively.
</para>

<para>
Furthermore, the flags in <xref linkend="tab-msg-recip-flags"/> reflect
who the message is addressed to. They can be customized with the
<link linkend="to-chars">&dollar;to&lowbar;chars</link> variable.
</para>

<table id="tab-msg-status-flags">
<title>Message status flags</title>
<tgroup cols="2">
<thead>
<row><entry>Flag</entry><entry>Description</entry></row>
</thead>
<tbody>
<row><entry>D</entry><entry>message is deleted (is marked for deletion)</entry></row>
<row><entry>d</entry><entry>message has attachments marked for deletion</entry></row>
<row><entry>K</entry><entry>contains a PGP public key</entry></row>
<row><entry>N</entry><entry>message is new</entry></row>
<row><entry>O</entry><entry>message is old</entry></row>
<row><entry>P</entry><entry>message is PGP encrypted</entry></row>
<row><entry>r</entry><entry>message has been replied to</entry></row>
<row><entry>S</entry><entry>message is signed, and the signature is successfully verified</entry></row>
<row><entry>s</entry><entry>message is signed</entry></row>
<row><entry>!</entry><entry>message is flagged</entry></row>
<row><entry>*</entry><entry>message is tagged</entry></row>
</tbody>
</tgroup>
</table>

<table id="tab-msg-recip-flags">
<title>Message recipient flags</title>
<tgroup cols="2">
<thead>
<row><entry>Flag</entry><entry>Description</entry></row>
</thead>
<tbody>
<row><entry>+</entry><entry>message is to you and you only</entry></row>
<row><entry>T</entry><entry>message is to you, but also to or cc'ed to others</entry></row>
<row><entry>C</entry><entry>message is cc'ed to you</entry></row>
<row><entry>F</entry><entry>message is from you</entry></row>
<row><entry>L</entry><entry>message is sent to a subscribed mailing list</entry></row>
</tbody>
</tgroup>
</table>

</sect2>

<sect2 id="pager-menu">
<title>The Pager</title>

<para>
By default, Mutt uses its builtin pager to display the contents of
messages (an external pager such as <literal>less(1)</literal> can be
configured, see <link linkend="pager">&dollar;pager</link> variable).
The pager is very similar to the Unix program <literal>less(1)</literal>
though not nearly as featureful.
</para>

<table id="tab-key-pager">
<title>Most common pager keys</title>
<tgroup cols="2">
<thead>
<row><entry>Key</entry><entry>Description</entry></row>
</thead>
<tbody>
<row><entry>&lt;Return&gt;</entry><entry>go down one line</entry></row>
<row><entry>&lt;Space&gt;</entry><entry>display the next page (or next message if at the end of a message)</entry></row>
<row><entry>-</entry><entry>go back to the previous page</entry></row>
<row><entry>n</entry><entry>search for next match</entry></row>
<row><entry>S</entry><entry>skip beyond quoted text</entry></row>
<row><entry>T</entry><entry>toggle display of quoted text</entry></row>
<row><entry>?</entry><entry>show keybindings</entry></row>
<row><entry>/</entry><entry>regular expression search</entry></row>
<row><entry>Esc /</entry><entry>backward regular expression search</entry></row>
<row><entry>&bsol;</entry><entry>toggle highlighting of search matches</entry></row>
<row><entry>&circ;</entry><entry>jump to the top of the message</entry></row>
</tbody>
</tgroup>
</table>

<para>
In addition to key bindings in <xref linkend="tab-key-pager"/>,
many of the functions from the index menu are also available in
the pager, such as <literal>&lt;delete-message&gt;</literal> or <literal>&lt;copy-message&gt;</literal>
(this is one advantage over using an external pager to view messages).
</para>

<para>
Also, the internal pager supports a couple other advanced features. For
one, it will accept and translate the <quote>standard</quote> nroff sequences for
bold and underline. These sequences are a series of either the letter,
backspace (<quote>&circ;H</quote>), the letter again for bold or the letter, backspace,
<quote>&lowbar;</quote> for denoting underline. Mutt will attempt to display these
in bold and underline respectively if your terminal supports them. If
not, you can use the bold and underline <link linkend="color">color</link>
objects to specify a <command>color</command> or mono attribute for them.
</para>

<para>
Additionally, the internal pager supports the ANSI escape sequences for
character attributes.  Mutt translates them into the correct color and
character settings.  The sequences Mutt supports are:
</para>

<screen>
&bsol;e&lsqb;<emphasis>Ps</emphasis>;<emphasis>Ps</emphasis>;..<emphasis>Ps</emphasis>;m
</screen>

<para>
where <emphasis>Ps</emphasis> can be one of the codes shown in
<xref linkend="tab-ansi-esc"/>.
</para>

<table id="tab-ansi-esc">
<title>ANSI escape sequences</title>
<tgroup cols="2">
<thead>
<row><entry>Escape code</entry><entry>Description</entry></row>
</thead>
<tbody>
<row><entry>0</entry><entry>All attributes off</entry></row>
<row><entry>1</entry><entry>Bold on</entry></row>
<row><entry>4</entry><entry>Underline on</entry></row>
<row><entry>5</entry><entry>Blink on</entry></row>
<row><entry>7</entry><entry>Reverse video on</entry></row>
<row><entry>3<emphasis>&lt;color&gt;</emphasis></entry><entry>Foreground color is <emphasis>&lt;color&gt;</emphasis> (see <xref linkend="tab-color"/>)</entry></row>
<row><entry>4<emphasis>&lt;color&gt;</emphasis></entry><entry>Background color is <emphasis>&lt;color&gt;</emphasis> (see <xref linkend="tab-color"/>)</entry></row>
</tbody>
</tgroup>
</table>

<table id="tab-color">
<title>Color sequences</title>
<tgroup cols="2">
<thead>
<row><entry>Color code</entry><entry>Color</entry></row>
</thead>
<tbody>
<row><entry>0</entry><entry>Black</entry></row>
<row><entry>1</entry><entry>Red</entry></row>
<row><entry>2</entry><entry>Green</entry></row>
<row><entry>3</entry><entry>Yellow</entry></row>
<row><entry>4</entry><entry>Blue</entry></row>
<row><entry>5</entry><entry>Magenta</entry></row>
<row><entry>6</entry><entry>Cyan</entry></row>
<row><entry>7</entry><entry>White</entry></row>
</tbody>
</tgroup>
</table>

<para>
Mutt uses these attributes for handling <literal>text/enriched</literal>
messages, and they can also be used by an external
<link linkend="auto-view">autoview</link> script for highlighting
purposes.
</para>

<note>
<para>
If you change the colors for your
display, for example by changing the color associated with color2 for
your xterm, then that color will be used instead of green.
</para>
</note>

<note>
<para>
Note that the search commands in the pager take regular expressions,
which are not quite the same as the more
complex <link linkend="patterns">patterns</link> used by the search
command in the index. This is because patterns are used to select messages by
criteria whereas the pager already displays a selected message.
</para>
</note>

</sect2>

<sect2 id="threads">
<title>Threaded Mode</title>

<para>
So-called <quote>threads</quote> provide a hierarchy of messages where
replies are linked to their parent message(s). This organizational form
is extremely useful in mailing lists where different parts of the
discussion diverge. Mutt displays threads as a tree structure.
</para>

<para>
In Mutt, when a mailbox is <link linkend="sort">sorted</link>
by <emphasis>threads</emphasis>, there are a few additional functions
available in the <emphasis>index</emphasis>
and <emphasis>pager</emphasis> modes as shown in
<xref linkend="tab-key-threads"/>.
</para>

<table id="tab-key-threads">
<title>Most common thread mode keys</title>
<tgroup cols="3">
<thead>
<row><entry>Key</entry><entry>Function</entry><entry>Description</entry></row>
</thead>
<tbody>
<row><entry>&circ;D</entry><entry><literal>&lt;delete-thread&gt;</literal></entry><entry>delete all messages in the current thread</entry></row>
<row><entry>&circ;U</entry><entry><literal>&lt;undelete-thread&gt;</literal></entry><entry>undelete all messages in the current thread</entry></row>
<row><entry>&circ;N</entry><entry><literal>&lt;next-thread&gt;</literal></entry><entry>jump to the start of the next thread</entry></row>
<row><entry>&circ;P</entry><entry><literal>&lt;previous-thread&gt;</literal></entry><entry>jump to the start of the previous thread</entry></row>
<row><entry>&circ;R</entry><entry><literal>&lt;read-thread&gt;</literal></entry><entry>mark the current thread as read</entry></row>
<row><entry>Esc d</entry><entry><literal>&lt;delete-subthread&gt;</literal></entry><entry>delete all messages in the current subthread</entry></row>
<row><entry>Esc u</entry><entry><literal>&lt;undelete-subthread&gt;</literal></entry><entry>undelete all messages in the current subthread</entry></row>
<row><entry>Esc n</entry><entry><literal>&lt;next-subthread&gt;</literal></entry><entry>jump to the start of the next subthread</entry></row>
<row><entry>Esc p</entry><entry><literal>&lt;previous-subthread&gt;</literal></entry><entry>jump to the start of the previous subthread</entry></row>
<row><entry>Esc r</entry><entry><literal>&lt;read-subthread&gt;</literal></entry><entry>mark the current subthread as read</entry></row>
<row><entry>Esc t</entry><entry><literal>&lt;tag-thread&gt;</literal></entry><entry>toggle the tag on the current thread</entry></row>
<row><entry>Esc v</entry><entry><literal>&lt;collapse-thread&gt;</literal></entry><entry>toggle collapse for the current thread</entry></row>
<row><entry>Esc V</entry><entry><literal>&lt;collapse-all&gt;</literal></entry><entry>toggle collapse for all threads</entry></row>
<row><entry>P</entry><entry><literal>&lt;parent-message&gt;</literal></entry><entry>jump to parent message in thread</entry></row>
</tbody>
</tgroup>
</table>

<para>
Collapsing a thread displays only the first message
in the thread and hides the others. This is useful when threads
contain so many messages that you can only see a handful of threads on
the screen. See &percnt;M in <link linkend="index-format">&dollar;index&lowbar;format</link>.
For example, you could use <quote>&percnt;?M?(&num;&percnt;03M)&amp;(&percnt;4l)?</quote> in <link linkend="index-format">&dollar;index&lowbar;format</link> to optionally
display the number of hidden messages if the thread is
collapsed. The <literal>&percnt;?&lt;char&gt;?&lt;if-part&gt;&amp;&lt;else-part&gt;?</literal>
syntax is explained in detail in
<link linkend="formatstrings-conditionals">format string conditionals</link>.
</para>

<para>
Technically, every reply should contain a list of its parent messages in
the thread tree, but not all do. In these cases, Mutt groups them by
subject which can be controlled using the
<link linkend="strict-threads">&dollar;strict&lowbar;threads</link> variable.
</para>

</sect2>

<sect2 id="reading-misc">
<title>Miscellaneous Functions</title>

<para>
In addition, the <emphasis>index</emphasis> and <emphasis>pager</emphasis>
menus have these interesting functions:
</para>

<variablelist>

<varlistentry>
<term>
<literal>&lt;create-alias&gt;</literal><anchor id="create-alias"/> (default: a)
</term>
<listitem>
<para>
Creates a new alias based upon the current message (or prompts for a
new one).  Once editing is complete, an <link linkend="alias"><command>alias</command></link>
command is added to the file specified by
the <link linkend="alias-file">&dollar;alias&lowbar;file</link> variable
for future use
</para>

<note>
<para>
Mutt does not read the <link linkend="alias-file">&dollar;alias&lowbar;file</link>
upon startup so you must explicitly <link linkend="source"><command>source</command></link> the file.
</para>
</note>
</listitem>
</varlistentry>

<varlistentry>
<term>
<literal>&lt;check-traditional-pgp&gt;</literal><anchor id="check-traditional-pgp"/> (default: Esc P)
</term>
<listitem>
<para>
This function will search the current message for content signed or
encrypted with PGP the <quote>traditional</quote> way, that is, without proper
MIME tagging.  Technically, this function will temporarily change
the MIME content types of the body parts containing PGP data; this
is similar to the <link linkend="edit-type"><literal>&lt;edit-type&gt;</literal></link> function's
effect.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term>
<literal>&lt;edit&gt;</literal><anchor id="edit"/> (default: e)
</term>
<listitem>
<para>
This command (available in the index and pager) allows you to
edit the raw current message as it's present in the mail folder.
After you have finished editing, the changed message will be
appended to the current folder, and the original message will be
marked for deletion; if the message is unchanged it won't be replaced.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term>
<literal>&lt;edit-type&gt;</literal><anchor id="edit-type"/> (default:
&circ;E on the attachment menu, and in the pager and index menus;
&circ;T on the compose menu)
</term>
<listitem>
<para>
This command is used to temporarily edit an attachment's content
type to fix, for instance, bogus character set parameters.  When
invoked from the index or from the pager, you'll have the
opportunity to edit the top-level attachment's content type.  On the
<link linkend="attach-menu">attachment menu</link>, you can change any
attachment's content type. These changes are not persistent, and get
lost upon changing folders.
</para>

<para>
Note that this command is also available on the <link linkend="compose-menu">compose
menu</link>.  There, it's used to fine-tune the properties of attachments you are going
to send.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term>
<literal>&lt;enter-command&gt;</literal><anchor id="enter-command"/> (default: <quote>:</quote>)
</term>
<listitem>
<para>
This command is used to execute any command you would normally put in a
configuration file.  A common use is to check the settings of variables, or
in conjunction with <link linkend="macro">macros</link> to change settings on the
fly.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term>
<literal>&lt;extract-keys&gt;</literal><anchor id="extract-keys"/> (default: &circ;K)
</term>
<listitem>
<para>
This command extracts PGP public keys from the current or tagged
message(s) and adds them to your PGP public key ring.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term>
<literal>&lt;forget-passphrase&gt;</literal><anchor id="forget-passphrase"/> (default:
&circ;F)
</term>
<listitem>
<para>
This command wipes the passphrase(s) from memory. It is useful, if
you misspelled the passphrase.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term>
<literal>&lt;list-reply&gt;</literal><anchor id="list-reply"/> (default: L)
</term>
<listitem>
<para>
Reply to the current or tagged message(s) by extracting any addresses which
match the regular expressions given by the <link linkend="lists"><command>lists</command> or <command>subscribe</command></link>
commands, but also honor any <literal>Mail-Followup-To</literal> header(s) if the
<link linkend="honor-followup-to">&dollar;honor&lowbar;followup&lowbar;to</link>
configuration variable is set.  Using this when replying to messages posted
to mailing lists helps avoid duplicate copies being sent to the author of
the message you are replying to.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term>
<literal>&lt;pipe-message&gt;</literal><anchor id="pipe-message"/> (default: &verbar;)
</term>
<listitem>
<para>
Asks for an external Unix command and pipes the current or
tagged message(s) to it.  The variables <link linkend="pipe-decode">&dollar;pipe&lowbar;decode</link>, <link linkend="pipe-split">&dollar;pipe&lowbar;split</link>,
<link linkend="pipe-sep">&dollar;pipe&lowbar;sep</link> and <link linkend="wait-key">&dollar;wait&lowbar;key</link> control the exact behavior of this function.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term>
<literal>&lt;resend-message&gt;</literal><anchor id="resend-message"/> (default: Esc e)
</term>
<listitem>
<para>
Mutt takes the current message as a template for a
new message.  This function is best described as "recall from arbitrary
folders".  It can conveniently be used to forward MIME messages while
preserving the original mail structure. Note that the amount of headers
included here depends on the value of the <link linkend="weed">&dollar;weed</link>
variable.
</para>

<para>
This function is also available from the attachment menu. You can use this
to easily resend a message which was included with a bounce message
as a <literal>message/rfc822</literal> body part.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term>
<literal>&lt;shell-escape&gt;</literal><anchor id="shell-escape"/> (default: !)
</term>
<listitem>
<para>
Asks for an external Unix command and executes it.  The <link linkend="wait-key">&dollar;wait&lowbar;key</link> can be used to control
whether Mutt will wait for a key to be pressed when the command returns
(presumably to let the user read the output of the command), based on
the return status of the named command. If no command is given, an
interactive shell is executed.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term>
<literal>&lt;toggle-quoted&gt;</literal><anchor id="toggle-quoted"/> (default: T)
</term>
<listitem>
<para>
The pager uses the <link linkend="quote-regexp">&dollar;quote&lowbar;regexp</link> variable to detect quoted text when
displaying the body of the message.  This function toggles the display
of the quoted material in the message.  It is particularly useful when
being interested in just the response and there is a large amount of
quoted text in the way.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term>
<literal>&lt;skip-quoted&gt;</literal><anchor id="skip-quoted"/> (default: S)
</term>
<listitem>
<para>
This function will go to the next line of non-quoted text which comes
after a line of quoted text in the internal pager.
</para>
</listitem>
</varlistentry>

</variablelist>

</sect2>

</sect1>

<sect1 id="sending">
<title>Sending Mail</title>

<sect2 id="sending-intro">
<title>Introduction</title>

<para>
The bindings shown in <xref linkend="tab-key-send"/> are available in the
<emphasis>index</emphasis> and <emphasis>pager</emphasis> to start a new message.
</para>

<table id="tab-key-send">
<title>Most common mail sending keys</title>
<tgroup cols="3">
<thead>
<row><entry>Key</entry><entry>Function</entry><entry>Description</entry></row>
</thead>
<tbody>
<row><entry>m</entry><entry><literal>&lt;compose&gt;</literal></entry><entry>compose a new message</entry></row>
<row><entry>r</entry><entry><literal>&lt;reply&gt;</literal></entry><entry>reply to sender</entry></row>
<row><entry>g</entry><entry><literal>&lt;group-reply&gt;</literal></entry><entry>reply to all recipients</entry></row>
<row><entry>L</entry><entry><literal>&lt;list-reply&gt;</literal></entry><entry>reply to mailing list address</entry></row>
<row><entry>f</entry><entry><literal>&lt;forward&gt;</literal></entry><entry>forward message</entry></row>
<row><entry>b</entry><entry><literal>&lt;bounce&gt;</literal></entry><entry>bounce (remail) message</entry></row>
<row><entry>Esc k</entry><entry><literal>&lt;mail-key&gt;</literal></entry><entry>mail a PGP public key to someone</entry></row>
</tbody>
</tgroup>
</table>

<para>
<emphasis>Bouncing</emphasis> a message sends the message as-is to the recipient you
specify.  <emphasis>Forwarding</emphasis> a message allows you to add comments or
modify the message you are forwarding.  These items are discussed
in greater detail in the next section <quote><link linkend="forwarding-mail">Forwarding
and Bouncing Mail</link>.</quote>
</para>

<para>
Mutt will then enter the <emphasis>compose</emphasis> menu and prompt you for the
recipients to place on the <quote>To:</quote> header field when you hit <literal>m</literal> to start a new message. Next, it will ask
you for the <quote>Subject:</quote> field for the message, providing a default if
you are replying to or forwarding a message. You again
have the chance to adjust recipients, subject, and security settings
right before actually sending the message. See also
<link linkend="askcc">&dollar;askcc</link>,
<link linkend="askbcc">&dollar;askbcc</link>,
<link linkend="autoedit">&dollar;autoedit</link>,
<link linkend="bounce">&dollar;bounce</link>,
<link linkend="fast-reply">&dollar;fast&lowbar;reply</link>,
and <link linkend="include">&dollar;include</link>
for changing how and if Mutt asks these questions.
</para>

<para>
When replying, Mutt fills these fields with proper values depending on
the reply type.  The types of replying supported are:
</para>

<variablelist>
<varlistentry>
<term>Simple reply</term>
<listitem>
<para>
Reply to the author directly.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>Group reply</term>
<listitem>
<para>
Reply to the author as well to all recipients except you; this consults
<link linkend="alternates"><command>alternates</command></link>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>List reply</term>
<listitem>
<para>
Reply to all mailing list addresses found, either specified via
configuration or auto-detected.  See <xref linkend="lists"/> for
details.
</para>
</listitem>
</varlistentry>
</variablelist>

<para>
After getting recipients for new messages, forwards or replies, Mutt
will then automatically start your <link
linkend="editor">&dollar;editor</link> on the message body. If the <link
linkend="edit-headers">&dollar;edit&lowbar;headers</link> variable is
set, the headers will be at the top of the message in your editor.  Any
messages you are replying to will be added in sort order to the message,
with appropriate <link linkend="attribution">&dollar;attribution</link>,
<link linkend="indent-string">&dollar;indent&lowbar;string</link> and
<link
linkend="post-indent-string">&dollar;post&lowbar;indent&lowbar;string</link>.
When forwarding a message, if the <link
linkend="mime-forward">&dollar;mime&lowbar;forward</link> variable is
unset, a copy of the forwarded message will be included.  If you have
specified a <link linkend="signature">&dollar;signature</link>, it will
be appended to the message.
</para>

<para>
Once you have finished editing the body of your mail message, you are
returned to the <emphasis>compose</emphasis> menu providing the functions
shown in <xref linkend="tab-func-compose"/> to modify, send or postpone the
message.
</para>

<table id="tab-func-compose">
<title>Most common compose menu keys</title>
<tgroup cols="3">
<thead>
<row><entry>Key</entry><entry>Function</entry><entry>Description</entry></row>
</thead>
<tbody>
<row><entry>a</entry><entry><literal>&lt;attach-file&gt;</literal></entry><entry>attach a file</entry></row>
<row><entry>A</entry><entry><literal>&lt;attach-message&gt;</literal></entry><entry>attach message(s) to the message</entry></row>
<row><entry>Esc k</entry><entry><literal>&lt;attach-key&gt;</literal></entry><entry>attach a PGP public key</entry></row>
<row><entry>d</entry><entry><literal>&lt;edit-description&gt;</literal></entry><entry>edit description on attachment</entry></row>
<row><entry>D</entry><entry><literal>&lt;detach-file&gt;</literal></entry><entry>detach a file</entry></row>
<row><entry>t</entry><entry><literal>&lt;edit-to&gt;</literal></entry><entry>edit the To field</entry></row>
<row><entry>Esc f</entry><entry><literal>&lt;edit-from&gt;</literal></entry><entry>edit the From field</entry></row>
<row><entry>r</entry><entry><literal>&lt;edit-reply-to&gt;</literal></entry><entry>edit the Reply-To field</entry></row>
<row><entry>c</entry><entry><literal>&lt;edit-cc&gt;</literal></entry><entry>edit the Cc field</entry></row>
<row><entry>b</entry><entry><literal>&lt;edit-bcc&gt;</literal></entry><entry>edit the Bcc field</entry></row>
<row><entry>y</entry><entry><literal>&lt;send-message&gt;</literal></entry><entry>send the message</entry></row>
<row><entry>s</entry><entry><literal>&lt;edit-subject&gt;</literal></entry><entry>edit the Subject</entry></row>
<row><entry>S</entry><entry><literal>&lt;smime-menu&gt;</literal></entry><entry>select S/MIME options</entry></row>
<row><entry>f</entry><entry><literal>&lt;edit-fcc&gt;</literal></entry><entry>specify an <quote>Fcc</quote> mailbox</entry></row>
<row><entry>p</entry><entry><literal>&lt;pgp-menu&gt;</literal></entry><entry>select PGP options</entry></row>
<row><entry>P</entry><entry><literal>&lt;postpone-message&gt;</literal></entry><entry>postpone this message until later</entry></row>
<row><entry>q</entry><entry><literal>&lt;quit&gt;</literal></entry><entry>quit (abort) sending the message</entry></row>
<row><entry>w</entry><entry><literal>&lt;write-fcc&gt;</literal></entry><entry>write the message to a folder</entry></row>
<row><entry>i</entry><entry><literal>&lt;ispell&gt;</literal></entry><entry>check spelling (if available on your system)</entry></row>
<row><entry>&circ;F</entry><entry><literal>&lt;forget-passphrase&gt;</literal></entry><entry>wipe passphrase(s) from memory</entry></row>
</tbody>
</tgroup>
</table>

<para>
The compose menu is also used to edit the attachments for a message which can be either files
or other messages. The <literal>&lt;attach-message&gt;</literal> function to will prompt you for a folder to
attach messages from. You can now tag messages in that folder and they
will be attached to the message you are sending.
</para>

<note>
<para>
Note that certain
operations like composing a new mail, replying, forwarding, etc. are
not permitted when you are in that folder. The &percnt;r in
<link linkend="status-format">&dollar;status&lowbar;format</link> will change to
a <quote>A</quote> to indicate that you are in attach-message mode.
</para>
</note>

</sect2>

<sect2 id="edit-header">
<title>Editing the Message Header</title>

<para>
When editing the header because of <link linkend="edit-headers">&dollar;edit&lowbar;headers</link>
being set, there are a several pseudo headers available which
will not be included in sent messages but trigger special Mutt behavior.
</para>

<sect3 id="fcc-header">
<title>Fcc: Pseudo Header</title>

<para>
If you specify
</para>

<para>
<literal>Fcc:</literal> <emphasis>filename</emphasis>
</para>

<para>
as a header, Mutt will pick up <emphasis>filename</emphasis>
just as if you had used the <literal>&lt;edit-fcc&gt;</literal> function in the <emphasis>compose</emphasis> menu.
It can later be changed from the compose menu.
</para>

</sect3>

<sect3 id="attach-header">
<title>Attach: Pseudo Header</title>

<para>
You can also attach files to your message by specifying
</para>

<para>
<literal>Attach:</literal> <emphasis>filename</emphasis>
&lsqb; <emphasis>description</emphasis> &rsqb;
</para>

<para>
where <emphasis>filename</emphasis> is the file to attach and <emphasis>description</emphasis> is an
optional string to use as the description of the attached file. Spaces
in filenames have to be escaped using backslash (<quote>&bsol;</quote>).
The file can be removed as well as more added from the compose menu.
</para>

</sect3>

<sect3 id="pgp-header">
<title>Pgp: Pseudo Header</title>

<para>
If you want to use PGP, you can specify
</para>

<para>
<literal>Pgp:</literal> &lsqb; <literal>E</literal> &verbar; <literal>S</literal> &verbar; <literal>S</literal><emphasis>&lt;id&gt;</emphasis> &rsqb;

</para>

<para>
<quote>E</quote> selects encryption, <quote>S</quote> selects signing and
<quote>S&lt;id&gt;</quote> selects signing with the given key, setting
<link linkend="pgp-sign-as">&dollar;pgp&lowbar;sign&lowbar;as</link>
permanently. The selection can later be changed in the compose menu.
</para>

</sect3>

<sect3 id="in-reply-to-header">
<title>In-Reply-To: Header</title>

<para>
When replying to messages, the <emphasis>In-Reply-To:</emphasis> header contains the
Message-Id of the message(s) you reply to. If you remove or modify its value, Mutt will not generate a
<emphasis>References:</emphasis> field, which allows you to create a new message thread, for example
to create a new message to a mailing list without having to enter the mailing list's address.
</para>

</sect3>

</sect2>

<sect2 id="sending-crypto">
<title>Sending Cryptographically Signed/Encrypted Messages</title>

<para>
If you have told Mutt to PGP or S/MIME encrypt a message, it will guide you
through a key selection process when you try to send the message.
Mutt will not ask you any questions about keys which have a
certified user ID matching one of the message recipients' mail
addresses.  However, there may be situations in which there are
several keys, weakly certified user ID fields, or where no matching
keys can be found.
</para>

<para>
In these cases, you are dropped into a menu with a list of keys from
which you can select one.  When you quit this menu, or Mutt can't
find any matching keys, you are prompted for a user ID.  You can, as
usually, abort this prompt using <literal>&circ;G</literal>.  When you do so, Mutt will
return to the compose screen.
</para>

<para>
Once you have successfully finished the key selection, the message
will be encrypted using the selected public keys when sent out.
</para>

<para>
Most fields of the entries in the key selection menu (see also <link linkend="pgp-entry-format">&dollar;pgp&lowbar;entry&lowbar;format</link>)
have obvious meanings.  But some explanations on the capabilities, flags,
and validity fields are in order.
</para>

<para>
The flags sequence (<quote>&percnt;f</quote>) will expand to one of the flags in
<xref linkend="tab-pgp-menuflags"/>.
</para>

<table id="tab-pgp-menuflags">
<title>PGP key menu flags</title>
<tgroup cols="2">
<thead>
<row><entry>Flag</entry><entry>Description</entry></row>
</thead>
<tbody>
<row><entry>R</entry><entry>The key has been revoked and can't be used.</entry></row>
<row><entry>X</entry><entry>The key is expired and can't be used.</entry></row>
<row><entry>d</entry><entry>You have marked the key as disabled.</entry></row>
<row><entry>c</entry><entry>There are unknown critical self-signature packets.</entry></row>
</tbody>
</tgroup>
</table>

<para>
The capabilities field (<quote>&percnt;c</quote>) expands to a two-character sequence
representing a key's capabilities.  The first character gives
the key's encryption capabilities: A minus sign (<quote>-</quote>) means
that the key cannot be used for encryption.  A dot (<quote>.</quote>) means that
it's marked as a signature key in one of the user IDs, but may
also be used for encryption.  The letter <quote>e</quote> indicates that
this key can be used for encryption.
</para>

<para>
The second character indicates the key's signing capabilities.  Once
again, a <quote>-</quote> implies <quote>not for signing</quote>, <quote>.</quote> implies
that the key is marked as an encryption key in one of the user-ids, and
<quote>s</quote> denotes a key which can be used for signing.
</para>

<para>
Finally, the validity field (<quote>&percnt;t</quote>) indicates how well-certified a user-id
is.  A question mark (<quote>?</quote>) indicates undefined validity, a minus
character (<quote>-</quote>) marks an untrusted association, a space character
means a partially trusted association, and a plus character (<quote>+</quote>)
indicates complete validity.
</para>

</sect2>

<sect2 id="ff">
<title>Sending Format=Flowed Messages</title>

<sect3 id="ff-concept">
<title>Concept</title>

<para>
<literal>format=flowed</literal>-style messages (or <literal>f=f</literal>
for short) are <literal>text/plain</literal> messages that consist of paragraphs which a receiver's
mail client may reformat to its own needs which mostly means to
customize line lengths regardless of what the sender sent. Technically this is
achieved by letting lines of a <quote>flowable</quote> paragraph end in spaces
except for the last line.
</para>

<para>
While for text-mode clients like Mutt it's the best way to assume only a
standard 80x25 character cell terminal, it may be desired to let the
receiver decide completely how to view a message.
</para>

</sect3>

<sect3 id="ff-support">
<title>Mutt Support</title>

<para>
Mutt only supports setting the required <literal>format=flowed</literal>
MIME parameter on outgoing messages if the <link
linkend="text-flowed">&dollar;text&lowbar;flowed</link>
variable is set, specifically it does not add the
trailing spaces.
</para>

<para>
After editing the initial message text and before entering
the compose menu, Mutt properly space-stuffes the message.
<emphasis>Space-stuffing</emphasis> is required by RfC3676 defining
<literal>format=flowed</literal> and means to prepend a space to:
</para>

<itemizedlist>
<listitem><para>all lines starting with a space</para></listitem>
<listitem><para>lines starting with the word <quote><literal>From</literal></quote>
followed by space</para></listitem>
<listitem><para>all lines starting with <quote><literal>&gt;</literal></quote> which
is not intended to be a quote character</para></listitem>
</itemizedlist>

<note>
<para>
Mutt only supports space-stuffing
for the first two types of lines but not for the third: It is impossible to
safely detect whether a leading <literal>&gt;</literal> character starts a
quote or not. Furthermore, Mutt only applies space-stuffing
<emphasis>once</emphasis> after the initial edit is finished.
</para>
</note>

<para>
All leading spaces are to be removed by receiving clients to restore
the original message prior to further processing.
</para>

</sect3>

<sect3 id="ff-editor">
<title>Editor Considerations</title>

<para>
As Mutt provides no additional features to compose <literal>f=f</literal>
messages, it's completely up to the user and his editor to produce
proper messages. Please consider your editor's documentation if you
intend to send <literal>f=f</literal> messages.
</para>

<para>
Please note that when editing messages from the compose menu several
times before really sending a mail, it's up to the user to ensure that
the message is properly space-stuffed.
</para>

<para>
For example, <emphasis>vim</emphasis> provides the <literal>w</literal>
flag for its <literal>formatoptions</literal> setting to assist in
creating <literal>f=f</literal> messages, see <literal>:help
fo-table</literal> for details.
</para>

</sect3>

</sect2>

</sect1>

<sect1 id="forwarding-mail">
<title>Forwarding and Bouncing Mail</title>

<para>
Bouncing and forwarding let you send an existing message to recipients
that you specify. Bouncing a message sends a verbatim copy of a message
to alternative addresses as if they were the message's original
recipients specified in the Bcc header.
Forwarding a message, on the other hand, allows you to modify the message
before it is resent (for example, by adding your own comments). Bouncing
is done using the <literal>&lt;bounce&gt;</literal> function and forwarding
using the <literal>&lt;forward&gt;</literal> function bound to <quote>b</quote> and <quote>f</quote>
respectively.
</para>

<para>
Forwarding can be done by including the original message in the new
message's body (surrounded by indicating lines) or including it as a MIME
attachment, depending on the value of the <link linkend="mime-forward">&dollar;mime&lowbar;forward</link> variable.  Decoding of attachments,
like in the pager, can be controlled by the <link linkend="forward-decode">&dollar;forward&lowbar;decode</link> and <link linkend="mime-forward-decode">&dollar;mime&lowbar;forward&lowbar;decode</link> variables,
respectively.  The desired forwarding format may depend on the content,
therefore <link linkend="mime-forward">&dollar;mime&lowbar;forward</link> is a quadoption which, for
example, can be set to <quote>ask-no</quote>.
</para>

<para>
The inclusion of headers is controlled by the current setting of the
<link linkend="weed">&dollar;weed</link> variable, unless <link linkend="mime-forward">&dollar;mime&lowbar;forward</link> is set.
</para>

<para>
Editing the message to forward follows the same procedure as sending or
replying to a message does.
</para>

</sect1>

<sect1 id="postponing-mail">
<title>Postponing Mail</title>

<para>
At times it is desirable to delay sending a message that you have
already begun to compose.  When the <literal>&lt;postpone-message&gt;</literal> function is
used in the <emphasis>compose</emphasis> menu, the body of your message and attachments
are stored in the mailbox specified by the <link linkend="postponed">&dollar;postponed</link> variable.  This means that you can recall the
message even if you exit Mutt and then restart it at a later time.
</para>

<para>
Once a message is postponed, there are several ways to resume it.  From the
command line you can use the <quote>-p</quote> option, or if you compose a new
message from the <emphasis>index</emphasis> or <emphasis>pager</emphasis> you will be prompted if postponed
messages exist.  If multiple messages are currently postponed, the
<emphasis>postponed</emphasis> menu will pop up and you can select which message you would
like to resume.
</para>

<note>
<para>
If you postpone a reply to a message, the reply setting of
the message is only updated when you actually finish the message and
send it.  Also, you must be in the same folder with the message you
replied to for the status of the message to be updated.
</para>
</note>

<para>
See also the <link linkend="postpone">&dollar;postpone</link> quad-option.
</para>

</sect1>

</chapter>

<chapter id="configuration">
<title>Configuration</title>

<sect1 id="configuration-files">
<title>Location of Initialization Files</title>

<para>
While the default configuration (or <quote>preferences</quote>) make Mutt
usable right out of the box, it is often desirable to tailor Mutt to
suit your own tastes. When Mutt is first invoked, it will attempt to
read the <quote>system</quote> configuration file (defaults set by your local
system administrator), unless the <quote>-n</quote> <link linkend="commandline">command line</link> option is specified.  This file is typically
<literal>/usr/local/share/mutt/Muttrc</literal> or <literal>/etc/Muttrc</literal>. Mutt
will next look for a file named <literal>.muttrc</literal> in your home
directory.  If this file does not exist and your home directory has
a subdirectory named <literal>.mutt</literal>, Mutt tries to load a file named
<literal>.mutt/muttrc</literal>.
</para>

<para>
<literal>.muttrc</literal> is the file where you will usually place your <link linkend="commands">commands</link> to configure Mutt.
</para>

<para>
In addition, Mutt supports version specific configuration files that are
parsed instead of the default files as explained above.  For instance, if
your system has a <literal>Muttrc-0.88</literal> file in the system configuration
directory, and you are running version 0.88 of Mutt, this file will be
sourced instead of the <literal>Muttrc</literal> file.  The same is true of the user
configuration file, if you have a file <literal>.muttrc-0.88.6</literal> in your home
directory, when you run Mutt version 0.88.6, it will source this file
instead of the default <literal>.muttrc</literal> file.  The version number is the
same which is visible using the <quote>-v</quote> <link linkend="commandline">command line</link> switch or using the <literal>show-version</literal> key (default:
V) from the index menu.
</para>

</sect1>

<sect1 id="muttrc-syntax" xreflabel="Syntax of Initialization Files">
<title>Syntax of Initialization Files</title>

<para>
An initialization file consists of a series of <link linkend="commands">commands</link>.  Each line of the file may contain one or more commands.
When multiple commands are used, they must be separated by a semicolon
(<quote>;</quote>).
</para>

<example id="ex-rc-multiple-cmds">
<title>Multiple configuration commands per line</title>
<screen>
set realname='Mutt user' ; ignore x-
</screen>
</example>

<para>
The hash mark, or pound sign
(<quote>&num;</quote>), is used as a <quote>comment</quote> character. You can use it to
annotate your initialization file. All text after the comment character
to the end of the line is ignored.
</para>

<example id="ex-ec-comment">
<title>Commenting configuration files</title>
<screen>
my_hdr X-Disclaimer: Why are you listening to me? &num; This is a comment
</screen>
</example>

<para>
Single quotes (<quote>'</quote>) and double quotes (<quote>&quot;</quote>) can be used to quote strings
which contain spaces or other special characters.  The difference between
the two types of quotes is similar to that of many popular shell programs,
namely that a single quote is used to specify a literal string (one that is
not interpreted for shell variables or quoting with a backslash &lsqb;see
next paragraph&rsqb;), while double quotes indicate a string for which
should be evaluated.  For example, backticks are evaluated inside of double
quotes, but <emphasis>not</emphasis> for single quotes.
</para>

<para>
<quote>&bsol;</quote> quotes the next character, just as in shells such as bash and zsh.
For example, if want to put quotes <quote>&quot;</quote> inside of a string, you can use
<quote>&bsol;</quote> to force the next character to be a literal instead of interpreted
character.
</para>

<example id="ex-rc-quote">
<title>Escaping quotes in congfiguration files</title>
<screen>
set realname="Michael \"MuttDude\" Elkins"
</screen>
</example>

<para>
<quote>&bsol;&bsol;</quote> means to insert a literal <quote>&bsol;</quote> into the line.
<quote>&bsol;n</quote> and <quote>&bsol;r</quote> have their usual C meanings of linefeed and
carriage-return, respectively.
</para>

<para>
A <quote>&bsol;</quote> at the end of a line can be used to split commands over
multiple lines as it <quote>escapes</quote> the line end, provided that the split points don't appear in the
middle of command names. Lines are first concatenated before
interpretation so that a multi-line can be commented by commenting out
the first line only.
</para>

<example id="ex-rc-split">
<title>Splitting long configuration commands over several lines</title>
<screen>
set status_format="some very \
long value split \
over several lines"
</screen>
</example>

<para>
It is also possible to substitute the output of a Unix command in an
initialization file.  This is accomplished by enclosing the command in
backticks (``). In <xref linkend="ex-rc-backtick"/>, the output of the
Unix command <quote>uname -a</quote> will be substituted before the
line is parsed.
Since initialization files are line oriented, only
the first line of output from the Unix command will be substituted.
</para>

<example id="ex-rc-backtick">
<title>Using external command's output in configuration files</title>
<screen>
my_hdr X-Operating-System: `uname -a`
</screen>
</example>

<para>
Both environment variables and Mutt variables can be accessed by
prepending <quote>&dollar;</quote> to the name of the variable. For example,
</para>

<example id="ex-rc-env">
<title>Using environment variables in configuration files</title>
<screen>
set record=+sent_on_$HOSTNAME
</screen>
</example>

<para>
will cause Mutt to save outgoing messages to a folder named
<quote>sent_on_kremvax</quote> if the environment variable <literal>&dollar;HOSTNAME</literal> is set to
<quote>kremvax.</quote> (See <link linkend="record">&dollar;record</link> for
details.)
</para>

<para>
Mutt expands the variable when it is assigned, not when it is used. If
the value of a variable on the right-hand side of an assignment
changes after the assignment, the variable on the left-hand side will
not be affected.
</para>

<para>
The commands understood by Mutt are explained in the next paragraphs.
For a complete list, see the <link linkend="commands">command reference</link>.
</para>

<para>
All configuration files are expected to be in the current locale as
specified by the <link linkend="charset">&dollar;charset</link> variable
which doesn't have a default value since it's determined by Mutt at startup.
If a configuration file is not encoded in the same character set the
<link linkend="config-charset">&dollar;config&lowbar;charset</link>
variable should be used: all lines starting with the next are recoded
from <link linkend="config-charset">&dollar;config&lowbar;charset</link>
to <link linkend="charset">&dollar;charset</link>.
</para>

<para>
This mechanism should be avoided if possible as it has the
following implications:
</para>

<itemizedlist>

<listitem><para>These variables should be set early in a configuration
file with <link linkend="charset">&dollar;charset</link> preceding
<link linkend="config-charset">&dollar;config&lowbar;charset</link> so Mutt
knows what character set to convert to.</para></listitem>

<listitem><para>If <link linkend="config-charset">&dollar;config&lowbar;charset</link> is set, it should be set
in each configuration file because the value is global and <emphasis>not</emphasis>
per configuration file.</para></listitem>

<listitem><para>Because Mutt first recodes a line before it attempts to parse it,
a conversion introducing question marks or other characters as
part of errors (unconvertable characters, transliteration) may introduce syntax
errors or silently change the meaning of certain tokens (e.g. inserting
question marks into regular expressions).</para></listitem>

</itemizedlist>

</sect1>

<sect1 id="addrgroup">
<title>Address Groups</title>

<para>Usage:</para>

<cmdsynopsis>
<command>group</command>
<arg choice="opt" rep="repeat">
<option>-group</option>
<replaceable class="parameter">name</replaceable>
</arg>
<group choice="req">
<arg choice="plain" rep="repeat">
<option>-rx</option>
<replaceable class="parameter">expr</replaceable>
</arg>
<arg choice="plain" rep="repeat">
<option>-addr</option>
<replaceable class="parameter">expr</replaceable>
</arg>
</group>

<command>ungroup</command>
<arg choice="opt" rep="repeat">
<option>-group</option>
<replaceable class="parameter">name</replaceable>
</arg>
<group choice="req">
<arg choice="plain">
<replaceable class="parameter">*</replaceable>
</arg>
<arg choice="plain" rep="repeat">
<option>-rx</option>
<replaceable class="parameter">expr</replaceable>
</arg>
<arg choice="plain" rep="repeat">
<option>-addr</option>
<replaceable class="parameter">expr</replaceable>
</arg>
</group>
</cmdsynopsis>

<para>
<command>group</command> is used to directly add either addresses or
regular expressions to the specified group or groups. The different
categories of arguments to the <command>group</command> command can be
in any order. The flags <literal>-rx</literal> and
<literal>-addr</literal> specify what the following strings (that cannot
begin with a hyphen) should be interpreted as: either a regular
expression or an email address, respectively.
</para>

<para>
These address groups can also be created implicitly by the
<link linkend="alias"><command>alias</command></link>, <link linkend="lists">lists</link>,
<link linkend="lists">subscribe</link> and
<link linkend="alternates"><command>alternates</command></link> commands by specifying the
optional <literal>-group</literal> option.
</para>

<para>
Once defined, these address groups can be used in
<link linkend="patterns">patterns</link> to search for and limit the
display to messages matching a group.
</para>

<para>
<command>ungroup</command> is used to remove addresses or regular
expressions from the specified group or groups. The syntax is similar to
the <command>group</command> command, however the special character
<literal>*</literal> can be used to empty a group of all of its
contents.
</para>

</sect1>

<sect1 id="alias">
<title>Defining/Using Aliases</title>

<para>Usage:</para>

<cmdsynopsis>
<command>alias</command>
<arg choice="opt" rep="repeat">
<option>-group</option>
<replaceable class="parameter">name</replaceable>
</arg>
<arg choice="plain">
<replaceable class="parameter">key</replaceable>
</arg>
<arg choice="plain">
<replaceable class="parameter">address</replaceable>
</arg>
<arg choice="opt" rep="repeat">
<replaceable class="parameter">address</replaceable>
</arg>

<command>unalias</command>
<arg choice="opt" rep="repeat">
<option>-group</option>
<replaceable>name</replaceable>
</arg>
<group choice="req">
<arg choice="plain">
<replaceable class="parameter">*</replaceable>
</arg>
<arg choice="plain" rep="repeat">
<replaceable class="parameter">key</replaceable>
</arg>
</group>
</cmdsynopsis>

<para>
It's usually very cumbersome to remember or type out the address of someone
you are communicating with.  Mutt allows you to create <quote>aliases</quote> which map
a short string to a full address.
</para>

<note>
<para>
If you want to create an alias for more than
one address, you <emphasis>must</emphasis> separate the addresses with a comma (<quote>,</quote>).
</para>
</note>

<para>
The optional <literal>-group</literal> argument to
<command>alias</command> causes the aliased address(es) to be added to
the named <emphasis>group</emphasis>.
</para>

<para>
To remove an alias or aliases (<quote>*</quote> means all aliases):
</para>

<screen>
alias muttdude me@cs.hmc.edu (Michael Elkins)
alias theguys manny, moe, jack
</screen>

<para>
Unlike other mailers, Mutt doesn't require aliases to be defined
in a special file.  The <command>alias</command> command can appear anywhere in
a configuration file, as long as this file is <link linkend="source"><command>source</command>d</link>.  Consequently, you can have multiple alias files, or
you can have all aliases defined in your <literal>.muttrc</literal>.
</para>

<para>
On the other hand, the <link linkend="create-alias"><literal>&lt;create-alias&gt;</literal></link>
function can use only one file, the one pointed to by the <link linkend="alias-file">&dollar;alias&lowbar;file</link> variable (which is
<literal>&tilde;/.muttrc</literal> by default). This file is not special either,
in the sense that Mutt will happily append aliases to any file, but in
order for the new aliases to take effect you need to explicitly <link linkend="source"><command>source</command></link> this file too.
</para>

<example id="ex-alias-external">
<title>Configuring external alias files</title>
<screen>
source /usr/local/share/Mutt.aliases
source ~/.mail_aliases
set alias_file=~/.mail_aliases
</screen>
</example>

<para>
To use aliases, you merely use the alias at any place in Mutt where Mutt
prompts for addresses, such as the <emphasis>To:</emphasis> or <emphasis>Cc:</emphasis> prompt.  You can
also enter aliases in your editor at the appropriate headers if you have the
<link linkend="edit-headers">&dollar;edit&lowbar;headers</link> variable set.
</para>

<para>
In addition, at the various address prompts, you can use the tab character
to expand a partial alias to the full alias.  If there are multiple matches,
Mutt will bring up a menu with the matching aliases.  In order to be
presented with the full list of aliases, you must hit tab without a partial
alias, such as at the beginning of the prompt or after a comma denoting
multiple addresses.
</para>

<para>
In the alias menu, you can select as many aliases as you want with the
<literal>select-entry</literal> key (default: &lt;Return&gt;), and use the
<emphasis>exit</emphasis> key (default: q) to return to the address prompt.
</para>

</sect1>

<sect1 id="bind">
<title>Changing the Default Key Bindings</title>

<para>Usage:</para>

<cmdsynopsis>
<command>bind</command>
<arg choice="plain">
<replaceable class="parameter">map</replaceable>
</arg>
<arg choice="plain">
<replaceable class="parameter">key</replaceable>
</arg>
<arg choice="plain">
<replaceable class="parameter">function</replaceable>
</arg>
</cmdsynopsis>

<para>
This command allows you to change the default key bindings (operation
invoked when pressing a key).
</para>

<para>
<emphasis>map</emphasis> specifies in which menu the binding belongs.  Multiple maps may
be specified by separating them with commas (no additional whitespace is
allowed). The currently defined maps are:
</para>

<anchor id="maps"/>
<variablelist>

<varlistentry>
<term>generic</term>
<listitem>
<para>
This is not a real menu, but is used as a fallback for all of the other
menus except for the pager and editor modes.  If a key is not defined in
another menu, Mutt will look for a binding to use in this menu.  This allows
you to bind a key to a certain function in multiple menus instead of having
multiple <command>bind</command> statements to accomplish the same task.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>alias</term>
<listitem>
<para>
The alias menu is the list of your personal aliases as defined in your
<literal>.muttrc</literal>.  It is the mapping from a short alias name to the full email
address(es) of the recipient(s).
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>attach</term>
<listitem>
<para>
The attachment menu is used to access the attachments on received messages.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>browser</term>
<listitem>
<para>
The browser is used for both browsing the local directory structure, and for
listing all of your incoming mailboxes.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>editor</term>
<listitem>
<para>
The editor is the line-based editor the user enters text data.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>index</term>
<listitem>
<para>
The index is the list of messages contained in a mailbox.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>compose</term>
<listitem>
<para>
The compose menu is the screen used when sending a new message.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>pager</term>
<listitem>
<para>
The pager is the mode used to display message/attachment data, and help
listings.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>pgp</term>
<listitem>
<para>
The pgp menu is used to select the OpenPGP keys used to encrypt outgoing
messages.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>smime</term>
<listitem>
<para>
The smime menu is used to select the OpenSSL certificates used to encrypt outgoing
messages.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>postpone</term>
<listitem>
<para>
The postpone menu is similar to the index menu, except is used when
recalling a message the user was composing, but saved until later.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>query</term>
<listitem>
<para>
The query menu is the browser for results returned by
<link linkend="query-command">&dollar;query&lowbar;command</link>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>mix</term>
<listitem>
<para>
The mixmaster screen is used to select remailer options for outgoing
messages (if Mutt is compiled with Mixmaster support).
</para>
</listitem>
</varlistentry>
</variablelist>

<para>
<emphasis>key</emphasis> is the key (or key sequence) you wish to bind.  To specify a
control character, use the sequence <emphasis>&bsol;Cx</emphasis>, where <emphasis>x</emphasis> is the
letter of the control character (for example, to specify control-A use
<quote>&bsol;Ca</quote>).  Note that the case of <emphasis>x</emphasis> as well as <emphasis>&bsol;C</emphasis> is
ignored, so that <emphasis>&bsol;CA</emphasis>, <emphasis>&bsol;Ca</emphasis>, <emphasis>&bsol;cA</emphasis> and <emphasis>&bsol;ca</emphasis> are all
equivalent.  An alternative form is to specify the key as a three digit
octal number prefixed with a <quote>&bsol;</quote> (for example <emphasis>&bsol;177</emphasis> is
equivalent to <emphasis>&bsol;c?</emphasis>). In addition, <emphasis>key</emphasis> may
be a symbolic name as shown in <xref linkend="tab-key-names"/>.
</para>

<table id="tab-key-names">
<title>Symbolic key names</title>
<tgroup cols="2">
<thead>
<row><entry>Symbolic name</entry><entry>Meaning</entry></row>
</thead>
<tbody>
<row><entry>&bsol;t</entry><entry>tab</entry></row>
<row><entry>&lt;tab&gt;</entry><entry>tab</entry></row>
<row><entry>&lt;backtab&gt;</entry><entry>backtab / shift-tab</entry></row>
<row><entry>&bsol;r</entry><entry>carriage return</entry></row>
<row><entry>&bsol;n</entry><entry>newline</entry></row>
<row><entry>&bsol;e</entry><entry>escape</entry></row>
<row><entry>&lt;esc&gt;</entry><entry>escape</entry></row>
<row><entry>&lt;up&gt;</entry><entry>up arrow</entry></row>
<row><entry>&lt;down&gt;</entry><entry>down arrow</entry></row>
<row><entry>&lt;left&gt;</entry><entry>left arrow</entry></row>
<row><entry>&lt;right&gt;</entry><entry>right arrow</entry></row>
<row><entry>&lt;pageup&gt;</entry><entry>Page Up</entry></row>
<row><entry>&lt;pagedown&gt;</entry><entry>Page Down</entry></row>
<row><entry>&lt;backspace&gt;</entry><entry>Backspace</entry></row>
<row><entry>&lt;delete&gt;</entry><entry>Delete</entry></row>
<row><entry>&lt;insert&gt;</entry><entry>Insert</entry></row>
<row><entry>&lt;enter&gt;</entry><entry>Enter</entry></row>
<row><entry>&lt;return&gt;</entry><entry>Return</entry></row>
<row><entry>&lt;home&gt;</entry><entry>Home</entry></row>
<row><entry>&lt;end&gt;</entry><entry>End</entry></row>
<row><entry>&lt;space&gt;</entry><entry>Space bar</entry></row>
<row><entry>&lt;f1&gt;</entry><entry>function key 1</entry></row>
<row><entry>&lt;f10&gt;</entry><entry>function key 10</entry></row>
</tbody>
</tgroup>
</table>

<para>
<emphasis>key</emphasis> does not need to be enclosed in quotes unless it contains a
space (<quote>&puncsp;</quote>) or semi-colon (<quote>;</quote>).
</para>

<para>
<emphasis>function</emphasis> specifies which action to take when <emphasis>key</emphasis> is pressed.
For a complete list of functions, see the <link linkend="functions">reference</link>.  The special function <literal>&lt;noop&gt;</literal> unbinds the specified key
sequence.
</para>

</sect1>

<sect1 id="charset-hook">
<title>Defining Aliases for Character Sets</title>

<para>Usage:</para>

<cmdsynopsis>
<command>charset-hook</command>
<arg choice="plain">
<replaceable class="parameter">alias</replaceable>
</arg>
<arg choice="plain">
<replaceable class="parameter">charset</replaceable>
</arg>

<command>iconv-hook<anchor id="iconv-hook"/></command>
<arg choice="plain">
<replaceable class="parameter">charset</replaceable>
</arg>
<arg choice="plain">
<replaceable class="parameter">local-charset</replaceable>
</arg>
</cmdsynopsis>

<para>
The <command>charset-hook</command> command defines an alias for a character set.
This is useful to properly display messages which are tagged with a
character set name not known to Mutt.
</para>

<para>
The <command>iconv-hook</command> command defines a system-specific name for a
character set.  This is helpful when your systems character
conversion library insists on using strange, system-specific names
for character sets.
</para>

</sect1>

<sect1 id="folder-hook">
<title>Setting Variables Based Upon Mailbox</title>

<para>Usage:</para>

<cmdsynopsis>
<command>folder-hook</command>
<arg choice="plain">
<replaceable class="parameter">&lsqb;!&rsqb;regexp</replaceable>
</arg>
<arg choice="plain">
<replaceable class="parameter">command</replaceable>
</arg>
</cmdsynopsis>

<para>
It is often desirable to change settings based on which mailbox you are
reading.  The <command>folder-hook</command> command provides a method by which you can execute
any configuration command.  <emphasis>regexp</emphasis> is a regular expression specifying
in which mailboxes to execute <emphasis>command</emphasis> before loading.  If a mailbox
matches multiple <command>folder-hook</command>s, they are executed in the order given in the
<literal>.muttrc</literal>.
</para>

<note>
<para>
If you use the <quote>!</quote> shortcut for <link linkend="spoolfile">&dollar;spoolfile</link> at the beginning of the pattern, you must place it
inside of double or single quotes in order to distinguish it from the
logical <emphasis>not</emphasis> operator for the expression.
</para>
</note>

<note>
<para>
Settings are <emphasis>not</emphasis> restored when you leave the mailbox.
For example, a command action to perform is to change the sorting method
based upon the mailbox being read:

<screen>
folder-hook mutt "set sort=threads"</screen>

However, the sorting method is not restored to its previous value when
reading a different mailbox.  To specify a <emphasis>default</emphasis> command, use the
pattern <quote>.</quote> before other <command>folder-hook</command>s adjusting a value on a per-folder basis
because <command>folder-hook</command>s are evaluated in the order given in the
configuration file.
</para>
</note>

<para>
The following example will set the <link linkend="sort">sort</link> variable
to <literal>date-sent</literal> for all folders but to <literal>threads</literal>
for all folders containing <quote>mutt</quote> in their name.
</para>

<example id="ex-folder-sorting">
<title>Setting sort method based on mailbox name</title>
<screen>
folder-hook . "set sort=date-sent"
folder-hook mutt "set sort=threads"
</screen>
</example>

</sect1>

<sect1 id="macro">
<title>Keyboard Macros</title>

<para>Usage:</para>

<cmdsynopsis>
<command>macro</command>
<arg choice="plain">
<replaceable class="parameter">menu</replaceable>
</arg>
<arg choice="plain">
<replaceable class="parameter">key</replaceable>
</arg>
<arg choice="plain">
<replaceable class="parameter">sequence</replaceable>
</arg>
<arg choice="opt">
<replaceable class="parameter">description</replaceable>
</arg>
</cmdsynopsis>

<para>
Macros are useful when you would like a single key to perform a series of
actions.  When you press <emphasis>key</emphasis> in menu <emphasis>menu</emphasis>, Mutt will behave as if
you had typed <emphasis>sequence</emphasis>.  So if you have a common sequence of commands
you type, you can create a macro to execute those commands with a single
key or fewer keys.
</para>

<para>
<emphasis>menu</emphasis> is the <link linkend="maps">map</link> which the macro will be bound in.
Multiple maps may be specified by separating multiple menu arguments by
commas. Whitespace may not be used in between the menu arguments and the
commas separating them.
</para>

<para>
<emphasis>key</emphasis> and <emphasis>sequence</emphasis> are expanded by the same rules as the
<link linkend="bind">key bindings</link> with some additions.  The
first is that control characters in <emphasis>sequence</emphasis> can also be specified
as <emphasis>&circ;x</emphasis>.  In order to get a caret (<quote>&circ;</quote>) you need to use
<emphasis>&circ;&circ;</emphasis>.  Secondly, to specify a certain key such as <emphasis>up</emphasis>
or to invoke a function directly, you can use the format
<emphasis>&lt;key name&gt;</emphasis> and <emphasis>&lt;function name&gt;</emphasis>.  For a listing of key
names see the section on <link linkend="bind">key bindings</link>.  Functions
are listed in the <link linkend="functions">reference</link>.
</para>

<para>
The advantage with using function names directly is that the macros will
work regardless of the current key bindings, so they are not dependent on
the user having particular key definitions.  This makes them more robust
and portable, and also facilitates defining of macros in files used by more
than one user (e.g., the system Muttrc).
</para>

<para>
Optionally you can specify a descriptive text after <emphasis>sequence</emphasis>,
which is shown in the help screens if they contain a description.
</para>

<note>
<para>
Macro definitions (if any) listed in the help screen(s), are
silently truncated at the screen width, and are not wrapped.
</para>
</note>

</sect1>

<sect1 id="color">
<title>Using Color and Mono Video Attributes</title>

<para>Usage:</para>

<cmdsynopsis>
<command>color</command>
<arg choice="plain">
<replaceable class="parameter">object</replaceable>
</arg>
<arg choice="plain">
<replaceable class="parameter">foreground</replaceable>
</arg>
<arg choice="plain">
<replaceable class="parameter">background</replaceable>
</arg>

<command>color</command>
<group choice="req">
<arg choice="plain">
<option>header</option>
</arg>
<arg choice="plain">
<option>body</option>
</arg>
</group>
<arg choice="plain">
<replaceable class="parameter">foreground</replaceable>
</arg>
<arg choice="plain">
<replaceable class="parameter">background</replaceable>
</arg>
<arg choice="plain">
<replaceable class="parameter">regexp</replaceable>
</arg>

<command>color</command>
<arg choice="plain">
<option>index</option>
</arg>
<arg choice="plain">
<replaceable class="parameter">foreground</replaceable>
</arg>
<arg choice="plain">
<replaceable class="parameter">background</replaceable>
</arg>
<arg choice="plain">
<replaceable class="parameter">pattern</replaceable>
</arg>

<command>uncolor</command>
<group choice="req">
<arg choice="plain">
<option>index</option>
</arg>
<arg choice="plain">
<option>header</option>
</arg>
<arg choice="plain">
<option>body</option>
</arg>
</group>
<group choice="req">
<arg choice="plain">
<replaceable>*</replaceable>
</arg>
<arg choice="plain" rep="repeat">
<replaceable>pattern</replaceable>
</arg>
</group>
</cmdsynopsis>

<para>
If your terminal supports color, you can spice up Mutt by creating your own
color scheme.  To define the color of an object (type of information), you
must specify both a foreground color <emphasis>and</emphasis> a background color (it is not
possible to only specify one or the other).
</para>

<para>
<emphasis>header</emphasis> and <emphasis>body</emphasis> match <emphasis>regexp</emphasis>
in the header/body of a message, <emphasis>index</emphasis> matches <emphasis>pattern</emphasis>
(see <xref linkend="patterns"/>) in the message index.
</para>

<para>
<emphasis>object</emphasis> can be one of:
</para>

<itemizedlist>
<listitem><para>attachment</para></listitem>
<listitem><para>bold (hiliting bold patterns in the body of messages)</para></listitem>
<listitem><para>error (error messages printed by Mutt)</para></listitem>
<listitem><para>hdrdefault (default color of the message header in the pager)</para></listitem>
<listitem><para>indicator (arrow or bar used to indicate the current item in a menu)</para></listitem>
<listitem><para>markers (the <quote>+</quote> markers at the beginning of wrapped lines in the pager)</para></listitem>
<listitem><para>message (informational messages)</para></listitem>
<listitem><para>normal</para></listitem>
<listitem><para>quoted (text matching <link linkend="quote-regexp">&dollar;quote&lowbar;regexp</link> in the body of a message)</para></listitem>
<listitem><para>quoted1, quoted2, ..., quoted<emphasis>N</emphasis> (higher levels of quoting)</para></listitem>
<listitem><para>search (hiliting of words in the pager)</para></listitem>
<listitem><para>signature</para></listitem><listitem><para>status (mode lines used to display info about the mailbox or message)</para></listitem>
<listitem><para>tilde (the <quote>&tilde;</quote> used to pad blank lines in the pager)</para></listitem>
<listitem><para>tree (thread tree drawn in the message index and attachment menu)</para></listitem>
<listitem><para>underline (hiliting underlined patterns in the body of messages)</para></listitem>
</itemizedlist>

<para>
<emphasis>foreground</emphasis> and <emphasis>background</emphasis> can be one of the following:
</para>

<itemizedlist>
<listitem><para>white</para></listitem>
<listitem><para>black</para></listitem>
<listitem><para>green</para></listitem>
<listitem><para>magenta</para></listitem>
<listitem><para>blue</para></listitem>
<listitem><para>cyan</para></listitem>
<listitem><para>yellow</para></listitem>
<listitem><para>red</para></listitem>
<listitem><para>default</para></listitem>
<listitem><para>color<emphasis>x</emphasis></para>
</listitem>
</itemizedlist>

<para>
<emphasis>foreground</emphasis> can optionally be prefixed with the keyword <literal>bright</literal> to make
the foreground color boldfaced (e.g., <literal>brightred</literal>).
</para>

<para>
If your terminal supports it, the special keyword <emphasis>default</emphasis> can be
used as a transparent color.  The value <emphasis>brightdefault</emphasis> is also valid.
If Mutt is linked against the <emphasis>S-Lang</emphasis> library, you also need to set
the <literal>&dollar;COLORFGBG</literal> environment variable to the default colors of your
terminal for this to work; for example (for Bourne-like shells):
</para>

<screen>
set COLORFGBG="green;black"
export COLORFGBG
</screen>

<note>
<para>
The <emphasis>S-Lang</emphasis> library requires you to use the <emphasis>lightgray</emphasis>
and <emphasis>brown</emphasis> keywords instead of <emphasis>white</emphasis> and <emphasis>yellow</emphasis> when
setting this variable.
</para>
</note>

<note>
<para>
The <command>uncolor</command> command can be applied to the index, header and body objects only.  It
removes entries from the list. You <emphasis>must</emphasis> specify the same pattern
specified in the <command>color</command> command for it to be removed.  The pattern <quote>*</quote> is
a special token which means to clear the color list of all entries.
</para>
</note>

<para>
Mutt also recognizes the keywords <emphasis>color0</emphasis>, <emphasis>color1</emphasis>, &hellip;,
<emphasis>color</emphasis><emphasis>N-1</emphasis> (<emphasis>N</emphasis> being the number of colors supported
by your terminal).  This is useful when you remap the colors for your
display (for example by changing the color associated with <emphasis>color2</emphasis>
for your xterm), since color names may then lose their normal meaning.
</para>

<anchor id="mono"/>
<para>
If your terminal does not support color, it is still possible change the video
attributes through the use of the <quote>mono</quote> command. Usage:
</para>

<cmdsynopsis>
<command>mono</command>
<arg choice="plain">
<replaceable class="parameter">object</replaceable>
</arg>
<arg choice="plain">
<replaceable class="parameter">attribute</replaceable>
</arg>

<command>mono</command>
<group choice="req">
<arg choice="plain">
<option>header</option>
</arg>
<arg choice="plain">
<option>body</option>
</arg>
</group>
<arg choice="plain">
<replaceable class="parameter">attribute</replaceable>
</arg>
<arg choice="plain">
<replaceable class="parameter">regexp</replaceable>
</arg>

<command>mono</command>
<arg choice="plain">
<option>index</option>
</arg>
<arg choice="plain">
<replaceable class="parameter">attribute</replaceable>
</arg>
<arg choice="plain">
<replaceable class="parameter">pattern</replaceable>
</arg>

<command>unmono</command>
<group choice="req">
<arg choice="plain">
<option>index</option>
</arg>
<arg choice="plain">
<option>header</option>
</arg>
<arg choice="plain">
<option>body</option>
</arg>
</group>
<group choice="req">
<arg choice="plain">
<replaceable>*</replaceable>
</arg>
<arg choice="plain" rep="repeat">
<replaceable>pattern</replaceable>
</arg>
</group>
</cmdsynopsis>

<para>
For <emphasis>object</emphasis>, see the <command>color</command> command. <emphasis>attribute</emphasis>
can be one of the following:
</para>

<itemizedlist>
<listitem><para>none</para></listitem>
<listitem><para>bold</para></listitem>
<listitem><para>underline</para></listitem>
<listitem><para>reverse</para></listitem>
<listitem><para>standout</para></listitem>
</itemizedlist>

</sect1>

<sect1 id="msg-hdr-display">
<title>Message Header Display</title>

<sect2 id="ignore">
<title>Selecting Headers</title>

<para>Usage:</para>

<cmdsynopsis>
<command>ignore</command>
<arg choice="plain">
<replaceable class="parameter">pattern</replaceable>
</arg>
<arg choice="opt" rep="repeat">
<replaceable class="parameter">pattern</replaceable>
</arg>

<command>unignore</command>
<group choice="req">
<arg choice="plain">
<replaceable>*</replaceable>
</arg>
<arg choice="plain" rep="repeat">
<replaceable>pattern</replaceable>
</arg>
</group>
</cmdsynopsis>

<para>
Messages often have many header fields added by automatic processing systems,
or which may not seem useful to display on the screen.  This command allows
you to specify header fields which you don't normally want to see in the pager.
</para>

<para>
You do not need to specify the full header field name.  For example,
<quote>ignore content-</quote> will ignore all header fields that begin with the pattern
<quote>content-</quote>. <quote>ignore *</quote> will ignore all headers.
</para>

<para>
To remove a previously added token from the list, use the <quote>unignore</quote> command.
The <quote>unignore</quote> command will make Mutt display headers with the given pattern.
For example, if you do <quote>ignore x-</quote> it is possible to <quote>unignore x-mailer</quote>.
</para>

<para>
<quote>unignore *</quote> will remove all tokens from the ignore list.
</para>

<example id="ex-header-weeding">
<title>Header weeding</title>
<screen>
# Sven's draconian header weeding
ignore *
unignore from date subject to cc
unignore organization organisation x-mailer: x-newsreader: x-mailing-list:
unignore posted-to:
</screen>
</example>

</sect2>

<sect2 id="hdr-order">
<title>Ordering Displayed Headers</title>

<para>Usage:</para>

<cmdsynopsis>
<command>hdr&lowbar;order</command>
<arg choice="plain">
<replaceable class="parameter">header</replaceable>
</arg>
<arg choice="opt" rep="repeat">
<replaceable class="parameter">header</replaceable>
</arg>

<command>unhdr&lowbar;order</command>
<group choice="req">
<arg choice="plain">
<replaceable>*</replaceable>
</arg>
<arg choice="plain" rep="repeat">
<replaceable>header</replaceable>
</arg>
</group>
</cmdsynopsis>

<para>
With the <command>hdr&lowbar;order</command> command you can specify an order in
which Mutt will attempt to present these headers to you when viewing messages.
</para>

<para>
<quote><command>unhdr&lowbar;order</command> *</quote> will clear all previous headers from the order list,
thus removing the header order effects set by the system-wide startup file.
</para>

<example id="ex-hdr-order">
<title>Configuring header display order</title>
<screen>
hdr&lowbar;order From Date: From: To: Cc: Subject:
</screen>
</example>

</sect2>
</sect1>

<sect1 id="alternates">
<title>Alternative Addresses</title>

<para>Usage:</para>

<cmdsynopsis>
<command>alternates</command>
<arg choice="opt" rep="repeat">
<option>-group</option>
<replaceable>name</replaceable>
</arg>
<arg choice="plain">
<replaceable>regexp</replaceable>
</arg>
<arg choice="opt" rep="repeat">
<replaceable>regexp</replaceable>
</arg>

<command>unalternates</command>
<arg choice="opt" rep="repeat">
<option>-group</option>
<replaceable>name</replaceable>
</arg>
<group choice="req">
<arg choice="plain">
<replaceable>*</replaceable>
</arg>
<arg choice="plain" rep="repeat">
<replaceable>regexp</replaceable>
</arg>
</group>
</cmdsynopsis>

<para>
With various functions, Mutt will treat messages differently,
depending on whether you sent them or whether you received them from
someone else.  For instance, when replying to a message that you
sent to a different party, Mutt will automatically suggest to send
the response to the original message's recipients &mdash; responding to
yourself won't make much sense in many cases.  (See <link linkend="reply-to">&dollar;reply&lowbar;to</link>.)
</para>

<para>
Many users receive e-mail under a number of different addresses. To
fully use Mutt's features here, the program must be able to
recognize what e-mail addresses you receive mail under. That's the
purpose of the <command>alternates</command> command: It takes a list of regular
expressions, each of which can identify an address under which you
receive e-mail.
</para>

<para>
As addresses are matched using regular expressions and not exact strict
comparisons, you should make sure you specify your addresses as precise
as possible to avoid mismatches. For example, if you specify:
</para>

<screen>
alternates user@example
</screen>

<para>
Mutt will consider <quote><literal>some-user@example</literal></quote> as
being your address, too which may not be desired. As a solution, in such
cases addresses should be specified as:
</para>

<screen>
alternates '^user@example$'
</screen>

<para>
The <literal>-group</literal> flag causes all of the subsequent regular expressions
to be added to the named group.
</para>

<para>
The <command>unalternates</command> command can be used to write exceptions to
<command>alternates</command> patterns. If an address matches something in an
<command>alternates</command> command, but you nonetheless do not think it is
from you, you can list a more precise pattern under an <command>unalternates</command>
command.
</para>

<para>
To remove a regular expression from the <command>alternates</command> list, use the
<command>unalternates</command> command with exactly the same <emphasis>regexp</emphasis>.
Likewise, if the <emphasis>regexp</emphasis> for an <command>alternates</command> command matches
an entry on the <command>unalternates</command> list, that <command>unalternates</command>
entry will be removed. If the <emphasis>regexp</emphasis> for <command>unalternates</command>
is <quote>*</quote>, <emphasis>all entries</emphasis> on <command>alternates</command> will be removed.
</para>

</sect1>

<sect1 id="lists">
<title>Mailing Lists</title>

<anchor id="subscribe"/>
<para>Usage:</para>

<cmdsynopsis>
<command>lists</command>
<arg choice="opt" rep="repeat">
<option>-group</option>
<replaceable class="parameter">name</replaceable>
</arg>
<arg choice="plain">
<replaceable class="parameter">regexp</replaceable>
</arg>
<arg choice="opt" rep="repeat">
<replaceable class="parameter">regexp</replaceable>
</arg>

<command>unlists</command>
<arg choice="opt" rep="repeat">
<option>-group</option>
<replaceable class="parameter">name</replaceable>
</arg>
<group choice="req">
<arg choice="plain">
<replaceable class="parameter">*</replaceable>
</arg>
<arg choice="plain" rep="repeat">
<replaceable class="parameter">regexp</replaceable>
</arg>
</group>

<command>subscribe</command>
<arg choice="opt" rep="repeat">
<option>-group</option>
<replaceable class="parameter">name</replaceable>
</arg>
<arg choice="plain">
<replaceable class="parameter">regexp</replaceable>
</arg>
<arg choice="opt" rep="repeat">
<replaceable class="parameter">regexp</replaceable>
</arg>

<command>unsubscribe</command>
<arg choice="opt" rep="repeat">
<option>-group</option>
<replaceable class="parameter">name</replaceable>
</arg>
<group choice="req">
<arg choice="plain">
<replaceable class="parameter">*</replaceable>
</arg>
<arg choice="plain" rep="repeat">
<replaceable class="parameter">regexp</replaceable>
</arg>
</group>
</cmdsynopsis>

<para>
Mutt has a few nice features for <link linkend="using-lists">handling mailing lists</link>.  In order to take advantage of them, you must
specify which addresses belong to mailing lists, and which mailing
lists you are subscribed to. Mutt also has limited support for
auto-detecting mailing lists: it supports parsing
<literal>mailto:</literal> links in the common
<literal>List-Post:</literal> header which has the same effect as
specifying the list address via the <command>lists</command> command
(except the group feature). Once you have done this, the
<link linkend="list-reply"><literal>&lt;list-reply&gt;</literal></link>
function will work for all known lists.
Additionally, when you send a message to a subscribed list, Mutt will
add a Mail-Followup-To header to tell other users' mail user agents
not to send copies of replies to your personal address.
</para>

<note>
<para>
The Mail-Followup-To header is a non-standard extension which is not
supported by all mail user agents.  Adding it is not bullet-proof against
receiving personal CCs of list messages.  Also note that the generation
of the Mail-Followup-To header is controlled by the
<link linkend="followup-to">&dollar;followup&lowbar;to</link>
configuration variable since it's common practice on some mailing lists
to send Cc upons replies (which is more a group- than a list-reply).
</para>
</note>

<para>
More precisely, Mutt maintains lists of patterns for the addresses
of known and subscribed mailing lists.  Every subscribed mailing
list is known. To mark a mailing list as known, use the <command>list</command>
command.  To mark it as subscribed, use <command>subscribe</command>.
</para>

<para>
You can use regular expressions with both commands. To mark all
messages sent to a specific bug report's address on Debian's bug
tracking system as list mail, for instance, you could say
</para>

<screen>
subscribe &lsqb;0-9&rsqb;*.*@bugs.debian.org</screen>

<para>
as it's often, it's sufficient to just give a portion of the list's e-mail address.
</para>

<para>
Specify as much of the address as you need to to remove ambiguity.  For
example, if you've subscribed to the Mutt mailing list, you will receive mail
addressed to <literal>mutt-users@mutt.org</literal>.  So, to tell Mutt
that this is a mailing list, you could add <literal>lists mutt-users@</literal> to your
initialization file.  To tell Mutt that you are subscribed to it,
add <literal><command>subscribe</command> mutt-users</literal> to your initialization file instead.
If you also happen to get mail from someone whose address is
<literal>mutt-users@example.com</literal>, you could use
<literal><command>lists</command> ^mutt-users@mutt&bsol;&bsol;.org$</literal>
or <literal><command>subscribe</command> ^mutt-users@mutt&bsol;&bsol;.org$</literal> to
match only mail from the actual list.
</para>

<para>
The <literal>-group</literal> flag adds all of the subsequent regular expressions
to the named group.
</para>

<para>
The <quote>unlists</quote> command is used to remove a token from the list of
known and subscribed mailing-lists. Use <quote>unlists *</quote> to remove all
tokens.
</para>

<para>
To remove a mailing list from the list of subscribed mailing lists,
but keep it on the list of known mailing lists, use <command>unsubscribe</command>.
</para>

</sect1>

<sect1 id="mbox-hook">
<title>Using Multiple Spool Mailboxes</title>

<para>Usage:</para>

<cmdsynopsis>
<command>mbox-hook</command>
<arg choice="plain">
<replaceable class="parameter">&lsqb;!&rsqb;pattern</replaceable>
</arg>
<arg choice="plain">
<replaceable class="parameter">mailbox</replaceable>
</arg>
</cmdsynopsis>

<para>
This command is used to move read messages from a specified mailbox to a
different mailbox automatically when you quit or change folders.
<emphasis>pattern</emphasis> is a regular expression specifying the mailbox to treat as a
<quote>spool</quote> mailbox and <emphasis>mailbox</emphasis> specifies where mail should be saved when
read.
</para>

<para>
Unlike some of the other <emphasis>hook</emphasis> commands, only the <emphasis>first</emphasis> matching
pattern is used (it is not possible to save read mail in more than a single
mailbox).
</para>

</sect1>

<sect1 id="mailboxes">
<title>Monitoring Incoming Mail</title>

<para>Usage:</para>

<cmdsynopsis>
<command>mailboxes</command>
<arg choice="plain">
<replaceable class="parameter">mailbox</replaceable>
</arg>
<arg choice="opt" rep="repeat">
<replaceable class="parameter">mailbox</replaceable>
</arg>

<command>unmailboxes</command>
<group choice="req">
<arg choice="plain">
<replaceable class="parameter">*</replaceable>
</arg>
<arg choice="plain" rep="repeat">
<replaceable class="parameter">mailbox</replaceable>
</arg>
</group>
</cmdsynopsis>

<para>
This command specifies folders which can receive mail and
which will be checked for new messages periodically.
</para>

<para>
<emphasis>folder</emphasis> can either be a local file or directory
(Mbox/Mmdf or Maildir/Mh). If Mutt was built with POP and/or IMAP
support, <emphasis>folder</emphasis> can also be a POP/IMAP folder
URL. The URL syntax is described in <xref linkend="url-syntax"/>,
POP and IMAP are described in <xref linkend="pop"/> and <xref linkend="imap"/>
respectively.
</para>

<para>
Mutt provides a number of advanced features for handling (possibly many)
folders and new mail within them, please refer to
<xref linkend="handling-folders"/> for details (including in what
situations and how often Mutt checks for new mail).
</para>

<para>
The <quote>unmailboxes</quote> command is used to remove a token from the list
of folders which receive mail. Use <quote>unmailboxes *</quote> to remove all
tokens.
</para>

<note>
<para>
The folders in the <command>mailboxes</command> command are resolved when
the command is executed, so if these names contain <link linkend="shortcuts">shortcut characters</link> (such as <quote>=</quote> and <quote>!</quote>), any variable
definition that affects these characters (like <link linkend="folder">&dollar;folder</link> and <link linkend="spoolfile">&dollar;spoolfile</link>)
should be set before the <command>mailboxes</command> command. If
none of these shorcuts are used, a local path should be absolute as
otherwise Mutt tries to find it relative to the directory
from where Mutt was started which may not always be desired.
</para>
</note>

<para>
For Mbox and Mmdf folders, new mail is detected by comparing access and/or
modification times of files: Mutt assumes a folder has new mail if it wasn't
accessed after it was last modified. Utilities like <literal>biff</literal> or
<literal>frm</literal> or any other program which accesses the mailbox might cause
Mutt to never detect new mail for that mailbox if they do not properly reset the
access time. Other possible causes of Mutt not detecting new mail in these folders
are backup tools (updating access times) or filesystems mounted without
access time update support.
</para>

<para>
In cases where new mail detection for Mbox or Mmdf folders appears to be
unreliable, the
<link linkend="check-mbox-size">&dollar;check&lowbar;mbox&lowbar;size</link>
option can be used to make Mutt track and consult file sizes for new
mail detection instead which won't work for size-neutral changes.
</para>

</sect1>

<sect1 id="my-hdr">
<title>User-Defined Headers</title>

<para>Usage:</para>

<cmdsynopsis>
<command>my&lowbar;hdr</command>
<arg choice="plain">
<replaceable class="parameter">string</replaceable>
</arg>

<command>unmy&lowbar;hdr</command>
<group choice="req">
<arg choice="plain">
<replaceable class="parameter">*</replaceable>
</arg>
<arg choice="plain" rep="repeat">
<replaceable class="parameter">field</replaceable>
</arg>
</group>
</cmdsynopsis>

<para>
The <command>my&lowbar;hdr</command> command allows you to create your own header
fields which will be added to every message you send and appear in the
editor if <link linkend="edit-headers">&dollar;edit&lowbar;headers</link> is set.
</para>

<para>
For example, if you would like to add an <quote>Organization:</quote> header field to
all of your outgoing messages, you can put the command something like
shown in <xref linkend="ex-my-hdr"/> in your <literal>.muttrc</literal>.
</para>

<example id="ex-my-hdr">
<title>Defining custom headers</title>
<screen>
my&lowbar;hdr Organization: A Really Big Company, Anytown, USA
</screen>
</example>

<note>
<para>
Space characters are <emphasis>not</emphasis> allowed between the keyword and
the colon (<quote>:</quote>). The standard for electronic mail (RFC2822) says that
space is illegal there, so Mutt enforces the rule.
</para>
</note>

<para>
If you would like to add a header field to a single message, you should
either set the <link linkend="edit-headers">&dollar;edit&lowbar;headers</link> variable,
or use the <literal>&lt;edit-headers&gt;</literal> function (default: <quote>E</quote>) in the compose menu so
that you can edit the header of your message along with the body.
</para>

<para>
To remove user defined header fields, use the <command>unmy&lowbar;hdr</command>
command. You may specify an asterisk (<quote>*</quote>) to remove all header
fields, or the fields to remove. For example, to remove all <quote>To</quote> and
<quote>Cc</quote> header fields, you could use:
</para>

<screen>
unmy&lowbar;hdr to cc
</screen>

</sect1>

<sect1 id="save-hook">
<title>Specify Default Save Mailbox</title>

<para>Usage:</para>

<cmdsynopsis>
<command>save-hook</command>
<arg choice="plain">
<replaceable class="parameter">&lsqb;!&rsqb;pattern</replaceable>
</arg>
<arg choice="plain">
<replaceable class="parameter">mailbox</replaceable>
</arg>
</cmdsynopsis>

<para>
This command is used to override the default mailbox used when saving
messages. <emphasis>mailbox</emphasis> will be used as the default if the message
matches <emphasis>pattern</emphasis>, see <xref linkend="pattern-hook"/> for information
on the exact format.
</para>

<para>
To provide more flexibility and good defaults, Mutt applies the
expandos of <link linkend="index-format">&dollar;index&lowbar;format</link> to
<emphasis>mailbox</emphasis> after it was expanded.
</para>

<example id="ex-save-hook-exando">
<title>Using %-expandos in <command>save-hook</command></title>
<screen>
# default: save all to ~/Mail/&lt;author name&gt;
save-hook . ~/Mail/%F

# save from me@turing.cs.hmc.edu and me@cs.hmc.edu to $folder/elkins
save-hook me@(turing\\.)?cs\\.hmc\\.edu$ +elkins

# save from aol.com to $folder/spam
save-hook aol\\.com$ +spam
</screen>
</example>

<para>
Also see the <link linkend="fcc-save-hook"><command>fcc-save-hook</command></link> command.
</para>

</sect1>

<sect1 id="fcc-hook">
<title>Specify Default Fcc: Mailbox When Composing</title>

<para>Usage:</para>

<cmdsynopsis>
<command>fcc-hook</command>
<arg choice="plain">
<replaceable class="parameter">&lsqb;!&rsqb;pattern</replaceable>
</arg>
<arg choice="plain">
<replaceable class="parameter">mailbox</replaceable>
</arg>
</cmdsynopsis>

<para>
This command is used to save outgoing mail in a mailbox other than
<link linkend="record">&dollar;record</link>.  Mutt searches the initial list of
message recipients for the first matching <emphasis>regexp</emphasis> and uses <emphasis>mailbox</emphasis>
as the default Fcc: mailbox.  If no match is found the message will be saved
to <link linkend="record">&dollar;record</link> mailbox.
</para>

<para>
To provide more flexibility and good defaults, Mutt applies the
expandos of <link linkend="index-format">&dollar;index&lowbar;format</link> to
<emphasis>mailbox</emphasis> after it was expanded.
</para>

<para>
See <xref linkend="pattern-hook"/> for information on the exact format of <emphasis>pattern</emphasis>.
</para>

<screen>fcc-hook &lsqb;@.&rsqb;aol&bsol;&bsol;.com&dollar; +spammers</screen>

<para>
...will save a copy of all messages going to the aol.com domain to
the `+spammers' mailbox by default.  Also see the <link linkend="fcc-save-hook"><command>fcc-save-hook</command></link> command.
</para>

</sect1>

<sect1 id="fcc-save-hook">
<title>Specify Default Save Filename and Default Fcc: Mailbox at Once</title>

<para>Usage:</para>

<cmdsynopsis>
<command>fcc-save-hook</command>
<arg choice="plain">
<replaceable class="parameter">&lsqb;!&rsqb;pattern</replaceable>
</arg>
<arg choice="plain">
<replaceable class="parameter">mailbox</replaceable>
</arg>
</cmdsynopsis>

<para>
This command is a shortcut, equivalent to doing both a <link linkend="fcc-hook"><command>fcc-hook</command></link>
and a <link linkend="save-hook"><command>save-hook</command></link> with its arguments,
including &percnt;-expansion on <emphasis>mailbox</emphasis> according
to <link linkend="index-format">&dollar;index&lowbar;format</link>.
</para>

</sect1>

<sect1 id="send-hook">
<title>Change Settings Based Upon Message Recipients</title>

<anchor id="reply-hook"/>
<anchor id="send2-hook"/>

<para>Usage:</para>

<cmdsynopsis>
<command>reply-hook</command>
<arg choice="plain">
<replaceable class="parameter">&lsqb;!&rsqb;pattern</replaceable>
</arg>
<arg choice="plain">
<replaceable class="parameter">command</replaceable>
</arg>

<command>send-hook</command>
<arg choice="plain">
<replaceable class="parameter">&lsqb;!&rsqb;pattern</replaceable>
</arg>
<arg choice="plain">
<replaceable class="parameter">command</replaceable>
</arg>

<command>send2-hook</command>
<arg choice="plain">
<replaceable class="parameter">&lsqb;!&rsqb;pattern</replaceable>
</arg>
<arg choice="plain">
<replaceable class="parameter">command</replaceable>
</arg>
</cmdsynopsis>

<para>
These commands can be used to execute arbitrary configuration commands based
upon recipients of the message.  <emphasis>pattern</emphasis> is used to match
the message, see <xref linkend="pattern-hook"/> for details. <emphasis>command</emphasis>
is executed when <emphasis>pattern</emphasis> matches.
</para>

<para>
<command>reply-hook</command> is matched against the message you are <emphasis>replying to</emphasis>,
instead of the message you are <emphasis>sending</emphasis>.  <command>send-hook</command> is
matched against all messages, both <emphasis>new</emphasis>
and <emphasis>replies</emphasis>.
</para>

<note>
<para>
<command>reply-hook</command>s are matched <emphasis>before</emphasis> the <command>send-hook</command>, <emphasis>regardless</emphasis>
of the order specified in the user's configuration file.
</para>
</note>

<para>
<command>send2-hook</command> is matched every time a message is changed, either
by editing it, or by using the compose menu to change its recipients
or subject.  <command>send2-hook</command> is executed after <command>send-hook</command>, and
can, e.g., be used to set parameters such as the <link linkend="sendmail">&dollar;sendmail</link> variable depending on the message's sender
address.
</para>

<para>
For each type of <command>send-hook</command> or <command>reply-hook</command>, when multiple matches
occur, commands are executed in the order they are specified in the <literal>.muttrc</literal>
(for that type of hook).
</para>

<para>
Example: <literal><command>send-hook</command> mutt &quot;<command>set</command> mime&lowbar;forward signature=''&quot;</literal>
</para>

<para>
Another typical use for this command is to change the values of the
<link linkend="attribution">&dollar;attribution</link>, <link linkend="signature">&dollar;signature</link> and <link linkend="locale">&dollar;locale</link>
variables in order to change the language of the attributions and
signatures based upon the recipients.
</para>

<note>
<para>
<command>send-hook</command>'s are only executed once after getting the
initial list of recipients.  Adding a recipient after replying or
editing the message will not cause any <command>send-hook</command> to be executed,
similarily if <link linkend="autoedit">&dollar;autoedit</link> is set
(as then the initial list of recipients is empty). Also note that <link
linkend="my-hdr"><command>my&lowbar;hdr</command></link> commands which
modify recipient headers, or the message's subject, don't have any
effect on the current message when executed from a
<command>send-hook</command>.
</para>
</note>

</sect1>

<sect1 id="message-hook">
<title>Change Settings Before Formatting a Message</title>

<para>Usage:</para>

<cmdsynopsis>
<command>message-hook</command>
<arg choice="plain">
<replaceable class="parameter">&lsqb;!&rsqb;pattern</replaceable>
</arg>
<arg choice="plain">
<replaceable class="parameter">command</replaceable>
</arg>
</cmdsynopsis>

<para>
This command can be used to execute arbitrary configuration commands
before viewing or formatting a message based upon information about the message.
<emphasis>command</emphasis> is executed if the <emphasis>pattern</emphasis> matches the message to be
displayed. When multiple matches occur, commands are executed in the order
they are specified in the <literal>.muttrc</literal>.
</para>

<para>
See <xref linkend="pattern-hook"/> for
information on the exact format of <emphasis>pattern</emphasis>.
</para>

<para>
Example:
</para>

<screen>
message-hook ~A 'set pager=builtin'
message-hook '~f freshmeat-news' 'set pager="less \"+/^  subject: .*\""'
</screen>

</sect1>

<sect1 id="crypt-hook">
<title>Choosing the Cryptographic Key of the Recipient</title>

<para>Usage:</para>

<cmdsynopsis>
<command>crypt-hook</command>
<arg choice="plain">
<replaceable class="parameter">pattern</replaceable>
</arg>
<arg choice="plain">
<replaceable class="parameter">keyid</replaceable>
</arg>
</cmdsynopsis>

<para>
When encrypting messages with PGP/GnuPG or OpenSSL, you may want to associate a certain
key with a given e-mail address automatically, either because the
recipient's public key can't be deduced from the destination address,
or because, for some reasons, you need to override the key Mutt would
normally use.  The <command>crypt-hook</command> command provides a
method by which you can specify the ID of the public key to be used
when encrypting messages to a certain recipient.
</para>

<para>
The meaning of <emphasis>keyid</emphasis> is to be taken broadly in this context:  You
can either put a numerical key ID here, an e-mail address, or even
just a real name.
</para>

</sect1>

<sect1 id="push">
<title>Adding Key Sequences to the Keyboard Buffer</title>

<para>Usage:</para>

<cmdsynopsis>
<command>push</command>
<arg choice="plain">
<replaceable class="parameter">string</replaceable>
</arg>
</cmdsynopsis>

<para>
This command adds the named string to the keyboard buffer. The string may
contain control characters, key names and function names like the sequence
string in the <link linkend="macro">macro</link> command. You may use it to
automatically run a sequence of commands at startup, or when entering
certain folders. For example, <xref linkend="ex-folder-hook-push"/>
shows how to automatically collapse all threads when entering a folder.
</para>

<example id="ex-folder-hook-push">
<title>Embedding <command>push</command> in <command>folder-hook</command></title>
<screen>
folder-hook . 'push &lt;collapse-all&gt;'
</screen>
</example>

</sect1>

<sect1 id="exec">
<title>Executing Functions</title>

<para>Usage:</para>

<cmdsynopsis>
<command>exec</command>
<arg choice="plain">
<replaceable class="parameter">function</replaceable>
</arg>
<arg choice="opt" rep="repeat">
<replaceable class="parameter">function</replaceable>
</arg>
</cmdsynopsis>

<para>
This command can be used to execute any function. Functions are
listed in the <link linkend="functions">function reference</link>.
<quote><command>exec</command><literal>function</literal></quote> is equivalent to
<quote><literal>push &lt;function&gt;</literal></quote>.
</para>

</sect1>

<sect1 id="score-command">
<title>Message Scoring</title>

<para>Usage:</para>

<cmdsynopsis>
<command>score</command>
<arg choice="plain">
<replaceable class="parameter">pattern</replaceable>
</arg>
<arg choice="plain">
<replaceable class="parameter">value</replaceable>
</arg>

<command>unscore</command>
<group choice="req">
<arg choice="plain">
<replaceable class="parameter">*</replaceable>
</arg>
<arg choice="plain" rep="repeat">
<replaceable class="parameter">pattern</replaceable>
</arg>
</group>
</cmdsynopsis>

<para>
The <command>score</command> commands adds <emphasis>value</emphasis> to a message's score if <emphasis>pattern</emphasis>
matches it.  <emphasis>pattern</emphasis> is a string in the format described in the <link linkend="patterns">patterns</link> section (note: For efficiency reasons, patterns
which scan information not available in the index, such as <literal>&tilde;b</literal>,
<literal>&tilde;B</literal> or <literal>&tilde;h</literal>, may not be used).  <emphasis>value</emphasis> is a
positive or negative integer.  A message's final score is the sum total of all
matching <command>score</command> entries.  However, you may optionally prefix <emphasis>value</emphasis> with
an equal sign (<quote>=</quote>) to cause evaluation to stop at a particular entry if there is
a match.  Negative final scores are rounded up to 0.
</para>

<para>
The <command>unscore</command> command removes score entries from the list.  You <emphasis>must</emphasis>
specify the same pattern specified in the <command>score</command> command for it to be
removed.  The pattern <quote>*</quote> is a special token which means to clear the list
of all score entries.
</para>

</sect1>

<sect1 id="spam">
<title>Spam Detection</title>

<para>Usage:</para>

<cmdsynopsis>
<command>spam</command>
<arg choice="plain">
<replaceable class="parameter">pattern</replaceable>
</arg>
<arg choice="plain">
<replaceable class="parameter">format</replaceable>
</arg>

<command>nospam</command>
<group choice="req">
<arg choice="plain">
<replaceable class="parameter">*</replaceable>
</arg>
<arg choice="plain">
<replaceable class="parameter">pattern</replaceable>
</arg>
</group>
</cmdsynopsis>

<para>
Mutt has generalized support for external spam-scoring filters.
By defining your spam patterns with the <command>spam</command> and <literal>nospam</literal>
commands, you can <emphasis>limit</emphasis>, <emphasis>search</emphasis>, and <emphasis>sort</emphasis> your
mail based on its spam attributes, as determined by the external
filter. You also can display the spam attributes in your index
display using the <literal>&percnt;H</literal> selector in the <link linkend="index-format">&dollar;index&lowbar;format</link> variable. (Tip: try <literal>&percnt;?H?[&percnt;H] ?</literal>
to display spam tags only when they are defined for a given message.)
</para>

<para>
Your first step is to define your external filter's spam patterns using
the <command>spam</command> command. <emphasis>pattern</emphasis> should be a regular expression
that matches a header in a mail message. If any message in the mailbox
matches this regular expression, it will receive a <quote>spam tag</quote> or
<quote>spam attribute</quote> (unless it also matches a <command>nospam</command> pattern &mdash; see
below.) The appearance of this attribute is entirely up to you, and is
governed by the <emphasis>format</emphasis> parameter. <emphasis>format</emphasis> can be any static
text, but it also can include back-references from the <emphasis>pattern</emphasis>
expression. (A regular expression <quote>back-reference</quote> refers to a
sub-expression contained within parentheses.) <literal>&percnt;1</literal> is replaced with
the first back-reference in the regex, <literal>&percnt;2</literal> with the second, etc.
</para>

<para>
To match spam tags, mutt needs the corresponding header information
which is always the case for local and POP folders but not for IMAP in
the default configuration. Depending on the spam header to be analyzed,
<link linkend="imap-headers">&dollar;imap&lowbar;headers</link> may need
to be adjusted.
</para>

<para>
If you're using multiple spam filters, a message can have more than
one spam-related header. You can define <command>spam</command> patterns for each
filter you use. If a message matches two or more of these patterns, and
the <link linkend="spam-separator">&dollar;spam&lowbar;separator</link> variable is set to a string, then the
message's spam tag will consist of all the <emphasis>format</emphasis> strings joined
together, with the value of <link linkend="spam-separator">&dollar;spam&lowbar;separator</link> separating
them.
</para>

<para>
For example, suppose one uses DCC, SpamAssassin, and PureMessage, then
the configuration might look like in <xref linkend="ex-spam"/>.
</para>

<example id="ex-spam">
<title>Configuring spam detection</title>
<screen>
spam "X-DCC-.*-Metrics:.*(....)=many"         "90+/DCC-%1"
spam "X-Spam-Status: Yes"                     "90+/SA"
spam "X-PerlMX-Spam: .*Probability=([0-9]+)%" "%1/PM"
set spam_separator=", "
</screen>
</example>

<para>
If then a message is received that DCC registered with <quote>many</quote> hits
under the <quote>Fuz2</quote> checksum, and that PureMessage registered with a
97&percnt; probability of being spam, that message's spam tag would read
<literal>90+/DCC-Fuz2, 97/PM</literal>. (The four characters before <quote>=many</quote> in a
DCC report indicate the checksum used &mdash; in this case, <quote>Fuz2</quote>.)
</para>

<para>
If the <link linkend="spam-separator">&dollar;spam&lowbar;separator</link> variable is unset, then each
spam pattern match supersedes the previous one. Instead of getting
joined <emphasis>format</emphasis> strings, you'll get only the last one to match.
</para>

<para>
The spam tag is what will be displayed in the index when you use
<literal>&percnt;H</literal> in the <link linkend="index-format">&dollar;index&lowbar;format</link> variable. It's also the
string that the <literal>&tilde;H</literal> pattern-matching expression matches against for
<literal>&lt;search&gt;</literal> and <literal>&lt;limit&gt;</literal> functions. And it's what sorting by spam
attribute will use as a sort key.
</para>

<para>
That's a pretty complicated example, and most people's actual
environments will have only one spam filter. The simpler your
configuration, the more effective Mutt can be, especially when it comes
to sorting.
</para>

<para>
Generally, when you sort by spam tag, Mutt will sort <emphasis>lexically</emphasis> &mdash;
that is, by ordering strings alphanumerically. However, if a spam tag
begins with a number, Mutt will sort numerically first, and lexically
only when two numbers are equal in value. (This is like UNIX's
<literal>sort -n</literal>.) A message with no spam attributes at all &mdash; that is, one
that didn't match <emphasis>any</emphasis> of your <command>spam</command> patterns &mdash; is sorted at
lowest priority. Numbers are sorted next, beginning with 0 and ranging
upward. Finally, non-numeric strings are sorted, with <quote>a</quote> taking lower
priority than <quote>z</quote>. Clearly, in general, sorting by spam tags is most
effective when you can coerce your filter to give you a raw number. But
in case you can't, Mutt can still do something useful.
</para>

<para>
The <command>nospam</command> command can be used to write exceptions to <command>spam</command>
patterns. If a header pattern matches something in a <command>spam</command> command,
but you nonetheless do not want it to receive a spam tag, you can list a
more precise pattern under a <command>nospam</command> command.
</para>

<para>
If the <emphasis>pattern</emphasis> given to <command>nospam</command> is exactly the same as the
<emphasis>pattern</emphasis> on an existing <command>spam</command> list entry, the effect will be to
remove the entry from the spam list, instead of adding an exception.
Likewise, if the <emphasis>pattern</emphasis> for a <command>spam</command> command matches an entry
on the <command>nospam</command> list, that nospam entry will be removed. If the
<emphasis>pattern</emphasis> for <command>nospam</command> is <quote>*</quote>, <emphasis>all entries on both lists</emphasis>
will be removed. This might be the default action if you use <command>spam</command>
and <command>nospam</command> in conjunction with a <command>folder-hook</command>.
</para>

<para>
You can have as many <command>spam</command> or <command>nospam</command> commands as you like.
You can even do your own primitive <command>spam</command> detection within Mutt &mdash; for
example, if you consider all mail from <literal>MAILER-DAEMON</literal> to be spam,
you can use a <command>spam</command> command like this:
</para>

<screen>
spam "^From: .*MAILER-DAEMON"       "999"
</screen>

</sect1>

<sect1 id="set">
<title>Setting and Querying Variables</title>

<sect2 id="var-types">
<title>Variable Types</title>

<para>
Mutt supports these types of configuration variables:
</para>

<variablelist>
<varlistentry>
<term>boolean</term>
<listitem>
<para>
A boolean expression, either <quote>yes</quote> or <quote>no</quote>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>number</term>
<listitem>
<para>
A signed integer number in the range -32768 to 32767.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>string</term>
<listitem>
<para>
Arbitrary text.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>path</term>
<listitem>
<para>
A specialized string for representing paths including support for
mailbox shortcuts (see <xref linkend="shortcuts"/>) as well as tilde
(<quote>&tilde;</quote>) for a user's home directory and more.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>quadoption</term>
<listitem>
<para>
Like a boolean but triggers a prompt when set to <quote>ask-yes</quote>
or <quote>ask-no</quote> with <quote>yes</quote> and <quote>no</quote>
preselected respectively.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>sort order</term>
<listitem>
<para>
A specialized string allowing only particular words as values depending
on the variable.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>regular expression</term>
<listitem>
<para>
A regular expression, see <xref linkend="regexp"/> for an introduction.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>folder magic</term>
<listitem>
<para>
Specifies the type of folder to use: <emphasis>mbox</emphasis>,
<emphasis>mmdf</emphasis>, <emphasis>mh</emphasis>
or <emphasis>maildir</emphasis>.
Currently only used to determine the type for newly created folders.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>e-mail address</term>
<listitem>
<para>
An e-mail address either with or without
realname. The older <quote><literal>user@example.org (Joe User)</literal></quote>
form is supported but strongly deprecated.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>user-defined</term>
<listitem>
<para>
Arbitrary text, see <xref linkend="set-myvar"/> for details.
</para>
</listitem>
</varlistentry>
</variablelist>

</sect2>

<sect2 id="set-commands">
<title>Commands</title>

<para>
The following commands are available to manipulate and query variables:
</para>

<para>Usage:</para>

<cmdsynopsis>
<command>set</command>
<group choice="req">
<arg choice="plain">
<group choice="opt">
<arg choice="plain"><option>no</option></arg>
<arg choice="plain"><option>inv</option></arg>
</group>
<replaceable class="parameter">variable</replaceable>
</arg>
<arg choice="plain">
<replaceable class="parameter">variable=value</replaceable>
</arg>
</group>
<arg choice="opt" rep="repeat"></arg>

<command>toggle</command>
<arg choice="plain">
<replaceable class="parameter">variable</replaceable>
</arg>
<arg choice="opt" rep="repeat">
<replaceable class="parameter">variable</replaceable>
</arg>

<command>unset</command>
<arg choice="plain">
<replaceable class="parameter">variable</replaceable>
</arg>
<arg choice="opt" rep="repeat">
<replaceable class="parameter">variable</replaceable>
</arg>

<command>reset</command>
<arg choice="plain">
<replaceable class="parameter">variable</replaceable>
</arg>
<arg choice="opt" rep="repeat">
<replaceable class="parameter">variable</replaceable>
</arg>
</cmdsynopsis>

<para>
This command is used to set (and unset) <link linkend="variables">configuration variables</link>.  There are four basic types of variables:
boolean, number, string and quadoption.  <emphasis>boolean</emphasis> variables can be
<emphasis>set</emphasis> (true) or <emphasis>unset</emphasis> (false).  <emphasis>number</emphasis> variables can be
assigned a positive integer value.
<emphasis>string</emphasis> variables consist of any number of printable characters and
must be enclosed in quotes if they contain spaces or tabs.  You
may also use the escape sequences <quote>&bsol;n</quote> and <quote>&bsol;t</quote> for newline and tab, respectively.
<emphasis>quadoption</emphasis> variables are used to control whether or not to be prompted
for certain actions, or to specify a default action.  A value of <emphasis>yes</emphasis>
will cause the action to be carried out automatically as if you had answered
yes to the question.  Similarly, a value of <emphasis>no</emphasis> will cause the
action to be carried out as if you had answered <quote>no.</quote>  A value of
<emphasis>ask-yes</emphasis> will cause a prompt with a default answer of <quote>yes</quote> and
<emphasis>ask-no</emphasis> will provide a default answer of <quote>no.</quote>
</para>

<para>
Prefixing a variable with <quote>no</quote> will unset it.  Example: <literal><command>set</command> noaskbcc</literal>.
</para>

<para>
For <emphasis>boolean</emphasis> variables, you may optionally prefix the variable name with
<literal>inv</literal> to toggle the value (on or off).  This is useful when writing
macros.  Example: <literal><command>set</command> invsmart&lowbar;wrap</literal>.
</para>

<para>
The <command>toggle</command> command automatically prepends the <literal>inv</literal> prefix to all
specified variables.
</para>

<para>
The <command>unset</command> command automatically prepends the <literal>no</literal> prefix to all
specified variables.
</para>

<para>
Using the <literal>&lt;enter-command&gt;</literal> function in the <emphasis>index</emphasis> menu, you can query the
value of a variable by prefixing the name of the variable with a question
mark:
</para>

<screen>
set ?allow_8bit
</screen>

<para>
The question mark is actually only required for boolean and quadoption
variables.
</para>

<para>
The <command>reset</command> command resets all given variables to the compile time
defaults (hopefully mentioned in this manual). If you use the command
<command>set</command> and prefix the variable with <quote>&amp;</quote> this has the same
behavior as the <command>reset</command> command.
</para>

<para>
With the <command>reset</command> command there exists the special variable <quote>all</quote>,
which allows you to reset all variables to their system defaults.
</para>

</sect2>

<sect2 id="set-myvar">
<title>User-Defined Variables</title>

<sect3 id="set-myvar-intro">
<title>Introduction</title>

<para>
Along with the variables listed in the
<link linkend="variables">Configuration variables</link> section, Mutt
supports user-defined variables with names starting
with <literal>my&lowbar;</literal> as in, for
example, <literal>my&lowbar;cfgdir</literal>.
</para>

<para>
The <command>set</command> command either creates a
custom <literal>my&lowbar;</literal> variable or changes its
value if it does exist already. The <command>unset</command> and <command>reset</command>
commands remove the variable entirely.
</para>

<para>
Since user-defined variables are expanded in the same way that
environment variables are (except for
the <link linkend="shell-escape">shell-escape</link> command and
backtick expansion), this feature can be used to make configuration
files more readable.
</para>

</sect3>

<sect3 id="set-myvar-examples">
<title>Examples</title>

<para>
The following example defines and uses the variable <literal>my&lowbar;cfgdir</literal>
to abbreviate the calls of the <link linkend="source"><command>source</command></link> command:
</para>

<example id="ex-myvar1">
<title>Using user-defined variables for config file readability</title>
<screen>
set my_cfgdir = $HOME/mutt/config

source $my_cfgdir/hooks
source $my_cfgdir/macros
# more source commands...
</screen>
</example>

<para>
A custom variable can also be used in macros to backup the current value
of another variable. In the following example, the value of the
<link linkend="delete">&dollar;delete</link> is changed temporarily
while its original value is saved as <literal>my&lowbar;delete</literal>.
After the macro has executed all commands, the original value of <link
linkend="delete">&dollar;delete</link> is restored.
</para>

<example id="ex-myvar2">
<title>Using user-defined variables for backing up other config option values</title>
<screen>
macro pager ,x '&bsol;
&lt;enter-command&gt;set my_delete=$delete&lt;enter&gt;&bsol;
&lt;enter-command&gt;set delete=yes&lt;enter&gt;&bsol;
...&bsol;
&lt;enter-command&gt;set delete=$my_delete&lt;enter&gt;'
</screen>
</example>

<para>
Since Mutt expands such values already when parsing the configuration
file(s), the value of <literal>&dollar;my&lowbar;delete</literal> in the
last example would be the value of <link linkend="delete">&dollar;delete</link> exactly
as it was at that point during parsing the configuration file. If
another statement would change the value for <link linkend="delete">&dollar;delete</link>
later in the same or another file, it would have no effect on
<literal>&dollar;my&lowbar;delete</literal>. However, the expansion can
be deferred to runtime, as shown in the next example, when escaping the
dollar sign.
</para>

<example id="ex-myvar3">
<title>Deferring user-defined variable expansion to runtime</title>
<screen>
macro pager &lt;PageDown&gt; "&bsol;
&lt;enter-command&gt; set my&lowbar;old&lowbar;pager&lowbar;stop=&bsol;&dollar;pager&lowbar;stop pager&lowbar;stop&lt;Enter&gt;&bsol;
&lt;next-page&gt;&bsol;
&lt;enter-command&gt; set pager&lowbar;stop=&bsol;&dollar;my&lowbar;old&lowbar;pager&lowbar;stop&lt;Enter&gt;&bsol;
&lt;enter-command&gt; unset my&lowbar;old&lowbar;pager&lowbar;stop&lt;Enter&gt;"
</screen>
</example>

<para>
Note that there is a space
between <literal>&lt;enter-command&gt;</literal> and
the <command>set</command> configuration command, preventing Mutt from
recording the <command>macro</command>'s commands into its history.
</para>

</sect3>

</sect2>

</sect1>

<sect1 id="source">
<title>Reading Initialization Commands From Another File</title>

<para>Usage:</para>

<cmdsynopsis>
<command>source</command>
<arg choice="plain">
<replaceable class="parameter">filename</replaceable>
</arg>
</cmdsynopsis>

<para>
This command allows the inclusion of initialization commands
from other files.  For example, I place all of my aliases in
<literal>&tilde;/.mail&lowbar;aliases</literal> so that I can make my
<literal>&tilde;/.muttrc</literal> readable and keep my aliases private.
</para>

<para>
If the filename begins with a tilde (<quote>&tilde;</quote>), it will be expanded to the
path of your home directory.
</para>

<para>
If the filename ends with a vertical bar (<quote>&verbar;</quote>), then <emphasis>filename</emphasis> is
considered to be an executable program from which to read input (eg.
<literal><command>source</command> &tilde;/bin/myscript&verbar;</literal>).
</para>

</sect1>

<sect1 id="unhook">
<title>Removing Hooks</title>

<para>Usage:</para>

<cmdsynopsis>
<command>unhook</command>
<group choice="req">
<arg choice="plain">
<replaceable class="parameter">*</replaceable>
</arg>
<arg choice="plain">
<replaceable class="parameter">hook-type</replaceable>
</arg>
</group>
</cmdsynopsis>

<para>
This command permits you to flush hooks you have previously defined.
You can either remove all hooks by giving the <quote>*</quote> character as an
argument, or you can remove all hooks of a specific type by saying
something like <literal><command>unhook</command> send-hook</literal>.
</para>

</sect1>

<sect1 id="formatstrings">
<title>Format Strings</title>

<sect2 id="formatstrings-basics">
<title>Basic usage</title>

<para>
Format strings are a general concept you'll find in several locations
through the Mutt configuration, especially in the
<link linkend="index-format">&dollar;index&lowbar;format</link>,
<link linkend="pager-format">&dollar;pager&lowbar;format</link>,
<link linkend="status-format">&dollar;status&lowbar;format</link>,
and other related variables. These can be very straightforward,
and it's quite possible you already know how to use them.
</para>

<para>
The most basic format string element is a percent symbol followed
by another character. For example, <literal>%s</literal>
represents a message's Subject: header in the <link
linkend="index-format">&dollar;index&lowbar;format</link> variable. The
<quote>expandos</quote> available are documented with each format variable, but
there are general modifiers available with all formatting expandos,
too. Those are our concern here.
</para>

<para>
Some of the modifiers are borrowed right out of C (though you might
know them from Perl, Python, shell, or another language). These are
the <literal>&lsqb;-&rsqb;m.n</literal> modifiers, as in <literal>%-12.12s</literal>. As with
such programming languages, these modifiers allow you to specify the
minimum and maximum size of the resulting string, as well as its
justification. If the <quote>-</quote> sign follows the percent, the string will
be left-justified instead of right-justified. If there's a number
immediately following that, it's the minimum amount of space the
formatted string will occupy &mdash; if it's naturally smaller than that, it
will be padded out with spaces.  If a decimal point and another number
follow, that's the maximum space allowable &mdash; the string will not be
permitted to exceed that width, no matter its natural size. Each of
these three elements is optional, so that all these are legal format
strings: <literal>%-12s</literal>, <literal>%4c</literal>,
<literal>%.15F</literal> and <literal>%-12.15L</literal>.
</para>

<para>
Mutt adds some other modifiers to format strings. If you use an equals
symbol (<literal>=</literal>) as a numeric prefix (like the minus
above), it will force the string to be centered within its minimum
space range. For example, <literal>%=14y</literal> will reserve 14
characters for the %y expansion &mdash; that's the X-Label: header, in
<link linkend="index-format">&dollar;index&lowbar;format</link>. If the expansion
results in a string less than 14 characters, it will be centered in a
14-character space.  If the X-Label for a message were <quote>test</quote>, that
expansion would look like <quote>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;test&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</quote>.
</para>

<para>
There are two very little-known modifiers that affect the way that an
expando is replaced. If there is an underline (<quote>&lowbar;</quote>) character
between any format modifiers (as above) and the expando letter, it will
expands in all lower case. And if you use a colon (<quote>:</quote>), it will
replace all decimal points with underlines.
</para>

</sect2>

<sect2 id="formatstrings-conditionals">
<title>Conditionals</title>

<para>
Depending on the format string variable, some of its sequences can be
used to optionally print a string if their value is nonzero. For
example, you may only want to see the number of flagged messages if such
messages exist, since zero is not particularly meaningful. To optionally
print a string based upon one of the above sequences, the following
construct is used:
</para>

<screen>
&percnt;?&lt;sequence_char&gt;?&lt;optional_string&gt;?</screen>

<para>
where <emphasis>sequence_char</emphasis> is an expando, and
<emphasis>optional_string</emphasis> is the string you would like printed if
<emphasis>sequence_char</emphasis> is nonzero.
<emphasis>optional_string</emphasis> may contain other
sequences as well as normal text, but you may not nest optional
strings.
</para>

<para>
Here is an example illustrating how to optionally print the number of
new messages in a mailbox in
<link linkend="status-format">&dollar;status&lowbar;format</link>:
</para>

<screen>
&percnt;?n?&percnt;n new messages.?</screen>

<para>
You can also switch between two strings using the following construct:
</para>

<screen>
&percnt;?&lt;sequence_char&gt;?&lt;if_string&gt;&amp;&lt;else_string&gt;?</screen>

<para>
If the value of <emphasis>sequence_char</emphasis> is
non-zero, <emphasis>if_string</emphasis> will be expanded,
otherwise <emphasis>else_string</emphasis> will be expanded.
</para>

</sect2>

<sect2 id="formatstrings-filters">
<title>Filters</title>

<para>
Any format string ending in a vertical bar (<quote>&verbar;</quote>) will be
expanded and piped through the first word in the string, using spaces
as separator. The string returned will be used for display.
If the returned string ends in &percnt;, it will be passed through
the formatter a second time. This allows the filter to generate a
replacement format string including &percnt; expandos.
</para>

<para>
All &percnt; expandos in a format string are expanded before the script
is called so that:
</para>

<example id="ex-fmtpipe">
<title>Using external filters in format strings</title>
<screen>
set status_format="script.sh '%r %f (%L)'|"
</screen>
</example>

<para>
will make Mutt expand <literal>&percnt;r</literal>,
<literal>&percnt;f</literal> and <literal>&percnt;L</literal>
before calling the script. The example also shows that arguments can be
quoted: the script will receive the expanded string between the single quotes
as the only argument.
</para>

<para>
A practical example is the <literal>mutt&lowbar;xtitle</literal>
script installed in the <literal>samples</literal>
subdirectory of the Mutt documentation: it can be used as filter for
<link linkend="status-format">&dollar;status&lowbar;format</link> to set the current
terminal's title, if supported.
</para>

</sect2>

<sect2 id="formatstrings-padding">
<title>Padding</title>

<para>
In most format strings, Mutt supports different types of padding using
special &percnt;-expandos:
</para>

<variablelist>
<varlistentry>
<term><literal>%|X</literal></term>
<listitem>
<para>
When this occurs, Mutt will fill the rest of the
line with the character <literal>X</literal>. For
example, filling the rest of the line with dashes is
done by setting:
</para>
<screen>
set status_format = "%v on %h: %B: %?n?%n&amp;no? new messages %|-"</screen>
</listitem>
</varlistentry>
<varlistentry>
<term>
<literal>%&gt;X</literal>
</term>
<listitem>
<para>
Since the previous expando stops at the end of line, there must be a way
to fill the gap between two items via the <literal>&percnt;&gt;X</literal>
expando: it puts as many characters <literal>X</literal> in between two
items so that the rest of the line will be right-justified. For example,
to not put the version string and hostname the above example on the left
but on the right and fill the gap with spaces, one might use (note the
space after <literal>&percnt;&gt;</literal>):
</para>
<screen>
set status_format = "%B: %?n?%n&amp;no? new messages %&gt; (%v on %h)"</screen>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>%*X</literal>
</term>
<listitem>
<para>
Normal right-justification will print everything to the left of the
<literal>%&gt;</literal>, displaying padding and whatever lies to the
right only if there's room. By contrast, <quote>soft-fill</quote> gives
priority to the right-hand side, guaranteeing space to display it and
showing padding only if there's still room. If necessary, soft-fill will
eat text leftwards to make room for rightward text. For example, to
right-justify the subject making sure as much as possible of it fits on
screen, one might use (note two spaces after <literal>&percnt;*
</literal>: the second ensures there's a space between the truncated
right-hand side and the subject):
</para>
<screen>
set index_format="%4C %Z %{%b %d} %-15.15L (%?l?%4l&amp;%4c?)%*  %s"</screen>
</listitem>
</varlistentry>
</variablelist>

</sect2>

</sect1>

</chapter>

<chapter id="advancedusage">
<title>Advanced Usage</title>

<sect1 id="regexp">
<title>Regular Expressions</title>

<para>
All string patterns in Mutt including those in more complex
<link linkend="patterns">patterns</link> must be specified
using regular expressions (regexp) in the <quote>POSIX extended</quote> syntax (which
is more or less the syntax used by egrep and GNU awk).  For your
convenience, we have included below a brief description of this syntax.
</para>

<para>
The search is case sensitive if the pattern contains at least one upper
case letter, and case insensitive otherwise.
</para>

<note>
<para>
<quote>&bsol;</quote>
must be quoted if used for a regular expression in an initialization
command: <quote>&bsol;&bsol;</quote>.
</para>
</note>

<para>
A regular expression is a pattern that describes a set of strings.
Regular expressions are constructed analogously to arithmetic
expressions, by using various operators to combine smaller expressions.
</para>

<note>
<para>
The regular expression can be enclosed/delimited by either &quot;
or ' which is useful if the regular expression includes a white-space
character.  See <xref linkend="muttrc-syntax"/>
for more information on &quot; and ' delimiter processing.  To match a
literal &quot; or ' you must preface it with \ (backslash).
</para>
</note>

<para>
The fundamental building blocks are the regular expressions that match
a single character.  Most characters, including all letters and digits,
are regular expressions that match themselves.  Any metacharacter with
special meaning may be quoted by preceding it with a backslash.
</para>

<para>
The period <quote>.</quote> matches any single character.  The caret <quote>&circ;</quote> and
the dollar sign <quote>&dollar;</quote> are metacharacters that respectively match
the empty string at the beginning and end of a line.
</para>

<para>
A list of characters enclosed by <quote>&lsqb;</quote> and <quote>&rsqb;</quote> matches any
single character in that list; if the first character of the list
is a caret <quote>&circ;</quote> then it matches any character <emphasis>not</emphasis> in the
list.  For example, the regular expression <emphasis>&lsqb;0123456789&rsqb;</emphasis>
matches any single digit.  A range of ASCII characters may be specified
by giving the first and last characters, separated by a hyphen
<quote>-</quote>.  Most metacharacters lose their special meaning inside
lists.  To include a literal <quote>&rsqb;</quote> place it first in the list.
Similarly, to include a literal <quote>&circ;</quote> place it anywhere but first.
Finally, to include a literal hyphen <quote>-</quote> place it last.
</para>

<para>
Certain named classes of characters are predefined.  Character classes
consist of <quote>&lsqb;:</quote>, a keyword denoting the class, and <quote>:&rsqb;</quote>.
The following classes are defined by the POSIX standard in
<xref linkend="posix-regex-char-classes"/>
</para>

<table id="posix-regex-char-classes">
<title>POSIX regular expression character classes</title>
<tgroup cols="2">
<thead>
<row><entry>Character class</entry><entry>Description</entry></row>
</thead>
<tbody>
<row><entry>&lsqb;:alnum:&rsqb;</entry><entry>Alphanumeric characters</entry></row>
<row><entry>&lsqb;:alpha:&rsqb;</entry><entry>Alphabetic characters</entry></row>
<row><entry>&lsqb;:blank:&rsqb;</entry><entry>Space or tab characters</entry></row>
<row><entry>&lsqb;:cntrl:&rsqb;</entry><entry>Control characters</entry></row>
<row><entry>&lsqb;:digit:&rsqb;</entry><entry>Numeric characters</entry></row>
<row><entry>&lsqb;:graph:&rsqb;</entry><entry>Characters that are both printable and visible. (A space is printable, but not visible, while an <quote>a</quote> is both)</entry></row>
<row><entry>&lsqb;:lower:&rsqb;</entry><entry>Lower-case alphabetic characters</entry></row>
<row><entry>&lsqb;:print:&rsqb;</entry><entry>Printable characters (characters that are not control characters)</entry></row>
<row><entry>&lsqb;:punct:&rsqb;</entry><entry>Punctuation characters (characters that are not letter, digits, control characters, or space characters)</entry></row>
<row><entry>&lsqb;:space:&rsqb;</entry><entry>Space characters (such as space, tab and formfeed, to name a few)</entry></row>
<row><entry>&lsqb;:upper:&rsqb;</entry><entry>Upper-case alphabetic characters</entry></row>
<row><entry>&lsqb;:xdigit:&rsqb;</entry><entry>Characters that are hexadecimal digits</entry></row>
</tbody>
</tgroup>
</table>

<para>
A character class is only valid in a regular expression inside the
brackets of a character list.
</para>

<note>
<para>
Note that the brackets in these
class names are part of the symbolic names, and must be included
in addition to the brackets delimiting the bracket list. For
example, <emphasis>&lsqb;&lsqb;:digit:&rsqb;&rsqb;</emphasis> is equivalent to
<emphasis>&lsqb;0-9&rsqb;</emphasis>.
</para>
</note>

<para>
Two additional special sequences can appear in character lists.  These
apply to non-ASCII character sets, which can have single symbols (called
collating elements) that are represented with more than one character,
as well as several characters that are equivalent for collating or
sorting purposes:
</para>

<variablelist>

<varlistentry>
<term>Collating Symbols</term>
<listitem>
<para>
A collating symbol is a multi-character collating element enclosed in
<quote>&lsqb;.</quote> and <quote>.&rsqb;</quote>.  For example, if <quote>ch</quote> is a collating
element, then <emphasis>&lsqb;&lsqb;.ch.&rsqb;&rsqb;</emphasis> is a regexp that matches
this collating element, while <emphasis>&lsqb;ch&rsqb;</emphasis> is a regexp that
matches either <quote>c</quote> or <quote>h</quote>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>Equivalence Classes</term>
<listitem>
<para>
An equivalence class is a locale-specific name for a list of
characters that are equivalent. The name is enclosed in <quote>&lsqb;=</quote>
and <quote>=&rsqb;</quote>.  For example, the name <quote>e</quote> might be used to
represent all of <quote>&egrave;</quote> <quote>&eacute;</quote> and <quote>e</quote>.  In this case,
<emphasis>&lsqb;&lsqb;=e=&rsqb;&rsqb;</emphasis> is a regexp that matches any of
<quote>&egrave;</quote>, <quote>&eacute;</quote> and <quote>e</quote>.
</para>
</listitem>
</varlistentry>
</variablelist>

<para>
A regular expression matching a single character may be followed by one
of several repetition operators described in <xref linkend="regex-repeat"/>.
</para>

<table id="regex-repeat">
<title>Regular expression repetition operators</title>
<tgroup cols="2">
<thead>
<row><entry>Operator</entry><entry>Description</entry></row>
</thead>
<tbody>
<row><entry>?</entry><entry>The preceding item is optional and matched at most once</entry></row>
<row><entry>*</entry><entry>The preceding item will be matched zero or more times</entry></row>
<row><entry>+</entry><entry>The preceding item will be matched one or more times</entry></row>
<row><entry>&lcub;n&rcub;</entry><entry>The preceding item is matched exactly <emphasis>n</emphasis> times</entry></row>
<row><entry>&lcub;n,&rcub;</entry><entry>The preceding item is matched <emphasis>n</emphasis> or more times</entry></row>
<row><entry>&lcub;,m&rcub;</entry><entry>The preceding item is matched at most <emphasis>m</emphasis> times</entry></row>
<row><entry>&lcub;n,m&rcub;</entry><entry>The preceding item is matched at least <emphasis>n</emphasis> times, but no more than <emphasis>m</emphasis> times</entry></row>
</tbody>
</tgroup>
</table>

<para>
Two regular expressions may be concatenated; the resulting regular
expression matches any string formed by concatenating two substrings
that respectively match the concatenated subexpressions.
</para>

<para>
Two regular expressions may be joined by the infix operator <quote>&verbar;</quote>;
the resulting regular expression matches any string matching either
subexpression.
</para>

<para>
Repetition takes precedence over concatenation, which in turn takes
precedence over alternation.  A whole subexpression may be enclosed in
parentheses to override these precedence rules.
</para>

<note>
<para>
If you compile Mutt with the included regular expression engine, the
following operators may also be used in regular expressions as described in <xref linkend="regex-gnu-ext"/>.
</para>
</note>

<table id="regex-gnu-ext">
<title>GNU regular expression extensions</title>
<tgroup cols="2">
<thead>
<row><entry>Expression</entry><entry>Description</entry></row>
</thead>
<tbody>
<row><entry>&bsol;&bsol;y</entry><entry>Matches the empty string at either the beginning or the end of a word</entry></row>
<row><entry>&bsol;&bsol;B</entry><entry>Matches the empty string within a word</entry></row>
<row><entry>&bsol;&bsol;&lt;</entry><entry>Matches the empty string at the beginning of a word</entry></row>
<row><entry>&bsol;&bsol;&gt;</entry><entry>Matches the empty string at the end of a word</entry></row>
<row><entry>&bsol;&bsol;w</entry><entry>Matches any word-constituent character (letter, digit, or underscore)</entry></row>
<row><entry>&bsol;&bsol;W</entry><entry>Matches any character that is not word-constituent</entry></row>
<row><entry>&bsol;&bsol;`</entry><entry>Matches the empty string at the beginning of a buffer (string)</entry></row>
<row><entry>&bsol;&bsol;'</entry><entry>Matches the empty string at the end of a buffer</entry></row>
</tbody>
</tgroup>
</table>

<para>
Please note however that these operators are not defined by POSIX, so
they may or may not be available in stock libraries on various systems.
</para>

</sect1>

<sect1 id="patterns">
<title>Patterns: Searching, Limiting and Tagging</title>

<sect2 id="patterns-modifier">
<title>Pattern Modifier</title>

<para>
Many of Mutt's commands allow you to specify a pattern to match
(<literal>limit</literal>, <literal>tag-pattern</literal>,
<literal>delete-pattern</literal>, etc.). <xref linkend="tab-patterns"/>
shows several ways to select messages.
</para>

<table id="tab-patterns">
<title>Pattern modifiers</title>
<tgroup cols="2">
<thead>
<row><entry>Pattern modifier</entry><entry>Description</entry></row>
</thead>
<tbody>
<row><entry>~A</entry><entry>all messages</entry></row>
<row><entry>~b <emphasis>EXPR</emphasis></entry><entry>messages which contain <emphasis>EXPR</emphasis> in the message body</entry></row>
<row><entry>=b <emphasis>STRING</emphasis></entry><entry>messages which contain <emphasis>STRING</emphasis> in the message body. If IMAP is enabled, searches for <emphasis>STRING</emphasis> on the server, rather than downloading each message and searching it locally.</entry></row>
<row><entry>~B <emphasis>EXPR</emphasis></entry><entry>messages which contain <emphasis>EXPR</emphasis> in the whole message</entry></row>
<row><entry>~c <emphasis>EXPR</emphasis></entry><entry>messages carbon-copied to <emphasis>EXPR</emphasis></entry></row>
<row><entry>%c <emphasis>GROUP</emphasis></entry><entry>messages carbon-copied to any member of <emphasis>GROUP</emphasis></entry></row>
<row><entry>~C <emphasis>EXPR</emphasis></entry><entry>messages either to: or cc: <emphasis>EXPR</emphasis></entry></row>
<row><entry>%C <emphasis>GROUP</emphasis></entry><entry>messages either to: or cc: to any member of <emphasis>GROUP</emphasis></entry></row>
<row><entry>~d &lsqb;<emphasis>MIN</emphasis>&rsqb;-&lsqb;<emphasis>MAX</emphasis>&rsqb;</entry><entry>messages with <quote>date-sent</quote> in a Date range</entry></row>
<row><entry>~D</entry><entry>deleted messages</entry></row>
<row><entry>~e <emphasis>EXPR</emphasis></entry><entry>messages which contains <emphasis>EXPR</emphasis> in the <quote>Sender</quote> field</entry></row>
<row><entry>%e <emphasis>GROUP</emphasis></entry><entry>messages which contain a member of <emphasis>GROUP</emphasis> in the <quote>Sender</quote> field</entry></row>
<row><entry>~E</entry><entry>expired messages</entry></row>
<row><entry>~F</entry><entry>flagged messages</entry></row>
<row><entry>~f <emphasis>EXPR</emphasis></entry><entry>messages originating from <emphasis>EXPR</emphasis></entry></row>
<row><entry>%f <emphasis>GROUP</emphasis></entry><entry>messages originating from any member of <emphasis>GROUP</emphasis></entry></row>
<row><entry>~g</entry><entry>cryptographically signed messages</entry></row>
<row><entry>~G</entry><entry>cryptographically encrypted messages</entry></row>
<row><entry>~h <emphasis>EXPR</emphasis></entry><entry>messages which contain <emphasis>EXPR</emphasis> in the message header</entry></row>
<row><entry>~H <emphasis>EXPR</emphasis></entry><entry>messages with a spam attribute matching <emphasis>EXPR</emphasis></entry></row>
<row><entry>~i <emphasis>EXPR</emphasis></entry><entry>messages which match <emphasis>EXPR</emphasis> in the <quote>Message-ID</quote> field</entry></row>
<row><entry>~k</entry><entry>messages which contain PGP key material</entry></row>
<row><entry>~L <emphasis>EXPR</emphasis></entry><entry>messages either originated or received by <emphasis>EXPR</emphasis></entry></row>
<row><entry>%L <emphasis>GROUP</emphasis></entry><entry>message either originated or received by any member of <emphasis>GROUP</emphasis></entry></row>
<row><entry>~l</entry><entry>messages addressed to a known mailing list</entry></row>
<row><entry>~m &lsqb;<emphasis>MIN</emphasis>&rsqb;-&lsqb;<emphasis>MAX</emphasis>&rsqb;</entry><entry>messages in the range <emphasis>MIN</emphasis> to <emphasis>MAX</emphasis> *)</entry></row>
<row><entry>~n &lsqb;<emphasis>MIN</emphasis>&rsqb;-&lsqb;<emphasis>MAX</emphasis>&rsqb;</entry><entry>messages with a score in the range <emphasis>MIN</emphasis> to <emphasis>MAX</emphasis> *)</entry></row>
<row><entry>~N</entry><entry>new messages</entry></row>
<row><entry>~O</entry><entry>old messages</entry></row>
<row><entry>~p</entry><entry>messages addressed to you (consults <command>alternates</command>)</entry></row>
<row><entry>~P</entry><entry>messages from you (consults <command>alternates</command>)</entry></row>
<row><entry>~Q</entry><entry>messages which have been replied to</entry></row>
<row><entry>~r &lsqb;<emphasis>MIN</emphasis>&rsqb;-&lsqb;<emphasis>MAX</emphasis>&rsqb;</entry><entry>messages with <quote>date-received</quote> in a Date range</entry></row>
<row><entry>~R</entry><entry>read messages</entry></row>
<row><entry>~s <emphasis>EXPR</emphasis></entry><entry>messages having <emphasis>EXPR</emphasis> in the <quote>Subject</quote> field.</entry></row>
<row><entry>~S</entry><entry>superseded messages</entry></row>
<row><entry>~t <emphasis>EXPR</emphasis></entry><entry>messages addressed to <emphasis>EXPR</emphasis></entry></row>
<row><entry>~T</entry><entry>tagged messages</entry></row>
<row><entry>~u</entry><entry>messages addressed to a subscribed mailing list</entry></row>
<row><entry>~U</entry><entry>unread messages</entry></row>
<row><entry>~v</entry><entry>messages part of a collapsed thread.</entry></row>
<row><entry>~V</entry><entry>cryptographically verified messages</entry></row>
<row><entry>~x <emphasis>EXPR</emphasis></entry><entry>messages which contain <emphasis>EXPR</emphasis> in the <quote>References</quote> or <quote>In-Reply-To</quote> field</entry></row>
<row><entry>~X &lsqb;<emphasis>MIN</emphasis>&rsqb;-&lsqb;<emphasis>MAX</emphasis>&rsqb;</entry><entry>messages with <emphasis>MIN</emphasis> to <emphasis>MAX</emphasis> attachments *)</entry></row>
<row><entry>~y <emphasis>EXPR</emphasis></entry><entry>messages which contain <emphasis>EXPR</emphasis> in the <quote>X-Label</quote> field</entry></row>
<row><entry>~z &lsqb;<emphasis>MIN</emphasis>&rsqb;-&lsqb;<emphasis>MAX</emphasis>&rsqb;</entry><entry>messages with a size in the range <emphasis>MIN</emphasis> to <emphasis>MAX</emphasis> *) **)</entry></row>
<row><entry>~=</entry><entry>duplicated messages (see <link linkend="duplicate-threads">&dollar;duplicate&lowbar;threads</link>)</entry></row>
<row><entry>~$</entry><entry>unreferenced messages (requires threaded view)</entry></row>
<row><entry>~(<emphasis>PATTERN</emphasis>)</entry><entry>messages in threads
containing messages matching <emphasis>PATTERN</emphasis>, e.g. all
threads containing messages from you: ~(~P)</entry></row>
</tbody>
</tgroup>
</table>

<para>
Where <emphasis>EXPR</emphasis> is a
<link linkend="regexp">regular expression</link>. 
</para>

<para>
*) The forms <quote>&lt;&lsqb;<emphasis>MAX</emphasis>&rsqb;</quote>, <quote>&gt;&lsqb;<emphasis>MIN</emphasis>&rsqb;</quote>,
<quote>&lsqb;<emphasis>MIN</emphasis>&rsqb;-</quote> and <quote>-&lsqb;<emphasis>MAX</emphasis>&rsqb;</quote>
are allowed, too.
</para>

<para>
**) The suffixes <quote>K</quote> and <quote>M</quote> are allowed to specify kilobyte and megabyte respectively.
</para>

<para>
Special attention has to be
payed when using regular expressions inside of patterns.  Specifically,
Mutt's parser for these patterns will strip one level of backslash (<quote>\</quote>),
which is normally used for quoting.  If it is your intention to use a
backslash in the regular expression, you will need to use two backslashes
instead (<quote>\\</quote>). You can force Mutt to treat <emphasis>EXPR</emphasis> as a simple string
instead of a regular expression by using = instead of &tilde; in the
pattern name. For example, <literal>=b *.*</literal> will find all messages that contain
the literal string <quote>*.*</quote>. Simple string matches are less powerful than
regular expressions but can be considerably faster. This is especially
true for IMAP folders, because string matches can be performed on the
server instead of by fetching every message. IMAP treats <literal>=h</literal> specially:
it must be of the form <quote>header: substring</quote> and will not partially
match header names. The substring part may be omitted if you simply
wish to find messages containing a particular header without regard to
its value.
</para>

<para>
Patterns matching lists of addresses (notably c, C, p, P and t)
match if there is at least one match in the whole list. If you want to
make sure that all elements of that list match, you need to prefix your
pattern with <quote>&circ;</quote>.
This example matches all mails which only has recipients from Germany.
</para>

<example id="ex-recips">
<title>Matching all addresses in address lists</title>
<screen>
^~C \.de$
</screen>
</example>

</sect2>

<sect2 id="simple-searches">
<title>Simple Searches</title>

<para>
Mutt supports two versions of so called <quote>simple searches</quote>. These are
issued if the query entered for searching, limiting and similar
operations does not seem to contain a valid pattern modifier (i.e. it does not contain
one of these characters: <quote>&tilde;</quote>, <quote>=</quote> or <quote>&percnt;</quote>). If the query is
supposed to contain one of these special characters, they must be escaped
by prepending a backslash (<quote>\</quote>).
</para>

<para>
The first type is by checking whether the query string equals
a keyword case-insensitively from <xref linkend="tab-simplesearch-keywords"/>:
If that is the case, Mutt will use the shown pattern modifier instead.
If a keyword would conflict with your search keyword, you need to turn
it into a regular expression to avoid matching the keyword table. For
example, if you want to find all messages matching <quote>flag</quote>
(using <link linkend="simple-search">&dollar;simple&lowbar;search</link>)
but don't want to match flagged messages, simply search for
<quote><literal>&lsqb;f&rsqb;lag</literal></quote>.
</para>

<table id="tab-simplesearch-keywords">
<title>Simple search keywords</title>
<tgroup cols="2">
<thead>
<row><entry>Keyword</entry><entry>Pattern modifier</entry></row>
</thead>
<tbody>
<row><entry>all</entry><entry>~A</entry></row>
<row><entry>.</entry><entry>~A</entry></row>
<row><entry>&circ;</entry><entry>~A</entry></row>
<row><entry>del</entry><entry>~D</entry></row>
<row><entry>flag</entry><entry>~F</entry></row>
<row><entry>new</entry><entry>~N</entry></row>
<row><entry>old</entry><entry>~O</entry></row>
<row><entry>repl</entry><entry>~Q</entry></row>
<row><entry>read</entry><entry>~R</entry></row>
<row><entry>tag</entry><entry>~T</entry></row>
<row><entry>unread</entry><entry>~U</entry></row>
</tbody>
</tgroup>
</table>

<para>
The second type of simple search is to build a complex search
pattern using <link linkend="simple-search">&dollar;simple&lowbar;search</link>
as a template. Mutt will insert your query properly quoted and search
for the composed complex query.
</para>

</sect2>

<sect2 id="complex-patterns">
<title>Nesting and Boolean Operators</title>

<para>
Logical AND is performed by specifying more than one criterion.  For
example:
</para>

<screen>
~t mutt ~f elkins
</screen>

<para>
would select messages which contain the word <quote>mutt</quote> in the list of
recipients <emphasis>and</emphasis> that have the word <quote>elkins</quote> in the <quote>From</quote> header
field.
</para>

<para>
Mutt also recognizes the following operators to create more complex search
patterns:
</para>

<itemizedlist>
<listitem>

<para>
! &mdash; logical NOT operator
</para>
</listitem>
<listitem>

<para>
&verbar; &mdash; logical OR operator
</para>
</listitem>
<listitem>

<para>
() &mdash; logical grouping operator
</para>
</listitem>

</itemizedlist>

<para>
Here is an example illustrating a complex search pattern.  This pattern will
select all messages which do not contain <quote>mutt</quote> in the <quote>To</quote> or <quote>Cc</quote>
field and which are from <quote>elkins</quote>.
</para>

<example id="ex-pattern-bool">
<title>Using boolean operators in patterns</title>
<screen>
!(~t mutt|~c mutt) ~f elkins
</screen>
</example>

<para>
Here is an example using white space in the regular expression (note
the ' and &quot; delimiters).  For this to match, the mail's subject must
match the <quote>&circ;Junk +From +Me$</quote> and it must be from either <quote>Jim +Somebody</quote>
or <quote>Ed +SomeoneElse</quote>:
</para>

<screen>
 '~s "^Junk +From +Me$" ~f ("Jim +Somebody"|"Ed +SomeoneElse")'
</screen>

<note>
<para>
If a regular expression contains parenthesis, or a vertical bar
("&verbar;"), you <emphasis>must</emphasis> enclose the expression in double or single quotes since
those characters are also used to separate different parts of Mutt's
pattern language.  For example: <literal>~f "me@(mutt\.org|cs\.hmc\.edu)"</literal>
Without the quotes, the parenthesis wouldn't end.
This would be separated to two OR'd patterns: <emphasis>&tilde;f me@(mutt\.org</emphasis>
and <emphasis>cs\.hmc\.edu)</emphasis>. They are never what you want.
</para>
</note>

</sect2>

<sect2 id="date-patterns">
<title>Searching by Date</title>

<para>
Mutt supports two types of dates, <emphasis>absolute</emphasis> and <emphasis>relative</emphasis>.
</para>

<sect3 id="date-absolute">
<title>Absolute Dates</title>

<para>
Dates <emphasis>must</emphasis> be in DD/MM/YY format (month and year are
optional, defaulting to the current month and year).  An example of a valid
range of dates is:
</para>

<screen>
Limit to messages matching: ~d 20/1/95-31/10
</screen>

<para>
If you omit the minimum (first) date, and just specify <quote>-DD/MM/YY</quote>, all
messages <emphasis>before</emphasis> the given date will be selected.  If you omit the maximum
(second) date, and specify <quote>DD/MM/YY-</quote>, all messages <emphasis>after</emphasis> the given
date will be selected.  If you specify a single date with no dash (<quote>-</quote>),
only messages sent on the given date will be selected.
</para>

<para>
You can add error margins to absolute dates.
An error margin is a sign (+ or -), followed by a digit, followed by
one of the units in <xref linkend="tab-date-units"/>. As a special case, you can replace the
sign by a <quote>*</quote> character, which is equivalent to giving identical plus and minus error margins.
</para>

<table id="tab-date-units">
<title>Date units</title>
<tgroup cols="2">
<thead>
<row><entry>Unit</entry><entry>Description</entry></row>
</thead>
<tbody>
<row><entry>y</entry><entry>Years</entry></row>
<row><entry>m</entry><entry>Months</entry></row>
<row><entry>w</entry><entry>Weeks</entry></row>
<row><entry>d</entry><entry>Days</entry></row>
</tbody>
</tgroup>
</table>

<para>
Example: To select any messages two weeks around January 15, 2001,
you'd use the following pattern:
</para>

<screen>
Limit to messages matching: ~d 15/1/2001*2w
</screen>

</sect3>

<sect3 id="dates-relative">
<title>Relative Dates</title>

<para>
This type of date is relative to the current date, and may
be specified as:
</para>

<itemizedlist>
<listitem>

<para>
&gt;<emphasis>offset</emphasis> for messages older than <emphasis>offset</emphasis> units
</para>
</listitem>
<listitem>

<para>
&lt;<emphasis>offset</emphasis> for messages newer than <emphasis>offset</emphasis> units
</para>
</listitem>
<listitem>

<para>
=<emphasis>offset</emphasis> for messages exactly <emphasis>offset</emphasis> units old
</para>
</listitem>

</itemizedlist>

<para>
<emphasis>offset</emphasis> is specified as a positive number with one of the units from <xref linkend="tab-date-units"/>.
</para>

<para>
Example: to select messages less than 1 month old, you would use
</para>

<screen>
Limit to messages matching: ~d &lt;1m
</screen>

<note>
<para>
All dates used when searching are relative to the
<emphasis>local</emphasis> time zone, so unless you change the setting of your <link linkend="index-format">&dollar;index&lowbar;format</link> to include a
<literal>&percnt;&lsqb;...&rsqb;</literal> format, these are <emphasis>not</emphasis> the dates shown
in the main index.
</para>
</note>

</sect3>

</sect2>

</sect1>

<sect1 id="tags">
<title>Using Tags</title>

<para>
Sometimes it is desirable to perform an operation on a group of
messages all at once rather than one at a time.  An example might be
to save messages to a mailing list to a separate folder, or to
delete all messages with a given subject.  To tag all messages
matching a pattern, use the <literal>&lt;tag-pattern&gt;</literal> function, which is bound to
<quote>shift-T</quote> by default.  Or you can select individual messages by
hand using the <literal>&lt;tag-message&gt;</literal> function, which is bound to <quote>t</quote> by
default.  See <link linkend="patterns">patterns</link> for Mutt's pattern
matching syntax.
</para>

<para>
Once you have tagged the desired messages, you can use the
<quote>tag-prefix</quote> operator, which is the <quote>;</quote> (semicolon) key by default.
When the <quote>tag-prefix</quote> operator is used, the <emphasis>next</emphasis> operation will
be applied to all tagged messages if that operation can be used in that
manner.  If the <link linkend="auto-tag">&dollar;auto&lowbar;tag</link>
variable is set, the next operation applies to the tagged messages
automatically, without requiring the <quote>tag-prefix</quote>.
</para>

<para>
In <link linkend="macro"><command>macro</command>s</link> or <link linkend="push"><command>push</command></link> commands,
you can use the <literal>&lt;tag-prefix-cond&gt;</literal> operator.  If there are no tagged
messages, Mutt will <quote>eat</quote> the rest of the macro to abort it's execution.
Mutt will stop <quote>eating</quote> the macro when it encounters the <literal>&lt;end-cond&gt;</literal>
operator; after this operator the rest of the macro will be executed as
normal.
</para>

</sect1>

<sect1 id="hooks">
<title>Using Hooks</title>

<para>
A <emphasis>hook</emphasis> is a concept found in many other programs which allows you to
execute arbitrary commands before performing some operation.  For example,
you may wish to tailor your configuration based upon which mailbox you are
reading, or to whom you are sending mail.  In the Mutt world, a <emphasis>hook</emphasis>
consists of a <link linkend="regexp">regular expression</link> or
<link linkend="patterns">pattern</link> along with a
configuration option/command.  See:

<itemizedlist>

<listitem>
<para>
<link linkend="account-hook"><command>account-hook</command></link>
</para>
</listitem>

<listitem>
<para>
<link linkend="charset-hook"><command>charset-hook</command></link>
</para>
</listitem>

<listitem>
<para>
<link linkend="crypt-hook"><command>crypt-hook</command></link>
</para>
</listitem>

<listitem>
<para>
<link linkend="fcc-hook"><command>fcc-hook</command></link>
</para>
</listitem>

<listitem>
<para>
<link linkend="fcc-save-hook"><command>fcc-save-hook</command></link>
</para>
</listitem>

<listitem>
<para>
<link linkend="folder-hook"><command>folder-hook</command></link>
</para>
</listitem>

<listitem>
<para>
<link linkend="iconv-hook"><command>iconv-hook</command></link>
</para>
</listitem>

<listitem>
<para>
<link linkend="mbox-hook"><command>mbox-hook</command></link>
</para>
</listitem>

<listitem>
<para>
<link linkend="message-hook"><command>message-hook</command></link>
</para>
</listitem>

<listitem>
<para>
<link linkend="reply-hook"><command>reply-hook</command></link>
</para>
</listitem>

<listitem>
<para>
<link linkend="save-hook"><command>save-hook</command></link>
</para>
</listitem>

<listitem>
<para>
<link linkend="send-hook"><command>send-hook</command></link>
</para>
</listitem>

<listitem>
<para>
<link linkend="send2-hook"><command>send2-hook</command></link>
</para>
</listitem>

</itemizedlist>

for specific details on each type of <emphasis>hook</emphasis> available.
</para>

<note>
<para>
If a hook changes configuration settings, these changes remain
effective until the end of the current Mutt session. As this is generally
not desired, a <quote>default</quote> hook needs to be added before all
other hooks  of that type to restore configuration defaults.
</para>
</note>

<example id="ex-default-hook">
<title>Specifying a <quote>default</quote> hook</title>
<screen>
send-hook . 'unmy_hdr From:'
send-hook ~C'^b@b\.b$' my_hdr from: c@c.c
</screen>
</example>

<para>
In <xref linkend="ex-default-hook"/>, by default the value of
<link linkend="from">&dollar;from</link>
and <link linkend="realname">&dollar;realname</link>
is not overridden. When sending messages either To: or Cc:
to <literal>&lt;b@b.b&gt;</literal>, the From: header is changed to
<literal>&lt;c@c.c&gt;</literal>.
</para>

<sect2 id="pattern-hook" xreflabel="Message Matching in Hooks">
<title>Message Matching in Hooks</title>

<para>
Hooks that act upon messages (<command>message-hook</command>, <command>reply-hook</command>,
<command>send-hook</command>, <command>send2-hook</command>, <command>save-hook</command>, <command>fcc-hook</command>) are evaluated in a
slightly different manner. For the other
types of hooks, a <link linkend="regexp">regular expression</link> is
sufficient.  But in dealing with messages a finer grain of control is
needed for matching since for different purposes you want to match
different criteria.
</para>

<para>
Mutt allows the use of the <link linkend="patterns">search pattern</link>
language for matching messages in hook commands.  This works in
exactly the same way as it would when <emphasis>limiting</emphasis> or
<emphasis>searching</emphasis> the mailbox, except that you are restricted to those
operators which match information Mutt extracts from the header of
the message (i.e., from, to, cc, date, subject, etc.).
</para>

<para>
For example, if you wanted to set your return address based upon sending
mail to a specific address, you could do something like:
</para>

<screen>
send-hook '~t ^me@cs\.hmc\.edu$' 'my_hdr From: Mutt User &lt;user@host&gt;'
</screen>

<para>
which would execute the given command when sending mail to
<emphasis>me@cs.hmc.edu</emphasis>.
</para>

<para>
However, it is not required that you write the pattern to match using the
full searching language.  You can still specify a simple <emphasis>regular
expression</emphasis> like the other hooks, in which case Mutt will translate your
pattern into the full language, using the translation specified by the
<link linkend="default-hook">&dollar;default&lowbar;hook</link> variable.  The
pattern is translated at the time the hook is declared, so the value of
<link linkend="default-hook">&dollar;default&lowbar;hook</link> that is in effect
at that time will be used.
</para>

</sect2>

</sect1>

<sect1 id="query">
<title>External Address Queries</title>

<para>
Mutt supports connecting to external directory databases such as LDAP,
ph/qi, bbdb, or NIS through a wrapper script which connects to Mutt
using a simple interface.  Using the <link linkend="query-command">&dollar;query&lowbar;command</link> variable, you specify the wrapper
command to use.  For example:
</para>

<screen>
set query_command = "mutt_ldap_query.pl '%s'"
</screen>

<para>
The wrapper script should accept the query on the command-line.  It
should return a one line message, then each matching response on a
single line, each line containing a tab separated address then name then
some other optional information.  On error, or if there are no matching
addresses, return a non-zero exit code and a one line error message.
</para>

<para>
An example multiple response output:
</para>

<screen>
Searching database ... 20 entries ... 3 matching:
me@cs.hmc.edu           Michael Elkins  mutt dude
blong@fiction.net       Brandon Long    mutt and more
roessler@does-not-exist.org        Thomas Roessler mutt pgp
</screen>

<para>
There are two mechanisms for accessing the query function of Mutt.  One
is to do a query from the index menu using the <literal>&lt;query&gt;</literal> function (default: Q).
This will prompt for a query, then bring up the query menu which will
list the matching responses.  From the query menu, you can select
addresses to create aliases, or to mail.  You can tag multiple addresses
to mail, start a new query, or have a new query appended to the current
responses.
</para>

<para>
The other mechanism for accessing the query function is for address
completion, similar to the alias completion.  In any prompt for address
entry, you can use the <literal>&lt;complete-query&gt;</literal> function (default: &circ;T) to run a
query based on the current address you have typed.  Like aliases, Mutt
will look for what you have typed back to the last space or comma.  If
there is a single response for that query, Mutt will expand the address
in place.  If there are multiple responses, Mutt will activate the query
menu.  At the query menu, you can select one or more addresses to be
added to the prompt.
</para>

</sect1>

<sect1 id="mailbox-formats">
<title>Mailbox Formats</title>

<para>
Mutt supports reading and writing of four different local mailbox formats:
mbox, MMDF, MH and Maildir.  The mailbox type is autodetected, so there
is no need to use a flag for different mailbox types.  When creating new
mailboxes, Mutt uses the default specified with the
<link linkend="mbox-type">&dollar;mbox&lowbar;type</link> variable. A
short description of the formats follows.
</para>

<para>
<emphasis>mbox</emphasis>.  This is a widely used mailbox format for UNIX.  All
messages are stored in a single file.  Each message has a line of the form:
</para>

<screen>
From me@cs.hmc.edu Fri, 11 Apr 1997 11:44:56 PST
</screen>

<para>
to denote the start of a new message (this is often referred to as the
<quote>From&lowbar;</quote> line). The mbox format requires mailbox
locking, is prone to mailbox corruption with concurrently writing
clients or misinterpreted From&lowbar; lines. Depending on the
environment, new mail detection can be unreliable. Mbox folders are fast
to open and easy to archive.
</para>

<para>
<emphasis>MMDF</emphasis>.  This is a variant of
the <emphasis>mbox</emphasis> format.  Each message is surrounded by
lines containing <quote>&circ;A&circ;A&circ;A&circ;A</quote> (four
control-A's). The same problems as for mbox apply (also with finding the
right message separator as four control-A's may appear in message
bodies).
</para>

<para>
<emphasis>MH</emphasis>. A radical departure from <emphasis>mbox</emphasis> and <emphasis>MMDF</emphasis>, a mailbox
consists of a directory and each message is stored in a separate file.
The filename indicates the message number (however, this is may not
correspond to the message number Mutt displays). Deleted messages are
renamed with a comma (<quote>,</quote>) prepended to the filename. Mutt
detects this type of mailbox by looking for either <literal>.mh&lowbar;sequences</literal>
or <literal>.xmhcache</literal> files (needed to distinguish normal directories from MH
mailboxes). MH is more robust with concurrent clients writing the mailbox,
but still may suffer from lost flags; message corruption is less likely
to occur than with mbox/mmdf. It's usually slower to open compared to
mbox/mmdf since many small files have to be read (Mutt provides
<xref linkend="header-caching"/> to greatly speed this process up).
Depending on the environment, MH is not very disk-space efficient.
</para>

<para>
<emphasis>Maildir</emphasis>.  The newest of the mailbox formats, used by the Qmail MTA (a
replacement for sendmail).  Similar to <emphasis>MH</emphasis>, except that it adds three
subdirectories of the mailbox: <emphasis>tmp</emphasis>, <emphasis>new</emphasis> and <emphasis>cur</emphasis>.  Filenames
for the messages are chosen in such a way they are unique, even when two
programs are writing the mailbox over NFS, which means that no file locking
is needed and corruption is very unlikely. Maildir maybe
slower to open without caching in Mutt, it too is not very
disk-space efficient depending on the environment. Since no additional
files are used for metadata (which is embedded in the message filenames)
and Maildir is locking-free, it's easy to sync across different machines
using file-level synchronization tools.
</para>

</sect1>

<sect1 id="shortcuts">
<title>Mailbox Shortcuts</title>

<para>
There are a number of built in shortcuts which refer to specific mailboxes.
These shortcuts can be used anywhere you are prompted for a file or mailbox
path or in path-related configuration variables. Note that these only
work at the beginning of a string.
</para>

<itemizedlist>
<listitem>

<para>
! &mdash; refers to your <link linkend="spoolfile">&dollar;spoolfile</link> (incoming) mailbox
</para>
</listitem>
<listitem>

<para>
&gt; &mdash; refers to your <link linkend="mbox">&dollar;mbox</link> file
</para>
</listitem>
<listitem>

<para>
&lt; &mdash; refers to your <link linkend="record">&dollar;record</link> file
</para>
</listitem>
<listitem>

<para>
&circ; &mdash; refers to the current mailbox
</para>
</listitem>
<listitem>

<para>
- or !! &mdash; refers to the file you've last visited
</para>
</listitem>
<listitem>

<para>
&tilde; &mdash; refers to your home directory
</para>
</listitem>
<listitem>

<para>
= or + &mdash; refers to your <link linkend="folder">&dollar;folder</link> directory
</para>
</listitem>
<listitem>

<para>
@<emphasis>alias</emphasis> &mdash; refers to the <link linkend="save-hook">default save folder</link> as determined by the address of the alias
</para>
</listitem>

</itemizedlist>

<para>
For example, to store a copy of outgoing messages in the folder they
were composed in,
a <link linkend="folder-hook"><command>folder-hook</command></link> can
be used to set <link linkend="record">&dollar;record</link>:
</para>

<screen>
folder-hook . 'set record=&circ;'</screen>

</sect1>

<sect1 id="using-lists">
<title>Handling Mailing Lists</title>

<para>
Mutt has a few configuration options that make dealing with large
amounts of mail easier.  The first thing you must do is to let Mutt
know what addresses you consider to be mailing lists (technically
this does not have to be a mailing list, but that is what it is most
often used for), and what lists you are subscribed to.  This is
accomplished through the use of the <link linkend="lists"><command>lists</command> and <command>subscribe</command></link> commands in your <literal>.muttrc</literal>.
</para>

<para>
Now that Mutt knows what your mailing lists are, it can do several
things, the first of which is the ability to show the name of a list
through which you received a message (i.e., of a subscribed list) in
the <emphasis>index</emphasis> menu display.  This is useful to distinguish between
personal and list mail in the same mailbox.  In the <link linkend="index-format">&dollar;index&lowbar;format</link> variable, the expando <quote>&percnt;L</quote>
will print the string <quote>To &lt;list&gt;</quote> when <quote>list</quote> appears in the
<quote>To</quote> field, and <quote>Cc &lt;list&gt;</quote> when it appears in the <quote>Cc</quote>
field (otherwise it prints the name of the author).
</para>

<para>
Often times the <quote>To</quote> and <quote>Cc</quote> fields in mailing list messages
tend to get quite large. Most people do not bother to remove the
author of the message they reply to from the list, resulting in
two or more copies being sent to that person.  The <literal>&lt;list-reply&gt;</literal>
function, which by default is bound to <quote>L</quote> in the <emphasis>index</emphasis> menu
and <emphasis>pager</emphasis>, helps reduce the clutter by only replying to the
known mailing list addresses instead of all recipients (except as
specified by <literal>Mail-Followup-To</literal>, see below).
</para>

<para>
Mutt also supports the <literal>Mail-Followup-To</literal> header.  When you send
a message to a list of recipients which includes one or several
subscribed mailing lists, and if the <link linkend="followup-to">&dollar;followup&lowbar;to</link> option is set, Mutt will generate
a Mail-Followup-To header which contains all the recipients to whom
you send this message, but not your address. This indicates that
group-replies or list-replies (also known as <quote>followups</quote>) to this
message should only be sent to the original recipients of the
message, and not separately to you - you'll receive your copy through
one of the mailing lists you are subscribed to.
</para>

<para>
Conversely, when group-replying or list-replying to a message which
has a <literal>Mail-Followup-To</literal> header, Mutt will respect this header if
the <link linkend="honor-followup-to">&dollar;honor&lowbar;followup&lowbar;to</link> configuration
variable is set.  Using <link linkend="list-reply">list-reply</link> will in this case also make sure
that the reply goes to the mailing list, even if it's not specified
in the list of recipients in the <literal>Mail-Followup-To</literal>.
</para>

<note>
<para>
When header editing is enabled, you can create a
<literal>Mail-Followup-To</literal> header manually.  Mutt will only auto-generate
this header if it doesn't exist when you send the message.
</para>
</note>

<para>
The other method some mailing list admins use is to generate a
<quote>Reply-To</quote> field which points back to the mailing list address rather
than the author of the message.  This can create problems when trying
to reply directly to the author in private, since most mail clients
will automatically reply to the address given in the <quote>Reply-To</quote>
field.  Mutt uses the <link linkend="reply-to">&dollar;reply&lowbar;to</link>
variable to help decide which address to use.  If set to <emphasis>ask-yes</emphasis> or
<emphasis>ask-no</emphasis>, you will be
prompted as to whether or not you would like to use the address given in
the <quote>Reply-To</quote> field, or reply directly to the address given in the
<quote>From</quote> field.  When set to <emphasis>yes</emphasis>, the <quote>Reply-To</quote> field will be used when
present.
</para>

<para>
The <quote>X-Label:</quote> header field can be used to further identify mailing
lists or list subject matter (or just to annotate messages
individually).  The <link linkend="index-format">&dollar;index&lowbar;format</link> variable's <quote>&percnt;y</quote> and
<quote>&percnt;Y</quote> expandos can be used to expand <quote>X-Label:</quote> fields in the
index, and Mutt's pattern-matcher can match regular expressions to
<quote>X-Label:</quote> fields with the <quote>&tilde;y</quote> selector.  <quote>X-Label:</quote> is not a
standard message header field, but it can easily be inserted by procmail
and other mail filtering agents.
</para>

<para>
Lastly, Mutt has the ability to <link linkend="sort">sort</link> the mailbox into
<link linkend="threads">threads</link>.  A thread is a group of messages which all relate to the same
subject.  This is usually organized into a tree-like structure where a
message and all of its replies are represented graphically.  If you've ever
used a threaded news client, this is the same concept.  It makes dealing
with large volume mailing lists easier because you can easily delete
uninteresting threads and quickly find topics of value.
</para>

</sect1>

<sect1 id="handling-folders">
<title>Handling multiple folders</title>

<para>
Mutt supports setups with multiple folders, allowing all of them to
be monitored for new mail (see <xref linkend="mailboxes"/> for details).
</para>

<para>
When in the index menu and being idle (also see
<link linkend="timeout">&dollar;timeout</link>), Mutt periodically checks
for new mail in all folders which have been configured via the
<command>mailboxes</command> command. The interval depends on the folder
type: for local/IMAP folders it consults
<link linkend="mail-check">&dollar;mail&lowbar;check</link> and
<link linkend="pop-checkinterval">&dollar;pop&lowbar;checkinterval</link>
for POP folders.
</para>

<para>
Outside the index menu the directory browser supports checking
for new mail using the <literal>&lt;check-new&gt;</literal> function which is
unbound by default. Pressing TAB will bring up a
menu showing the files specified by the <command>mailboxes</command> command,
and indicate which contain new messages. Mutt will automatically enter this
mode when invoked from the command line with the <literal>-y</literal> option.
</para>

<para>
For the pager, index and directory browser menus, Mutt contains the
<literal>&lt;buffy-list&gt;</literal> function (bound to <quote>.</quote> by default)
which will print a list of folders with new mail in the command line at
the bottom of the screen.
</para>

<para>
For the index, by default Mutt displays the number of mailboxes with new
mail in the status bar, please refer to the
<link linkend="status-format">&dollar;status&lowbar;format</link>
variable for details.
</para>

<para>
When changing folders, Mutt fills the prompt with the first folder from
the mailboxes list containing new mail (if any), pressing
<emphasis>space</emphasis> will cycle through folders with new mail.
</para>

</sect1>

<sect1 id="editing-threads">
<title>Editing Threads</title>

<para>
Mutt has the ability to dynamically restructure threads that are broken
either by misconfigured software or bad behavior from some
correspondents. This allows to clean your mailboxes from these
annoyances which make it hard to follow a discussion.
</para>

<sect2 id="link-threads">
<title>Linking Threads</title>

<para>
Some mailers tend to <quote>forget</quote> to correctly set the <quote>In-Reply-To:</quote> and
<quote>References:</quote> headers when replying to a message. This results in broken
discussions because Mutt has not enough information to guess the correct
threading.
You can fix this by tagging the reply, then moving to the parent message
and using the <literal>&lt;link-threads&gt;</literal> function (bound to &amp; by default). The
reply will then be connected to this parent message.
</para>

<para>
You can also connect multiple children at once, tagging them and using the
<literal>&lt;tag-prefix&gt;</literal> command (';') or the <link linkend="auto-tag">&dollar;auto&lowbar;tag</link> option.
</para>

</sect2>

<sect2 id="break-threads">
<title>Breaking Threads</title>

<para>
On mailing lists, some people are in the bad habit of starting a new
discussion by hitting <quote>reply</quote> to any message from the list and changing
the subject to a totally unrelated one.
You can fix such threads by using the <literal>&lt;break-thread&gt;</literal> function (bound
by default to &num;), which will turn the subthread starting from the
current message into a whole different thread.
</para>

</sect2>

</sect1>

<sect1 id="dsn">
<title>Delivery Status Notification (DSN) Support</title>

<para>
RFC1894 defines a set of MIME content types for relaying information
about the status of electronic mail messages.  These can be thought of as
<quote>return receipts.</quote>
</para>

<para>
To support DSN, there are two variables. <link linkend="dsn-notify">&dollar;dsn&lowbar;notify</link> is used to request receipts for
different results (such as failed message, message delivered, etc.).
<link linkend="dsn-return">&dollar;dsn&lowbar;return</link> requests how much
of your message should be returned with the receipt (headers or full
message).
</para>

<para>
When using <link linkend="sendmail">&dollar;sendmail</link> for mail
delivery, you need to use either Berkeley sendmail 8.8.x (or greater) a MTA
supporting DSN command line options compatible to Sendmail: The -N and -R
options can be used by the mail client to make requests as to what type of
status messages should be returned. Please consider your MTA documentation
whether DSN is supported.
</para>

<para>
For SMTP delivery using <link
  linkend="smtp-url">&dollar;smtp&lowbar;url</link>, it depends on the
capabilities announced by the server whether Mutt will attempt to
request DSN or not.
</para>

</sect1>

<sect1 id="urlview">
<title>Start a WWW Browser on URLs</title>

<para>
If a message contains URLs, it is efficient to get
a menu with all the URLs and start a WWW browser on one of them.  This
functionality is provided by the external urlview program which can be
retrieved at
<ulink url="ftp://ftp.mutt.org/mutt/contrib/">ftp://ftp.mutt.org/mutt/contrib/</ulink>
and the configuration commands:
</para>

<screen>
macro index \cb |urlview\n
macro pager \cb |urlview\n
</screen>

</sect1>

<sect1 id="misc-topics">
<title>Miscellany</title>

<para>
This section documents various features that fit nowhere else.
</para>

<variablelist>
<varlistentry>
<term>
Address normalization
</term>
<listitem>
<para>
Mutt normalizes all e-mail addresses to the simplest form possible. If
an address contains a realname, the form
<emphasis>Joe User &lt;joe@example.com&gt;</emphasis> is used and the
pure e-mail address without angle brackets otherwise, i.e. just
<emphasis>joe@example.com</emphasis>.
</para>
<para>
This normalization affects all headers Mutt generates including aliases.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
Initial folder selection
</term>
<listitem>
<para>
The folder Mutt opens at startup is determined as follows: the folder
specified in the <literal>&dollar;MAIL</literal> environment variable if
present. Otherwise, the value of <literal>&dollar;MAILDIR</literal> is taken
into account. If that isn't present either, Mutt takes the user's
mailbox in the mailspool as determined at compile-time (which may also
reside in the home directory). The
<link linkend="spoolfile">&dollar;spoolfile</link> setting overrides
this selection. Highest priority has the mailbox given with the
<literal>-f</literal> command line option.
</para>
</listitem>
</varlistentry>
</variablelist>

</sect1>

</chapter>

<chapter id="mimesupport">
<title>Mutt's MIME Support</title>

<para>
Quite a bit of effort has been made to make Mutt the premier text-mode
MIME MUA.  Every effort has been made to provide the functionality that
the discerning MIME user requires, and the conformance to the standards
wherever possible.  When configuring Mutt for MIME, there are two extra
types of configuration files which Mutt uses.  One is the
<literal>mime.types</literal> file, which contains the mapping of file extensions to
IANA MIME types.  The other is the <literal>mailcap</literal> file, which specifies
the external commands to use for handling specific MIME types.
</para>

<sect1 id="using-mime">
<title>Using MIME in Mutt</title>

<para>
There are three areas/menus in Mutt which deal with MIME, they are the
pager (while viewing a message), the attachment menu and the compose
menu.
</para>

<sect2 id="mime-pager">
<title>Viewing MIME Messages in the Pager</title>

<para>
When you select a message from the index and view it in the pager, Mutt
decodes the message to a text representation.  Mutt internally supports
a number of MIME types, including <literal>text/plain, text/enriched,
message/rfc822, and message/news</literal>.  In addition, the export
controlled version of Mutt recognizes a variety of PGP MIME types,
including PGP/MIME and application/pgp.
</para>

<para>
Mutt will denote attachments with a couple lines describing them.
These lines are of the form:
</para>

<screen>
[-- Attachment #1: Description --]
[-- Type: text/plain, Encoding: 7bit, Size: 10000 --]
</screen>

<para>
Where the <literal>Description</literal> is the description or filename given for the
attachment, and the <literal>Encoding</literal> is one of
<literal>7bit/8bit/quoted-printable/base64/binary</literal>.
</para>

<para>
If Mutt cannot deal with a MIME type, it will display a message like:
</para>

<screen>
[-- image/gif is unsupported (use 'v' to view this part) --]
</screen>

</sect2>

<sect2 id="attach-menu">
<title>The Attachment Menu</title>

<para>
The default binding for <literal>&lt;view-attachments&gt;</literal> is <quote>v</quote>, which displays the
attachment menu for a message.  The attachment menu displays a list of
the attachments in a message.  From the attachment menu, you can save,
print, pipe, delete, and view attachments.  You can apply these
operations to a group of attachments at once, by tagging the attachments
and by using the <literal>&lt;tag-prefix&gt;</literal> operator.  You can also reply to the
current message from this menu, and only the current attachment (or the
attachments tagged) will be quoted in your reply.  You can view
attachments as text, or view them using the mailcap viewer definition.
</para>

<para>
Finally, you can apply the usual message-related functions (like
<link linkend="resend-message"><literal>&lt;resend-message&gt;</literal></link>, and the
<literal>&lt;reply&gt;</literal> and <literal>&lt;forward&gt;</literal>
functions) to attachments of type <literal>message/rfc822</literal>.
</para>

<para>
See the help on the attachment menu for more information.
</para>

</sect2>

<sect2 id="compose-menu">
<title>The Compose Menu</title>

<para>
The compose menu is the menu you see before you send a message.  It
allows you to edit the recipient list, the subject, and other aspects
of your message.  It also contains a list of the attachments of your
message, including the main body.  From this menu, you can print, copy,
filter, pipe, edit, compose, review, and rename an attachment or a
list of tagged attachments.  You can also modifying the attachment
information, notably the type, encoding and description.
</para>

<para>
Attachments appear as follows:
</para>

<screen>
- 1 [text/plain, 7bit, 1K]           /tmp/mutt-euler-8082-0 &lt;no description&gt;
  2 [applica/x-gunzip, base64, 422K] ~/src/mutt-0.85.tar.gz &lt;no description&gt;
</screen>

<para>
The '-' denotes that Mutt will delete the file after sending (or
postponing, or canceling) the message.  It can be toggled with the
<literal>&lt;toggle-unlink&gt;</literal> command (default: u).  The next field is the MIME
content-type, and can be changed with the <literal>&lt;edit-type&gt;</literal> command
(default: &circ;T).  The next field is the encoding for the attachment,
which allows a binary message to be encoded for transmission on 7bit
links.  It can be changed with the <literal>&lt;edit-encoding&gt;</literal> command
(default: &circ;E).  The next field is the size of the attachment,
rounded to kilobytes or megabytes.  The next field is the filename,
which can be changed with the <literal>&lt;rename-file&gt;</literal> command (default: R).
The final field is the description of the attachment, and can be
changed with the <literal>&lt;edit-description&gt;</literal> command (default: d).
</para>

</sect2>

</sect1>

<sect1 id="mime-types">
<title>MIME Type Configuration with <literal>mime.types</literal></title>

<para>
When you add an attachment to your mail message, Mutt searches your
personal <literal>mime.types</literal> file at <literal>&dollar;&lcub;HOME&rcub;/.mime.types</literal>, and then
the system <literal>mime.types</literal> file at <literal>/usr/local/share/mutt/mime.types</literal> or
<literal>/etc/mime.types</literal>
</para>

<para>
The <literal>mime.types</literal> file consist of lines containing a MIME type and a space
separated list of extensions.  For example:
</para>

<screen>
application/postscript          ps eps
application/pgp                 pgp
audio/x-aiff                    aif aifc aiff
</screen>

<para>
A sample <literal>mime.types</literal> file comes with the Mutt distribution, and
should contain most of the MIME types you are likely to use.
</para>

<para>
If Mutt can not determine the mime type by the extension of the file you
attach, it will look at the file.  If the file is free of binary
information, Mutt will assume that the file is plain text, and mark it
as <literal>text/plain</literal>.  If the file contains binary information, then Mutt will
mark it as <literal>application/octet-stream</literal>.  You can change the MIME
type that Mutt assigns to an attachment by using the <literal>&lt;edit-type&gt;</literal>
command from the compose menu (default: &circ;T). The MIME type is actually a
major mime type followed by the sub-type, separated by a '/'. 6 major
types: application, text, image, video, audio, and model have been approved
after various internet discussions. Mutt recognizes all of these if the
appropriate entry is found in the <literal>mime.types</literal> file. It also recognizes other
major mime types, such as the chemical type that is widely used in the
molecular modeling community to pass molecular data in various forms to
various molecular viewers. Non-recognized mime types should only be used
if the recipient of the message is likely to be expecting such attachments.
</para>

</sect1>

<sect1 id="mailcap">
<title>MIME Viewer Configuration with Mailcap</title>

<para>
Mutt supports RFC 1524 MIME Configuration, in particular the Unix
specific format specified in Appendix A of RFC 1524.  This file format
is commonly referred to as the mailcap format.  Many MIME compliant
programs utilize the mailcap format, allowing you to specify handling
for all MIME types in one place for all programs.  Programs known to
use this format include Firefox, lynx and metamail.
</para>

<para>
In order to handle various MIME types that Mutt can not handle
internally, Mutt parses a series of external configuration files to
find an external handler. The default search string for these files
is a colon delimited list containing the following files:
</para>

<orderedlist>
<listitem><para><literal>&dollar;HOME/.mailcap</literal></para></listitem>
<listitem><para><literal>&dollar;PKGDATADIR/mailcap</literal></para></listitem>
<listitem><para><literal>&dollar;SYSCONFDIR/mailcap</literal></para></listitem>
<listitem><para><literal>/etc/mailcap</literal></para></listitem>
<listitem><para><literal>/usr/etc/mailcap</literal></para></listitem>
<listitem><para><literal>/usr/local/etc/mailcap</literal></para></listitem>
</orderedlist>

<para>
where <literal>&dollar;HOME</literal> is your home directory. The
<literal>&dollar;PKGDATADIR</literal> and the
<literal>&dollar;SYSCONFDIR</literal> directories depend on where Mutt
is installed: the former is the default for shared data, the
latter for system configuration files.
</para>

<para>
The default search path can be obtained by running the following
command:
</para>

<screen>
mutt -nF /dev/null -Q mailcap_path
</screen>

<para>
In particular, the metamail distribution will install a mailcap file,
usually as <literal>/usr/local/etc/mailcap</literal>, which contains some baseline
entries.
</para>

<sect2 id="mailcap-basics">
<title>The Basics of the Mailcap File</title>

<para>
A mailcap file consists of a series of lines which are comments, blank,
or definitions.
</para>

<para>
A comment line consists of a &num; character followed by anything you want.
</para>

<para>
A blank line is blank.
</para>

<para>
A definition line consists of a content type, a view command, and any
number of optional fields.  Each field of a definition line is divided
by a semicolon ';' character.
</para>

<para>
The content type is specified in the MIME standard type/subtype method.
For example,
<literal>text/plain, text/html, image/gif, </literal>
etc.  In addition, the mailcap format includes two formats for
wildcards, one using the special '*' subtype, the other is the implicit
wild, where you only include the major type.  For example, <literal>image/*</literal>, or
<literal>video,</literal> will match all image types and video types,
respectively.
</para>

<para>
The view command is a Unix command for viewing the type specified. There
are two different types of commands supported. The default is to send
the body of the MIME message to the command on stdin. You can change
this behavior by using &percnt;s as a parameter to your view command.
This will cause Mutt to save the body of the MIME message to a temporary
file, and then call the view command with the &percnt;s replaced by
the name of the temporary file. In both cases, Mutt will turn over the
terminal to the view program until the program quits, at which time Mutt
will remove the temporary file if it exists.
</para>

<para>
So, in the simplest form, you can send a text/plain message to the
external pager more on stdin:
</para>

<screen>
text/plain; more
</screen>

<para>
Or, you could send the message as a file:
</para>

<screen>
text/plain; more %s
</screen>

<para>
Perhaps you would like to use lynx to interactively view a text/html
message:
</para>

<screen>
text/html; lynx %s
</screen>

<para>
In this case, lynx does not support viewing a file from stdin, so you
must use the &percnt;s syntax.
</para>

<note>
<para>
<emphasis>Some older versions of lynx contain a bug where they
will check the mailcap file for a viewer for text/html.  They will find
the line which calls lynx, and run it.  This causes lynx to continuously
spawn itself to view the object.</emphasis>
</para>
</note>

<para>
On the other hand, maybe you don't want to use lynx interactively, you
just want to have it convert the text/html to text/plain, then you can
use:
</para>

<screen>
text/html; lynx -dump %s | more
</screen>

<para>
Perhaps you wish to use lynx to view text/html files, and a pager on
all other text formats, then you would use the following:
</para>

<screen>
text/html; lynx %s
text/*; more
</screen>

<para>
This is the simplest form of a mailcap file.
</para>

</sect2>

<sect2 id="secure-mailcap">
<title>Secure Use of Mailcap</title>

<para>
The interpretation of shell meta-characters embedded in MIME parameters
can lead to security problems in general.  Mutt tries to quote parameters
in expansion of &percnt;s syntaxes properly, and avoids risky characters by
substituting them, see the <link linkend="mailcap-sanitize">&dollar;mailcap&lowbar;sanitize</link> variable.
</para>

<para>
Although Mutt's procedures to invoke programs with mailcap seem to be
safe, there are other applications parsing mailcap, maybe taking less care
of it.  Therefore you should pay attention to the following rules:
</para>

<para>
<emphasis>Keep the &percnt;-expandos away from shell quoting.</emphasis>
Don't quote them with single or double quotes.  Mutt does this for
you, the right way, as should any other program which interprets
mailcap.  Don't put them into backtick expansions.  Be highly careful
with eval statements, and avoid them if possible at all.  Trying to fix
broken behavior with quotes introduces new leaks - there is no
alternative to correct quoting in the first place.
</para>

<para>
If you have to use the &percnt;-expandos' values in context where you need
quoting or backtick expansions, put that value into a shell variable
and reference the shell variable where necessary, as in the following
example (using <literal>&dollar;charset</literal> inside the backtick expansion is safe,
since it is not itself subject to any further expansion):
</para>

<screen>
text/test-mailcap-bug; cat %s; copiousoutput; test=charset=%{charset} &bsol;
        &amp;&amp; test "`echo $charset | tr '[A-Z]' '[a-z]'`" != iso-8859-1
</screen>

</sect2>

<sect2 id="advanced-mailcap">
<title>Advanced Mailcap Usage</title>

<sect3 id="optional-mailcap-fields">
<title>Optional Fields</title>

<para>
In addition to the required content-type and view command fields, you
can add semi-colon ';' separated fields to set flags and other options.
Mutt recognizes the following optional fields:
</para>

<variablelist>

<varlistentry>
<term>copiousoutput</term>
<listitem>
<para>
This flag tells Mutt that the command passes possibly large amounts of
text on stdout.  This causes Mutt to invoke a pager (either the internal
pager or the external pager defined by the pager variable) on the output
of the view command.  Without this flag, Mutt assumes that the command
is interactive.  One could use this to replace the pipe to <literal>more</literal>
in the <literal>lynx -dump</literal> example in the Basic section:
</para>

<screen>
text/html; lynx -dump %s ; copiousoutput
</screen>

<para>
This will cause lynx to format the text/html output as text/plain
and Mutt will use your standard pager to display the results.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>needsterminal</term>
<listitem>
<para>
Mutt uses this flag when viewing attachments with <link linkend="auto-view"><command>auto&lowbar;view</command></link>, in order to decide whether it should honor the setting
of the <link linkend="wait-key">&dollar;wait&lowbar;key</link> variable or
not.  When an attachment is viewed using an interactive program, and the
corresponding mailcap entry has a <emphasis>needsterminal</emphasis> flag, Mutt will use
<link linkend="wait-key">&dollar;wait&lowbar;key</link> and the exit status
of the program to decide if it will ask you to press a key after the
external program has exited.  In all other situations it will not prompt
you for a key.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>compose=&lt;command&gt;</term>
<listitem>
<para>
This flag specifies the command to use to create a new attachment of a
specific MIME type.  Mutt supports this from the compose menu.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>composetyped=&lt;command&gt;</term>
<listitem>
<para>
This flag specifies the command to use to create a new attachment of a
specific MIME type.  This command differs from the compose command in
that Mutt will expect standard MIME headers on the data.  This can be
used to specify parameters, filename, description, etc. for a new
attachment.   Mutt supports this from the compose menu.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>print=&lt;command&gt;</term>
<listitem>
<para>
This flag specifies the command to use to print a specific MIME type.
Mutt supports this from the attachment and compose menus.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>edit=&lt;command&gt;</term>
<listitem>
<para>
This flag specifies the command to use to edit a specific MIME type.
Mutt supports this from the compose menu, and also uses it to compose
new attachments.  Mutt will default to the defined editor for text
attachments.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>nametemplate=&lt;template&gt;</term>
<listitem>
<para>
This field specifies the format for the file denoted by &percnt;s in the
command fields.  Certain programs will require a certain file extension,
for instance, to correctly view a file.  For instance, lynx will only
interpret a file as <literal>text/html</literal> if the file ends in <literal>.html</literal>.
So, you would specify lynx as a <literal>text/html</literal> viewer with a line in
the mailcap file like:
</para>

<screen>
text/html; lynx %s; nametemplate=%s.html
</screen>

</listitem>
</varlistentry>
<varlistentry>
<term>test=&lt;command&gt;</term>
<listitem>
<para>
This field specifies a command to run to test whether this mailcap
entry should be used.  The command is defined with the command expansion
rules defined in the next section.  If the command returns 0, then the
test passed, and Mutt uses this entry.  If the command returns non-zero,
then the test failed, and Mutt continues searching for the right entry.
Note that the content-type must match before Mutt performs the test.
For example:
</para>

<screen>
text/html; firefox -remote 'openURL(%s)' ; test=RunningX
text/html; lynx %s
</screen>

<para>
In this example, Mutt will run the program RunningX which will return 0
if the X Window manager is running, and non-zero if it isn't.  If
RunningX returns 0, then Mutt will call firefox to display the
<literal>text/html</literal> object.  If RunningX doesn't return 0, then Mutt will go on
to the next entry and use lynx to display the <literal>text/html</literal> object.
</para>
</listitem>
</varlistentry>
</variablelist>

</sect3>

<sect3 id="mailcap-search-order">
<title>Search Order</title>

<para>
When searching for an entry in the mailcap file, Mutt will search for
the most useful entry for its purpose.  For instance, if you are
attempting to print an <literal>image/gif</literal>, and you have the following
entries in your mailcap file, Mutt will search for an entry with the
print command:
</para>

<screen>
image/*;        xv %s
image/gif;      ; print= anytopnm %s | pnmtops | lpr; &bsol;
                nametemplate=%s.gif
</screen>

<para>
Mutt will skip the <literal>image/*</literal> entry and use the <literal>image/gif</literal>
entry with the print command.
</para>

<para>
In addition, you can use this with <link linkend="auto-view"><command>auto&lowbar;view</command></link>
to denote two commands for viewing an attachment, one to be viewed
automatically, the other to be viewed interactively from the attachment
menu.  In addition, you can then use the test feature to determine which
viewer to use interactively depending on your environment.
</para>

<screen>
text/html;      firefox -remote 'openURL(%s)' ; test=RunningX
text/html;      lynx %s; nametemplate=%s.html
text/html;      lynx -dump %s; nametemplate=%s.html; copiousoutput
</screen>

<para>
For <link linkend="auto-view"><command>auto&lowbar;view</command></link>, Mutt will choose the third
entry because of the copiousoutput tag.  For interactive viewing, Mutt
will run the program RunningX to determine if it should use the first
entry.  If the program returns non-zero, Mutt will use the second entry
for interactive viewing.
</para>

</sect3>

<sect3 id="mailcap-command-expansion">
<title>Command Expansion</title>

<para>
The various commands defined in the mailcap files are passed to the
<literal>/bin/sh</literal> shell using the <literal>system(3)</literal> function.  Before the
command is passed to <literal>/bin/sh -c</literal>, it is parsed to expand
various special parameters with information from Mutt.  The keywords
Mutt expands are:
</para>

<variablelist>

<varlistentry>
<term>&percnt;s</term>
<listitem>
<para>
As seen in the basic mailcap section, this variable is expanded
to a filename specified by the calling program.  This file contains
the body of the message to view/print/edit or where the composing
program should place the results of composition.  In addition, the
use of this keyword causes Mutt to not pass the body of the message
to the view/print/edit program on stdin.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>&percnt;t</term>
<listitem>
<para>
Mutt will expand &percnt;t to the text representation of the content
type of the message in the same form as the first parameter of the
mailcap definition line, ie <literal>text/html</literal> or
<literal>image/gif</literal>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>&percnt;&lcub;&lt;parameter&gt;&rcub;</term>
<listitem>
<para>
Mutt will expand this to the value of the specified parameter
from the Content-Type: line of the mail message.  For instance, if
Your mail message contains:
</para>

<screen>
Content-Type: text/plain; charset=iso-8859-1
</screen>

<para>
then Mutt will expand &percnt;&lcub;charset&rcub; to iso-8859-1.  The default metamail
mailcap file uses this feature to test the charset to spawn an xterm
using the right charset to view the message.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>&bsol;&percnt;</term>
<listitem>
<para>
This will be replaced by a &percnt;
</para>
</listitem>
</varlistentry>
</variablelist>

<para>
Mutt does not currently support the &percnt;F and &percnt;n keywords
specified in RFC 1524.  The main purpose of these parameters is for
multipart messages, which is handled internally by Mutt.
</para>

</sect3>

</sect2>

<sect2 id="mailcap-example">
<title>Example Mailcap Files</title>

<para>
This mailcap file is fairly simple and standard:
</para>

<screen>
# I'm always running X :)
video/*;        xanim %s &gt; /dev/null
image/*;        xv %s &gt; /dev/null

# I'm always running firefox (if my computer had more memory, maybe)
text/html;      firefox -remote 'openURL(%s)'
</screen>

<para>
This mailcap file shows quite a number of examples:
</para>

<screen>
# Use xanim to view all videos   Xanim produces a header on startup,
# send that to /dev/null so I don't see it
video/*;        xanim %s &gt; /dev/null

# Send html to a running firefox by remote
text/html;      firefox -remote 'openURL(%s)'; test=RunningFirefox

# If I'm not running firefox but I am running X, start firefox on the
# object
text/html;      firefox %s; test=RunningX

# Else use lynx to view it as text
text/html;      lynx %s

# This version would convert the text/html to text/plain
text/html;      lynx -dump %s; copiousoutput

# I use enscript to print text in two columns to a page
text/*;         more %s; print=enscript -2Gr %s

# Firefox adds a flag to tell itself to view jpegs internally
image/jpeg;xv %s; x-mozilla-flags=internal

# Use xv to view images if I'm running X
# In addition, this uses the \ to extend the line and set my editor
# for images
image/*;xv %s; test=RunningX; &bsol;
        edit=xpaint %s

# Convert images to text using the netpbm tools
image/*;  (anytopnm %s | pnmscale -xysize 80 46 | ppmtopgm | pgmtopbm |
pbmtoascii -1x2 ) 2&gt;&amp;1 ; copiousoutput

# Send excel spreadsheets to my NT box
application/ms-excel; open.pl %s
</screen>

</sect2>

</sect1>

<sect1 id="auto-view">
<title>MIME Autoview</title>

<para>
Usage:
</para>

<cmdsynopsis>
<command>auto-view</command>
<arg choice="plain">
<replaceable>mimetype</replaceable>
</arg>
<arg choice="opt" rep="repeat">
<replaceable>mimetype</replaceable>
</arg>

<command>unauto-view</command>
<group choice="req">
<arg choice="plain">
<replaceable>*</replaceable>
</arg>
<arg choice="plain" rep="repeat">
<replaceable>mimetype</replaceable>
</arg>
</group>
</cmdsynopsis>

<para>
In addition to explicitly telling Mutt to view an attachment with the
MIME viewer defined in the mailcap file, Mutt has support for
automatically viewing MIME attachments while in the pager.
</para>

<para>
To work, you must define a viewer in the mailcap file which uses the
<literal>copiousoutput</literal> option to denote that it is non-interactive.
Usually, you also use the entry to convert the attachment to a text
representation which you can view in the pager.
</para>

<para>
You then use the <command>auto&lowbar;view</command> <literal>.muttrc</literal> command to list the
content-types that you wish to view automatically.  For instance, if you
set it to:
</para>

<screen>
auto_view text/html application/x-gunzip &bsol;
  application/postscript image/gif application/x-tar-gz
</screen>

<para>
Mutt could use the following mailcap entries to automatically view
attachments of these types.
</para>

<screen>
text/html;      lynx -dump %s; copiousoutput; nametemplate=%s.html
image/*;        anytopnm %s | pnmscale -xsize 80 -ysize 50 | ppmtopgm | &bsol;
                pgmtopbm | pbmtoascii ; copiousoutput
application/x-gunzip;   gzcat; copiousoutput
application/x-tar-gz; gunzip -c %s | tar -tf - ; copiousoutput
application/postscript; ps2ascii %s; copiousoutput
</screen>

<para>
<command>unauto&lowbar;view</command> can be used to remove previous entries from the autoview list.
This can be used with <link linkend="message-hook"><command>message-hook</command></link> to autoview messages based on size, etc.
<quote><command>unauto&lowbar;view</command> *</quote> will remove all previous entries.
</para>

</sect1>

<sect1 id="alternative-order">
<title>MIME Multipart/Alternative</title>

<para>
Mutt has some heuristics for determining which attachment of a
<literal>multipart/alternative</literal> type to display.  First, Mutt will check the
<command>alternative&lowbar;order</command> list
to determine if one of the available types is preferred.  It consists of
a number of mimetypes in order, including support for implicit and
explicit wildcards, for example:
</para>

<screen>
alternative_order text/enriched text/plain text application/postscript image/*
</screen>

<para>
Next, Mutt will check if any of the types have a defined
<link linkend="auto-view"><command>auto&lowbar;view</command></link>, and use that.  Failing
that, Mutt will look for any text type.  As a last attempt, Mutt will
look for any type it knows how to handle.
</para>

<para>
To remove a MIME type from the <command>alternative&lowbar;order</command> list, use the
<command>unalternative&lowbar;order</command> command.
</para>

</sect1>

<sect1 id="attachments">
<title>Attachment Searching and Counting</title>

<para>
If you ever lose track of attachments in your mailboxes, Mutt's
attachment-counting and -searching support might be for you.  You can
make your message index display the number of qualifying attachments in
each message, or search for messages by attachment count.  You also can
configure what kinds of attachments qualify for this feature with the
<command>attachments</command> and <command>unattachments</command> commands.
</para>

<para>
In order to provide this information, Mutt needs to fully MIME-parse
all messages affected first. This can slow down operation especially for
remote mail folders such as IMAP because all messages have to be
downloaded first regardless whether the user really wants to view them
or not.
</para>

<para>
The syntax is:
</para>

<cmdsynopsis>
<command>attachments</command>
<arg choice="plain">
<replaceable>&lcub; + &verbar; - &rcub;disposition</replaceable>
</arg>
<arg choice="plain">
<replaceable>mime-type</replaceable>
</arg>

<command>unattachments</command>
<arg choice="plain">
<replaceable>&lcub; + &verbar; - &rcub;disposition</replaceable>
</arg>
<arg choice="plain">
<replaceable>mime-type</replaceable>
</arg>

<command>attachments</command>
<arg choice="plain">
<replaceable>?</replaceable>
</arg>
</cmdsynopsis>

<para>
<emphasis>disposition</emphasis> is the attachment's Content-Disposition type &mdash; either
<literal>inline</literal> or <literal>attachment</literal>.
You can abbreviate this to <literal>I</literal> or <literal>A</literal>.
</para>

<para>
Disposition is prefixed by either a + symbol or a - symbol.  If it's
a +, you're saying that you want to allow this disposition and MIME
type to qualify.  If it's a -, you're saying that this disposition
and MIME type is an exception to previous + rules.  There are examples
below of how this is useful.
</para>

<para>
<emphasis>mime-type</emphasis> is, unsurprisingly, the MIME type of the attachment you want
to affect.  A MIME type is always of the format <literal>major/minor</literal>, where
<literal>major</literal> describes the broad category of document you're looking at, and
<literal>minor</literal> describes the specific type within that category.  The major
part of mime-type must be literal text (or the special token <quote><literal>*</literal></quote>), but
the minor part may be a regular expression.  (Therefore, <quote><literal>*/.*</literal></quote> matches
any MIME type.)
</para>

<para>
The MIME types you give to the <command>attachments</command> directive are a kind of
pattern.  When you use the <command>attachments</command> directive, the patterns you
specify are added to a list.  When you use <command>unattachments</command>, the pattern
is removed from the list.  The patterns are not expanded and matched
to specific MIME types at this time &mdash; they're just text in a list.
They're only matched when actually evaluating a message.
</para>

<para>
Some examples might help to illustrate.  The examples that are not
commented out define the default configuration of the lists.
</para>

<example id="ex-attach-count">
<title>Attachment counting</title>
<screen>
## Removing a pattern from a list removes that pattern literally. It
## does not remove any type matching the pattern.
##
##  attachments   +A */.*
##  attachments   +A image/jpeg
##  unattachments +A */.*
##
## This leaves "attached" image/jpeg files on the allowed attachments
## list. It does not remove all items, as you might expect, because the
## second */.* is not a matching expression at this time.
##
## Remember: "unattachments" only undoes what "attachments" has done!
## It does not trigger any matching on actual messages.


## Qualify any MIME part with an "attachment" disposition, EXCEPT for
## text/x-vcard and application/pgp parts. (PGP parts are already known
## to mutt, and can be searched for with ~g, ~G, and ~k.)
##
## I've added x-pkcs7 to this, since it functions (for S/MIME)
## analogously to PGP signature attachments. S/MIME isn't supported
## in a stock mutt build, but we can still treat it specially here.
##
attachments   +A */.*
attachments   -A text/x-vcard application/pgp.*
attachments   -A application/x-pkcs7-.*

## Discount all MIME parts with an "inline" disposition, unless they're
## text/plain. (Why inline a text/plain part unless it's external to the
## message flow?)
##
attachments   +I text/plain

## These two lines make Mutt qualify MIME containers.  (So, for example,
## a message/rfc822 forward will count as an attachment.)  The first
## line is unnecessary if you already have "attach-allow */.*", of
## course.  These are off by default!  The MIME elements contained
## within a message/* or multipart/* are still examined, even if the
## containers themseves don't qualify.
##
#attachments  +A message/.* multipart/.*
#attachments  +I message/.* multipart/.*

## You probably don't really care to know about deleted attachments.
attachments   -A message/external-body
attachments   -I message/external-body
</screen>
</example>

<para>
Entering the command <quote><command>attachments</command> ?</quote>
as a command will list your current settings in Muttrc format, so that
it can be pasted elsewhere.
</para>

</sect1>

<sect1 id="mime-lookup">
<title>MIME Lookup</title>

<para>
Usage:
</para>

<cmdsynopsis>
<command>mime-lookup</command>
<arg choice="plain">
<replaceable>mimetype</replaceable>
</arg>
<arg choice="opt" rep="repeat">
<replaceable>mimetype</replaceable>
</arg>

<command>unmime-lookup</command>
<group choice="req">
<arg choice="plain">
<replaceable>*</replaceable>
</arg>
<arg choice="plain" rep="repeat">
<replaceable>mimetype</replaceable>
</arg>
</group>
</cmdsynopsis>

<para>
Mutt's mime&lowbar;lookup list specifies a list of mime-types that should not
be treated according to their mailcap entry.  This option is designed to
deal with binary types such as <literal>application/octet-stream</literal>.  When an attachment's
mime-type is listed in mime&lowbar;lookup, then the extension of the filename will
be compared to the list of extensions in the <literal>mime.types</literal> file.  The mime-type
associated with this extension will then be used to process the attachment
according to the rules in the mailcap file and according to any other configuration
options (such as <command>auto&lowbar;view</command>) specified.  Common usage would be:
</para>

<screen>
mime_lookup application/octet-stream application/X-Lotus-Manuscript
</screen>

<para>
In addition, the <literal>unmime&lowbar;lookup</literal> command may be
used to disable this feature for any particular mime-type if it had been
set, for example, in a global <literal>.muttrc</literal>.
</para>

</sect1>

</chapter>

<chapter id="optionalfeatures">
<title>Optional Features</title>

<sect1 id="optionalfeatures-notes">
<title>General Notes</title>

<sect2 id="compile-time-features">
<title>Enabling/Disabling Features</title>

<para>
Mutt supports several of optional features which can be enabled or
disabled at compile-time by giving the <emphasis>configure</emphasis> script
certain arguments. These are listed in the <quote>Optional features</quote> section of
the <emphasis>configure --help</emphasis> output.
</para>

<para>
Which features are enabled or disabled can later be determined from the
output of <literal>mutt -v</literal>. If a compile option starts with
<quote>+</quote> it is enabled and disabled if prefixed with <quote>-</quote>. For example, if
Mutt was compiled using GnuTLS for encrypted communication instead of
OpenSSL, <literal>mutt -v</literal> would contain:
</para>

<screen>
-USE_SSL_OPENSSL +USE_SSL_GNUTLS</screen>

</sect2>

<sect2 id="url-syntax">
<title>URL Syntax</title>

<para>
Mutt optionally supports the IMAP, POP3 and SMTP protocols which require
to access servers using URLs. The canonical syntax for specifying URLs
in Mutt is (an item enclosed in <literal>[]</literal> means it is optional and
may be omitted):
</para>

<screen>
proto[s]://[username[:password]@]server[:port]/[path]
</screen>

<para>
<emphasis>proto</emphasis> is the communication protocol:
<literal>imap</literal> for IMAP, <literal>pop</literal> for POP3 and
<literal>smtp</literal> for SMTP. If <quote>s</quote> for <quote>secure
communication</quote> is appended, Mutt will attempt to establish an
encrypted communication using SSL or TLS.
</para>

<para>
Since all protocols supported by Mutt support/require authentication,
login credentials may be specified in the URL. This has the advantage
that multiple IMAP, POP3 or SMTP servers may be specified (which isn't
possible using, for example,
<link linkend="imap-user">&dollar;imap&lowbar;user</link>). The username
may contain the <quote>@</quote> symbol being used by many mail systems
as part of the login name. A password can be given, too but is not
recommended if the URL is specified in a configuration file on disk.
</para>

<para>
If no port number is given, Mutt will use the system's default for the
given protocol (usually consulting <literal>/etc/services</literal>).
</para>

<para>
The optional path is only relevant for IMAP.
</para>

<example id="ex-url">
<title>URLs</title>
<screen>
pops://host/
imaps://user@host/INBOX/Sent
smtp://user@host:587/
</screen>
</example>

</sect2>

</sect1>

<sect1 id="ssl">
<title>SSL/TLS Support</title>

<para>
If Mutt is compiled with IMAP, POP3 and/or SMTP support, it can also be
compiled with support for SSL or TLS using either OpenSSL or GnuTLS (
by running the <emphasis>configure</emphasis> script with the
<emphasis>--enable-ssl=...</emphasis> option for OpenSSL or
<emphasis>--enable-gnutls=...</emphasis> for GnuTLS). Mutt can then
attempt to encrypt communication with remote servers if these protocols
are suffixed with <quote>s</quote> for <quote>secure communication</quote>.
</para>

</sect1>

<sect1 id="pop">
<title>POP3 Support</title>

<para>
If Mutt is compiled with POP3 support (by running the <emphasis>configure</emphasis>
script with the <emphasis>--enable-pop</emphasis> flag), it has the ability to work
with mailboxes located on a remote POP3 server and fetch mail for local
browsing.
</para>

<para>
Remote POP3 servers can be accessed using URLs with the <literal>pop</literal> protocol
for unencrypted and <literal>pops</literal> for encrypted
communication, see <xref linkend="url-syntax"/> for details.
</para>

<para>
Polling for new mail is more expensive over POP3 than locally. For this
reason the frequency at which Mutt will check for mail remotely can be
controlled by the
<link linkend="pop-checkinterval">&dollar;pop&lowbar;checkinterval</link>
variable, which defaults to every 60 seconds.
</para>

<para>
POP is read-only which doesn't allow for some features like editing
messages or changing flags. However, using
<xref linkend="header-caching"/> and <xref linkend="body-caching"/>
Mutt simulates the new/old/read flags as well as flagged and replied.
Mutt applies some logic on top of remote messages but cannot change
them so that modifications of flags are lost when
messages are downloaded from the POP server (either by Mutt or other
tools).
</para>

<anchor id="fetch-mail"/>
<para>
Another way to access your POP3 mail is the <literal>&lt;fetch-mail&gt;</literal> function
(default: G).  It allows to connect to <link linkend="pop-host">&dollar;pop&lowbar;host</link>, fetch all your new mail and place it in the
local <link linkend="spoolfile">&dollar;spoolfile</link>.  After this
point, Mutt runs exactly as if the mail had always been local.
</para>

<note>
<para>
If you only need to fetch all messages to a
local mailbox you should consider using a specialized program, such as
<literal>fetchmail(1)</literal>, <literal>getmail(1)</literal> or similar.
</para>
</note>

</sect1>

<sect1 id="imap">
<title>IMAP Support</title>

<para>
If Mutt was compiled with IMAP support (by running the <emphasis>configure</emphasis>
script with the <emphasis>--enable-imap</emphasis> flag), it has the ability to work
with folders located on a remote IMAP server.
</para>

<para>
You can access the remote inbox by selecting the folder by its URL
(see <xref linkend="url-syntax"/> for details) using the
<literal>imap</literal> or <literal>imaps</literal> protocol.
Alternatively, a pine-compatible notation is also supported, ie
<literal>&lcub;[username@]imapserver[:port][/ssl]&rcub;path/to/folder</literal>
</para>

<para>
Note that not all servers use <quote>/</quote> as the hierarchy separator.  Mutt should
correctly notice which separator is being used by the server and convert
paths accordingly.
</para>

<para>
When browsing folders on an IMAP server, you can toggle whether to look
at only the folders you are subscribed to, or all folders with the
<emphasis>toggle-subscribed</emphasis> command.  See also the
<link linkend="imap-list-subscribed">&dollar;imap&lowbar;list&lowbar;subscribed</link> variable.
</para>

<para>
Polling for new mail on an IMAP server can cause noticeable delays. So, you'll
want to carefully tune the
<link linkend="mail-check">&dollar;mail&lowbar;check</link>
and
<link linkend="timeout">&dollar;timeout</link>
variables. Reasonable values are:
</para>

<screen>
set mail_check=90
set timeout=15
</screen>

<para>
with relatively good results even over slow modem lines.
</para>

<note>
<para>
Note that if you are using mbox as the mail store on UW servers prior to
v12.250, the server has been reported to disconnect a client if another client
selects the same folder.
</para>
</note>

<sect2 id="imap-browser">
<title>The IMAP Folder Browser</title>

<para>
As of version 1.2, Mutt supports browsing mailboxes on an IMAP
server. This is mostly the same as the local file browser, with the
following differences:
</para>

<itemizedlist>
<listitem>

<para>
In lieu of file permissions, Mutt displays the string <quote>IMAP</quote>,
possibly followed by the symbol <quote>+</quote>, indicating
that the entry contains both messages and subfolders. On
Cyrus-like servers folders will often contain both messages and
subfolders.
</para>
</listitem>
<listitem>

<para>
For the case where an entry can contain both messages and
subfolders, the selection key (bound to <literal>enter</literal> by default)
will choose to descend into the subfolder view. If you wish to view
the messages in that folder, you must use <literal>view-file</literal> instead
(bound to <literal>space</literal> by default).
</para>
</listitem>
<listitem>

<para>
You can create, delete and rename mailboxes with the
<literal>&lt;create-mailbox&gt;</literal>, <literal>&lt;delete-mailbox&gt;</literal>, and
<literal>&lt;rename-mailbox&gt;</literal> commands (default bindings: <literal>C</literal>,
<literal>d</literal> and <literal>r</literal>, respectively). You may also
<literal>&lt;subscribe&gt;</literal> and <literal>&lt;unsubscribe&gt;</literal> to mailboxes (normally
these are bound to <literal>s</literal> and <literal>u</literal>, respectively).
</para>
</listitem>

</itemizedlist>

</sect2>

<sect2 id="imap-authentication">
<title>Authentication</title>

<para>
Mutt supports four authentication methods with IMAP servers: SASL,
GSSAPI, CRAM-MD5, and LOGIN (there is a patch by Grant Edwards to add
NTLM authentication for you poor exchange users out there, but it has
yet to be integrated into the main tree). There is also support for
the pseudo-protocol ANONYMOUS, which allows you to log in to a public
IMAP server without having an account. To use ANONYMOUS, simply make
your username blank or <quote>anonymous</quote>.
</para>

<para>
SASL is a special super-authenticator, which selects among several protocols
(including GSSAPI, CRAM-MD5, ANONYMOUS, and DIGEST-MD5) the most secure
method available on your host and the server. Using some of these methods
(including DIGEST-MD5 and possibly GSSAPI), your entire session will be
encrypted and invisible to those teeming network snoops. It is the best
option if you have it. To use it, you must have the Cyrus SASL library
installed on your system and compile Mutt with the <emphasis>--with-sasl</emphasis> flag.
</para>

<para>
Mutt will try whichever methods are compiled in and available on the server,
in the following order: SASL, ANONYMOUS, GSSAPI, CRAM-MD5, LOGIN.
</para>

<para>
There are a few variables which control authentication:
</para>

<itemizedlist>
<listitem>

<para>
<link linkend="imap-user">&dollar;imap&lowbar;user</link> - controls
the username under which you request authentication on the IMAP server,
for all authenticators. This is overridden by an explicit username in
the mailbox path (ie by using a mailbox name of the form
<literal>&lcub;user@host&rcub;</literal>).
</para>
</listitem>
<listitem>

<para>
<link linkend="imap-pass">&dollar;imap&lowbar;pass</link> - a
password which you may preset, used by all authentication methods where
a password is needed.
</para>
</listitem>
<listitem>

<para>
<link linkend="imap-authenticators">&dollar;imap&lowbar;authenticators</link> - a colon-delimited list of IMAP
authentication methods to try, in the order you wish to try them. If
specified, this overrides Mutt's default (attempt everything, in the order
listed above).
</para>
</listitem>

</itemizedlist>

</sect2>

</sect1>

<sect1 id="smtp">
<title>SMTP Support</title>

<para>
Besides supporting traditional mail delivery through a
sendmail-compatible program, Mutt supports delivery through SMTP if it
was configured and built with <literal>--enable-smtp</literal>.
</para>

<para>
If the configuration variable
<link linkend="smtp-url">&dollar;smtp&lowbar;url</link> is set, Mutt
will contact the given SMTP server to deliver messages; if it is unset,
Mutt will use the program specified by <link linkend="sendmail">&dollar;sendmail</link>.
</para>

<para>
For details on the URL syntax, please see <xref linkend="url-syntax"/>.
</para>

<para>
The built-in SMTP support supports encryption (the <literal>smtps</literal> protocol
using SSL or TLS) as well as SMTP authentication using SASL. The authentication mechanisms
for SASL are specified in <link linkend="smtp-authenticators">&dollar;smtp&lowbar;authenticators</link>
defaulting to an empty list which makes Mutt try all available methods
from most-secure to least-secure.
</para>

</sect1>

<sect1 id="account-hook">
<title>Managing Multiple Accounts</title>

<para>
Usage:
</para>

<cmdsynopsis>
<command>account-hook</command>
<arg choice="plain">
<replaceable class="parameter">pattern</replaceable>
</arg>
<arg choice="plain">
<replaceable class="parameter">command</replaceable>
</arg>
</cmdsynopsis>

<para>
If you happen to have accounts on multiple IMAP, POP and/or SMTP servers,
you may find managing all the authentication settings inconvenient and
error-prone. The <link linkend="account-hook"><command>account-hook</command></link> command may help. This hook works like
<link linkend="folder-hook"><command>folder-hook</command></link> but is invoked whenever Mutt needs to access a remote mailbox
(including inside the folder browser), not just when you open the
mailbox. This includes (for example) polling for new mail, storing Fcc
messages and saving messages to a folder. As a consequence,
<link linkend="account-hook"><command>account-hook</command></link> should only be used to set connection-related settings such
as passwords or tunnel commands but not settings such as sender
address or name (because in general it should be considered unpredictable
which <link linkend="account-hook"><command>account-hook</command></link> was last used).
</para>

<para>
Some examples:
</para>

<screen>
account-hook . 'unset imap_user; unset imap_pass; unset tunnel'
account-hook imap://host1/ 'set imap_user=me1 imap_pass=foo'
account-hook imap://host2/ 'set tunnel="ssh host2 /usr/libexec/imapd"'
account-hook smtp://user@host3/ 'set tunnel="ssh host3 /usr/libexec/smtpd"'
</screen>

<para>
To manage multiple accounts with, for example, different values of
<link linkend="record">&dollar;record</link> or sender addresses,
<link linkend="folder-hook"><command>folder-hook</command></link>
has to be be used together with
the <link linkend="mailboxes"><command>mailboxes</command></link> command.
</para>

<example id="ex-multiaccount">
<title>Managing multiple accounts</title>
<screen>
mailboxes imap://user@host1/INBOX
folder-hook imap://user@host1/ 'set folder=imap://host1/ ; set record=+INBOX/Sent'

mailboxes imap://user@host2/INBOX
folder-hook imap://user@host2/ 'set folder=imap://host2/ ; set record=+INBOX/Sent'
</screen>
</example>

<para>
In example
<xref linkend="ex-multiaccount"/> the folders are defined using
<link linkend="mailboxes"><command>mailboxes</command></link> so Mutt polls them for new
mail. Each <link linkend="folder-hook"><command>folder-hook</command></link> triggers when
one mailbox below each IMAP account is opened and sets
<link linkend="folder">&dollar;folder</link> to the account's root
folder. Next, it sets <link linkend="record">&dollar;record</link> to
the <emphasis>INBOX/Sent</emphasis> folder below the newly
set <link linkend="folder">&dollar;folder</link>. Please notice that the
value the <quote>+</quote>
<link linkend="shortcuts">mailbox shortcut</link> refers to depends on
the <emphasis>current</emphasis> value
of <link linkend="folder">&dollar;folder</link> and therefore has to be set
separatedly per account. Setting other values
like <link linkend="from">&dollar;from</link>
or <link linkend="signature">&dollar;signature</link> is analogous to setting
<link linkend="record">&dollar;record</link>.
</para>

</sect1>

<sect1 id="caching">
<title>Local Caching</title>

<para>
Mutt contains two types of local caching: <emphasis>(1)</emphasis>
the so-called <quote>header caching</quote> and <emphasis>(2)</emphasis> the
so-called <quote>body caching</quote> which are both described in this section.
</para>

<para>
Header caching is optional as it depends on external libraries, body
caching is always enabled if Mutt is compiled with POP and/or IMAP
support as these use it (body caching requires no external library).
</para>

<sect2 id="header-caching">
<title>Header Caching</title>

<para>
Mutt provides optional support for caching message headers for the
following types of folders: IMAP, POP, Maildir and MH. Header caching
greatly improves speed because for remote folders, headers
usually only need to be downloaded once. For Maildir and MH, reading the
headers from a single file is much faster than looking at possibly
thousands of single files (since Maildir and MH use one file per message.)
</para>

<para>
Header caching can be enabled via the configure script and the
<emphasis>--enable-hcache</emphasis> option. It's not turned on
by default because external database libraries are required: one
of tokyocabinet, qdbm, gdbm or bdb must be present.
</para>

<para>
If enabled, <link
linkend="header-cache">&dollar;header&lowbar;cache</link> can be
used to either point to a file or a directory. If set to point to
a file, one database file for all folders will be used (which may
result in lower performance), but one file per folder if it points
to a directory.
</para>

</sect2>

<sect2 id="body-caching">
<title>Body Caching</title>

<para>
Both cache methods can be combined using the same directory for storage
(and for IMAP/POP even provide meaningful file names) which simplifies
manual maintenance tasks.
</para>


<para>
In addition to caching message headers only, Mutt can also cache
whole message bodies. This results in faster display of messages
for POP and IMAP folders because messages usually have to be
downloaded only once.
</para>

<para>
For configuration, the variable <link linkend="message-cachedir"
>&dollar;message&lowbar;cachedir</link> must point to a
directory. There, Mutt will create a hierarchy of subdirectories
named like: <literal>proto:user@hostname</literal> where
<literal>proto</literal> is either <quote>pop</quote> or <quote>imap.</quote> Within
there for each folder, Mutt stores messages in single files.
All files can be removed as needed if the consumed disk space
becomes an issue as Mutt will silently fetch missing items again.
</para>

</sect2>

<sect2 id="maint-cache">
<title>Maintenance</title>

<para>
Mutt does not (yet) support maintenance features for header cache
database files so that files have to be removed in case they grow too
big. It depends on the database library used for header caching whether
disk space freed by removing messages is re-used.
</para>

<para>
For body caches, Mutt can keep the local cache in sync with the
remote mailbox if the
<link linkend="message-cache-clean">&dollar;message&lowbar;cache&lowbar;clean</link>
variable is set. Cleaning means to remove messages from the cache which
are no longer present in the mailbox which only happens when other mail
clients or instances of Mutt using a different body cache location
delete messages (Mutt itself removes deleted messages from the cache
when syncing a mailbox). As cleaning can take a noticeable amount of time,
it should not be set in general but only occasionally.
</para>

</sect2>

</sect1>

<sect1 id="exact-address">
<title>Exact Address Generation</title>

<para>
Mutt supports the <quote>Name &lt;user@host&gt;</quote> address syntax for reading and
writing messages, the older <quote>user@host (Name)</quote> syntax is only supported when
reading messages. The <emphasis>--enable-exact-address</emphasis>
switch can be given to configure to build it with write-support
for the latter syntax. <literal>EXACT_ADDRESS</literal> in the output of
<literal>mutt -v</literal> indicates whether it's supported.
</para>

</sect1>

<sect1 id="sending-mixmaster">
<title>Sending Anonymous Messages via Mixmaster</title>

<para>
You may also have compiled Mutt to co-operate with Mixmaster, an
anonymous remailer.  Mixmaster permits you to send your messages
anonymously using a chain of remailers. Mixmaster support in Mutt is for
mixmaster version 2.04 (beta 45 appears to be the latest) and 2.03.
It does not support earlier versions or the later so-called version 3 betas,
of which the latest appears to be called 2.9b23.
</para>

<para>
To use it, you'll have to obey certain restrictions.  Most
important, you cannot use the <literal>Cc</literal> and <literal>Bcc</literal> headers.  To tell
Mutt to use mixmaster, you have to select a remailer chain, using
the mix function on the compose menu.
</para>

<para>
The chain selection screen is divided into two parts.  In the
(larger) upper part, you get a list of remailers you may use.  In
the lower part, you see the currently selected chain of remailers.
</para>

<para>
You can navigate in the chain using the <literal>&lt;chain-prev&gt;</literal> and
<literal>&lt;chain-next&gt;</literal> functions, which are by default bound to the left
and right arrows and to the <literal>h</literal> and <literal>l</literal> keys (think vi
keyboard bindings).  To insert a remailer at the current chain
position, use the <literal>&lt;insert&gt;</literal> function.  To append a remailer behind
the current chain position, use <literal>&lt;select-entry&gt;</literal> or <literal>&lt;append&gt;</literal>.
You can also delete entries from the chain, using the corresponding
function.  Finally, to abandon your changes, leave the menu, or
<literal>&lt;accept&gt;</literal> them pressing (by default) the <literal>Return</literal> key.
</para>

<para>
Note that different remailers do have different capabilities,
indicated in the &percnt;c entry of the remailer menu lines (see
<link linkend="mix-entry-format">&dollar;mix&lowbar;entry&lowbar;format</link>).  Most important is
the <quote>middleman</quote> capability, indicated by a capital <quote>M</quote>: This
means that the remailer in question cannot be used as the final
element of a chain, but will only forward messages to other
mixmaster remailers.  For details on the other capabilities, please
have a look at the mixmaster documentation.
</para>

</sect1>

</chapter>

<chapter id="security">
<title>Security Considerations</title>

<para>
First of all, Mutt contains no security holes included by intention but
may contain unknown security holes. As a consequence, please run Mutt
only with as few permissions as possible. Especially, do not run Mutt as
the super user.
</para>

<para>
When configuring Mutt, there're some points to note about secure setups
so please read this chapter carefully.
</para>

<sect1 id="security-passwords">
<title>Passwords</title>

<para>
Although Mutt can be told the various passwords for accounts, please
never store passwords in configuration files. Besides the fact that the
system's operator can always read them, you could forget to mask it out
when reporting a bug or asking for help via a mailing list. Even worse,
your mail including your password could be archived by internet search
engines, mail-to-news gateways etc. It may already be too late before
you notice your mistake.
</para>

</sect1>

<sect1 id="security-tempfiles">
<title>Temporary Files</title>

<para>
Mutt uses many temporary files for viewing messages, verifying digital
signatures, etc. As long as being used, these files are visible by other
users and maybe even readable in case of misconfiguration.  Also, a
different location for these files may be desired which can be changed
via the <link linkend="tmpdir">&dollar;tmpdir</link> variable.
</para>

</sect1>

<sect1 id="security-leaks">
<title>Information Leaks</title>

<sect2 id="security-leaks-mid">
<title>Message-Id: headers</title>

<para>
Message-Id: headers contain a local part that is to be created in a
unique fashion. In order to do so, Mutt will <quote>leak</quote> some
information to the outside world when sending messages: the generation
of this header includes a step counter which is increased (and rotated)
with every message sent. In a longer running mutt session, others can
make assumptions about your mailing habbits depending on the number of
messages sent. If this is not desired, the header can be manually
provided using <link
linkend="edit-headers">&dollar;edit&lowbar;headers</link> (though not
recommended).
</para>

</sect2>

<sect2 id="security-leaks-mailto">
<title><literal>mailto:</literal>-style Links</title>

<para>
As Mutt be can be set up to be the mail client to handle
<literal>mailto:</literal> style links in websites, there're security
considerations, too. Arbitrary header fields can be embedded in these
links which could override existing header fields or attach arbitrary
files using <link linkend="attach-header">the Attach:
psuedoheader</link>. This may be problematic if the <link
linkend="edit-headers">&dollar;edit-headers</link> variable is
<emphasis>unset</emphasis>, i.e. the user doesn't want to see header
fields while editing the message and doesn't pay enough attention to the
compose menu's listing of attachments.
</para>

<para>
For example, following a link like
</para>

<screen>
mailto:joe@host?Attach=~/.gnupg/secring.gpg</screen>

<para>
will send out the user's private gnupg keyring to
<literal>joe@host</literal> if the user doesn't follow the information
on screen carefully enough.
</para>

</sect2>

</sect1>

<sect1 id="security-external">
<title>External Applications</title>

<para>
Mutt in many places has to rely on external applications or for
convenience supports mechanisms involving external applications.
</para>

<para>
One of these is the <literal>mailcap</literal> mechanism as defined by
RfC1524. Details about a secure use of the mailcap mechanisms is given
in <xref linkend="secure-mailcap"/>.
</para>

<para>
Besides the mailcap mechanism, Mutt uses a number of other external
utilities for operation, for example to provide crypto support, in
backtick expansion in configuration files or format string filters.  The
same security considerations apply for these as for tools involved via
mailcap.
</para>

</sect1>

</chapter>


<chapter id="tuning">
<title>Performance Tuning</title>

<sect1 id="tuning-mailboxes">
<title>Reading and Writing Mailboxes</title>

<para>
Mutt's performance when reading mailboxes can be improved in two ways:
</para>

<orderedlist>

<listitem>
<para>
For remote folders (IMAP and POP) as well as folders using
one-file-per message storage (Maildir and MH), Mutt's
performance can be greatly improved using
<link linkend="header-caching">header caching</link>.
using a single database per folder.
</para>
</listitem>

<listitem>
<para>
Mutt provides the <link linkend="read-inc">&dollar;read&lowbar;inc</link>
and <link linkend="write-inc">&dollar;write&lowbar;inc</link>
variables to specify at which rate to update progress
counters. If these values are too low, Mutt may spend more
time on updating the progress counter than it spends on
actually reading/writing folders.
</para>
<para>
For example, when opening a maildir folder with a few
thousand messages, the default value for
<link linkend="read-inc">&dollar;read&lowbar;inc</link>
may be too low. It can be tuned on on a folder-basis using
<link linkend="folder-hook"><command>folder-hook</command>s</link>:
</para>

<screen>
# use very high $read_inc to speed up reading hcache'd maildirs
folder-hook . 'set read_inc=1000'
# use lower value for reading slower remote IMAP folders
folder-hook ^imap 'set read_inc=100'
# use even lower value for reading even slower remote POP folders
folder-hook ^pop 'set read_inc=1'</screen>

</listitem>
</orderedlist>

<para>These settings work on a per-message basis. However, as messages may
greatly differ in size and certain operations are much faster than others,
even per-folder settings of the increment variables may not be
desirable as they produce either too few or too much progress updates.
Thus, Mutt allows to limit the number of progress updates per second it'll
actually send to the terminal using the
<link linkend="time-inc">&dollar;time&lowbar;inc</link> variable.</para>

</sect1>

<sect1 id="tuning-messages">
<title>Reading Messages from Remote Folders</title>

<para>
Reading messages from remote folders such as IMAP an POP can be
slow especially for large mailboxes since Mutt only caches a very
limited number of recently viewed messages (usually 10) per
session (so that it will be gone for the next session.)
</para>

<para>
To improve performance and permanently cache whole messages,
please refer to Mutt's so-called
<link linkend="body-caching">body caching</link> for details.
</para>

</sect1>

<sect1 id="tuning-search">
<title>Searching and Limiting</title>

<para>
When searching mailboxes either via a search or a limit action, for
some patterns Mutt distinguishes between regular expression and string
searches. For regular expressions, patterns are prefixed with
<quote>&tilde;</quote> and with <quote>=</quote> for string searches.
</para>

<para>
Even though a regular expression search is fast, it's several times
slower than a pure string search which is noticeable especially on large
folders. As a consequence, a string search should be used instead of a
regular expression search if the user already knows enough about the
search pattern.
</para>

<para>
For example, when limiting a large folder to all messages sent to or by
an author, it's much faster to search for the initial part of an e-mail
address via <literal>=Luser@</literal> instead of
<literal>&tilde;Luser@</literal>. This is especially true for searching
message bodies since a larger amount of input has to be searched.
</para>

<para>
As for regular expressions, a lower case string search pattern makes
Mutt perform a case-insensitive search except for IMAP (because for IMAP
Mutt performs server-side searches which don't support case-insensivity).
</para>

</sect1>

</chapter>

<chapter id="reference">
<title>Reference</title>

<sect1 id="commandline">
<title>Command-Line Options</title>

<para>
Running <literal>mutt</literal> with no arguments will make Mutt attempt to read your spool
mailbox.  However, it is possible to read other mailboxes and
to send messages from the command line as well.
</para>

<table id="tab-commandline-options">
<title>Command line options</title>
<tgroup cols="2">
<thead>
<row><entry>Option</entry><entry>Description</entry></row>
</thead>
<tbody>
<row><entry>-A</entry><entry>expand an alias</entry></row>
<row><entry>-a</entry><entry>attach a file to a message</entry></row>
<row><entry>-b</entry><entry>specify a blind carbon-copy (BCC) address</entry></row>
<row><entry>-c</entry><entry>specify a carbon-copy (Cc) address</entry></row>
<row><entry>-D</entry><entry>print the value of all Mutt variables to stdout</entry></row>
<row><entry>-e</entry><entry>specify a config command to be run after initialization files are read</entry></row>
<row><entry>-f</entry><entry>specify a mailbox to load</entry></row>
<row><entry>-F</entry><entry>specify an alternate file to read initialization commands</entry></row>
<row><entry>-h</entry><entry>print help on command line options</entry></row>
<row><entry>-H</entry><entry>specify a draft file from which to read a header and body</entry></row>
<row><entry>-i</entry><entry>specify a file to include in a message composition</entry></row>
<row><entry>-m</entry><entry>specify a default mailbox type</entry></row>
<row><entry>-n</entry><entry>do not read the system Muttrc</entry></row>
<row><entry>-p</entry><entry>recall a postponed message</entry></row>
<row><entry>-Q</entry><entry>query a configuration variable</entry></row>
<row><entry>-R</entry><entry>open mailbox in read-only mode</entry></row>
<row><entry>-s</entry><entry>specify a subject (enclose in quotes if it contains spaces)</entry></row>
<row><entry>-v</entry><entry>show version number and compile-time definitions</entry></row>
<row><entry>-x</entry><entry>simulate the mailx(1) compose mode</entry></row>
<row><entry>-y</entry><entry>show a menu containing the files specified by the <command>mailboxes</command> command</entry></row>
<row><entry>-z</entry><entry>exit immediately if there are no messages in the mailbox</entry></row>
<row><entry>-Z</entry><entry>open the first folder with new message, exit immediately if none</entry></row>
</tbody>
</tgroup>
</table>

<para>
To read messages in a mailbox
</para>

<cmdsynopsis>
<command>mutt</command>
<arg choice="opt"><option>-nz</option></arg>
<arg choice="opt"><option>-F</option>
<replaceable>muttrc</replaceable>
</arg>
<arg choice="opt"><option>-m</option>
<replaceable>type</replaceable>
</arg>
<arg choice="opt"><option>-f</option>
<replaceable>mailbox</replaceable>
</arg>
</cmdsynopsis>

<para>
To compose a new message
</para>

<cmdsynopsis>
<command>mutt</command>
<arg choice="opt"><option>-n</option></arg>
<arg choice="opt"><option>-F</option>
<replaceable>muttrc</replaceable>
</arg>
<arg choice="opt"><option>-c</option>
<replaceable>address</replaceable>
</arg>
<arg choice="opt"><option>-i</option>
<replaceable>filename</replaceable>
</arg>
<arg choice="opt"><option>-s</option>
<replaceable>subject</replaceable>
</arg>
<arg choice="opt">
<option>-a</option>
<replaceable>file</replaceable>
<arg choice="opt" rep="repeat"/>
--
</arg>
<arg choice="plain" rep="repeat">
<replaceable>address</replaceable>
</arg>
</cmdsynopsis>

<para>
Mutt also supports a <quote>batch</quote> mode to send prepared messages.  Simply redirect
input from the file you wish to send.  For example,
</para>

<screen>
mutt -s &quot;data set for run &num;2&quot; professor@bigschool.edu &lt; &tilde;/run2.dat</screen>

<para>
will send a message to <literal>&lt;professor@bigschool.edu&gt;</literal> with a subject
of <quote>data set for run &num;2</quote>.  In the body of the message will be the contents
of the file <quote>&tilde;/run2.dat</quote>.
</para>

<para>
All files passed with <literal>-a</literal> <emphasis>file</emphasis> will be attached as a MIME
part to the message. To attach a single or several files, use <quote>--</quote> to separate files and
recipient addresses:
</para>

<screen>
mutt -a image.png -- some@one.org</screen>

<para>
or
</para>

<screen>
mutt -a *.png -- some@one.org</screen>

<note>
<para>
The <literal>-a</literal> option must be last in the option list.
</para>
</note>

</sect1>

<sect1 id="commands">
<title>Configuration Commands</title>

<para>
The following are the commands understood by Mutt:
</para>

<itemizedlist>

<listitem>
<cmdsynopsis>
<command><link linkend="account-hook">account-hook</link></command>
<arg choice="plain">
<replaceable>pattern</replaceable>
<replaceable>command</replaceable>
</arg>
</cmdsynopsis>
</listitem>

<listitem>
<cmdsynopsis>
<command><link linkend="alias">alias</link></command>
<arg choice="opt" rep="repeat">
<option>-group</option>
<replaceable class="parameter">name</replaceable>
</arg>
<arg choice="plain">
<replaceable class="parameter">key</replaceable>
</arg>
<arg choice="plain">
<replaceable class="parameter">address</replaceable>
</arg>
<arg choice="opt" rep="repeat">
<replaceable class="parameter">address</replaceable>
</arg>

<command><link linkend="alias">unalias</link></command>
<arg choice="opt" rep="repeat">
<option>-group</option>
<replaceable>name</replaceable>
</arg>
<group choice="req">
<arg choice="plain">
<replaceable class="parameter">*</replaceable>
</arg>
<arg choice="plain" rep="repeat">
<replaceable class="parameter">key</replaceable>
</arg>
</group>
</cmdsynopsis>
</listitem>

<listitem>
<cmdsynopsis>
<command><link linkend="alternates">alternates</link></command>
<arg choice="opt" rep="repeat">
<option>-group</option>
<replaceable>name</replaceable>
</arg>
<arg choice="plain">
<replaceable>regexp</replaceable>
</arg>
<arg choice="opt" rep="repeat">
<replaceable>regexp</replaceable>
</arg>

<command><link linkend="alternates">unalternates</link></command>
<arg choice="opt" rep="repeat">
<option>-group</option>
<replaceable>name</replaceable>
</arg>
<group choice="req">
<arg choice="plain">
<replaceable>*</replaceable>
</arg>
<arg choice="plain" rep="repeat">
<replaceable>regexp</replaceable>
</arg>
</group>
</cmdsynopsis>
</listitem>

<listitem>
<cmdsynopsis>
<command><link linkend="alternative-order">alternative-order</link></command>
<arg choice="plain">
<replaceable>mimetype</replaceable>
</arg>
<arg choice="opt" rep="repeat">
<replaceable>mimetype</replaceable>
</arg>

<command><link linkend="alternative-order">unalternative-order</link></command>
<group choice="req">
<arg choice="plain">
<replaceable>*</replaceable>
</arg>
<arg choice="plain" rep="repeat">
<replaceable>mimetype</replaceable>
</arg>
</group>
</cmdsynopsis>
</listitem>

<listitem>
<cmdsynopsis>
<command><link linkend="attachments">attachments</link></command>
<arg choice="plain">
<replaceable>&lcub; + &verbar; - &rcub;disposition</replaceable>
</arg>
<arg choice="plain">
<replaceable>mime-type</replaceable>
</arg>

<command><link linkend="attachments">unattachments</link></command>
<arg choice="plain">
<replaceable>&lcub; + &verbar; - &rcub;disposition</replaceable>
</arg>
<arg choice="plain">
<replaceable>mime-type</replaceable>
</arg>
</cmdsynopsis>
</listitem>

<listitem>
<cmdsynopsis>
<command><link linkend="auto-view">auto-view</link></command>
<arg choice="plain">
<replaceable>mimetype</replaceable>
</arg>
<arg choice="opt" rep="repeat">
<replaceable>mimetype</replaceable>
</arg>

<command><link linkend="auto-view">unauto-view</link></command>
<group choice="req">
<arg choice="plain">
<replaceable>*</replaceable>
</arg>
<arg choice="plain" rep="repeat">
<replaceable>mimetype</replaceable>
</arg>
</group>
</cmdsynopsis>
</listitem>

<listitem>
<cmdsynopsis>
<command><link linkend="bind">bind</link></command>
<arg choice="plain">
<replaceable class="parameter">map</replaceable>
</arg>
<arg choice="plain">
<replaceable class="parameter">key</replaceable>
</arg>
<arg choice="plain">
<replaceable class="parameter">function</replaceable>
</arg>
</cmdsynopsis>
</listitem>

<listitem>
<cmdsynopsis>
<command><link linkend="charset-hook">charset-hook</link></command>
<arg choice="plain">
<replaceable class="parameter">alias</replaceable>
</arg>
<arg choice="plain">
<replaceable class="parameter">charset</replaceable>
</arg>
</cmdsynopsis>
</listitem>

<listitem>
<cmdsynopsis>
<command><link linkend="iconv-hook">iconv-hook</link></command>
<arg choice="plain">
<replaceable class="parameter">charset</replaceable>
</arg>
<arg choice="plain">
<replaceable class="parameter">local-charset</replaceable>
</arg>
</cmdsynopsis>
</listitem>

<listitem>
<cmdsynopsis>
<command><link linkend="color">color</link></command>
<arg choice="plain">
<replaceable class="parameter">object</replaceable>
</arg>
<arg choice="plain">
<replaceable class="parameter">foreground</replaceable>
</arg>
<arg choice="plain">
<replaceable class="parameter">background</replaceable>
</arg>

<command><link linkend="color">color</link></command>
<group choice="req">
<arg choice="plain">
<option>header</option>
</arg>
<arg choice="plain">
<option>body</option>
</arg>
</group>
<arg choice="plain">
<replaceable class="parameter">foreground</replaceable>
</arg>
<arg choice="plain">
<replaceable class="parameter">background</replaceable>
</arg>
<arg choice="plain">
<replaceable class="parameter">regexp</replaceable>
</arg>

<command><link linkend="color">color</link></command>
<arg choice="plain">
<option>index</option>
</arg>
<arg choice="plain">
<replaceable class="parameter">foreground</replaceable>
</arg>
<arg choice="plain">
<replaceable class="parameter">background</replaceable>
</arg>
<arg choice="plain">
<replaceable class="parameter">pattern</replaceable>
</arg>

<command><link linkend="color">uncolor</link></command>
<group choice="req">
<arg choice="plain">
<option>index</option>
</arg>
<arg choice="plain">
<option>header</option>
</arg>
<arg choice="plain">
<option>body</option>
</arg>
</group>
<group choice="req">
<arg choice="plain">
<replaceable>*</replaceable>
</arg>
<arg choice="plain" rep="repeat">
<replaceable>pattern</replaceable>
</arg>
</group>
</cmdsynopsis>
</listitem>

<listitem>
<cmdsynopsis>
<command><link linkend="crypt-hook">crypt-hook</link></command>
<arg choice="plain">
<replaceable class="parameter">pattern</replaceable>
</arg>
<arg choice="plain">
<replaceable class="parameter">keyid</replaceable>
</arg>
</cmdsynopsis>
</listitem>

<listitem>
<cmdsynopsis>
<command><link linkend="exec">exec</link></command>
<arg choice="plain">
<replaceable class="parameter">function</replaceable>
</arg>
<arg choice="opt" rep="repeat">
<replaceable class="parameter">function</replaceable>
</arg>
</cmdsynopsis>
</listitem>

<listitem>
<cmdsynopsis>
<command><link linkend="fcc-hook">fcc-hook</link></command>
<arg choice="plain">
<replaceable class="parameter">&lsqb;!&rsqb;pattern</replaceable>
</arg>
<arg choice="plain">
<replaceable class="parameter">mailbox</replaceable>
</arg>
</cmdsynopsis>
</listitem>

<listitem>
<cmdsynopsis>
<command><link linkend="fcc-save-hook">fcc-save-hook</link></command>
<arg choice="plain">
<replaceable class="parameter">&lsqb;!&rsqb;pattern</replaceable>
</arg>
<arg choice="plain">
<replaceable class="parameter">mailbox</replaceable>
</arg>
</cmdsynopsis>
</listitem>

<listitem>
<cmdsynopsis>
<command><link linkend="folder-hook">folder-hook</link></command>
<arg choice="plain">
<replaceable class="parameter">&lsqb;!&rsqb;regexp</replaceable>
</arg>
<arg choice="plain">
<replaceable class="parameter">command</replaceable>
</arg>
</cmdsynopsis>
</listitem>

<listitem>
<cmdsynopsis>
<command><link linkend="addrgroup">group</link></command>
<arg choice="opt" rep="repeat">
<option>-group</option>
<replaceable class="parameter">name</replaceable>
</arg>
<group choice="req">
<arg choice="plain" rep="repeat">
<option>-rx</option>
<replaceable class="parameter">expr</replaceable>
</arg>
<arg choice="plain" rep="repeat">
<option>-addr</option>
<replaceable class="parameter">expr</replaceable>
</arg>
</group>

<command><link linkend="addrgroup">ungroup</link></command>
<arg choice="opt" rep="repeat">
<option>-group</option>
<replaceable class="parameter">name</replaceable>
</arg>
<group choice="req">
<arg choice="plain">
<replaceable class="parameter">*</replaceable>
</arg>
<arg choice="plain" rep="repeat">
<option>-rx</option>
<replaceable class="parameter">expr</replaceable>
</arg>
<arg choice="plain" rep="repeat">
<option>-addr</option>
<replaceable class="parameter">expr</replaceable>
</arg>
</group>
</cmdsynopsis>
</listitem>

<listitem>
<cmdsynopsis>
<command><link linkend="hdr-order">hdr&lowbar;order</link></command>
<arg choice="plain">
<replaceable class="parameter">header</replaceable>
</arg>
<arg choice="opt" rep="repeat">
<replaceable class="parameter">header</replaceable>
</arg>

<command><link linkend="hdr-order">unhdr&lowbar;order</link></command>
<group choice="req">
<arg choice="plain">
<replaceable>*</replaceable>
</arg>
<arg choice="plain" rep="repeat">
<replaceable>header</replaceable>
</arg>
</group>
</cmdsynopsis>
</listitem>

<listitem>
<cmdsynopsis>
<command><link linkend="ignore">ignore</link></command>
<arg choice="plain">
<replaceable class="parameter">pattern</replaceable>
</arg>
<arg choice="opt" rep="repeat">
<replaceable class="parameter">pattern</replaceable>
</arg>

<command><link linkend="ignore">unignore</link></command>
<group choice="req">
<arg choice="plain">
<replaceable>*</replaceable>
</arg>
<arg choice="plain" rep="repeat">
<replaceable>pattern</replaceable>
</arg>
</group>
</cmdsynopsis>
</listitem>

<listitem>
<cmdsynopsis>
<command><link linkend="lists">lists</link></command>
<arg>
<option>-group</option>
<replaceable class="parameter">name</replaceable>
</arg>
<arg choice="plain">
<replaceable class="parameter">regexp</replaceable>
</arg>
<arg choice="opt" rep="repeat">
<replaceable class="parameter">regexp</replaceable>
</arg>

<command><link linkend="lists">unlists</link></command>
<arg choice="opt" rep="repeat">
<option>-group</option>
<replaceable>name</replaceable>
</arg>
<group choice="req">
<arg choice="plain">
<replaceable>*</replaceable>
</arg>
<arg choice="plain" rep="repeat">
<replaceable>regexp</replaceable>
</arg>
</group>
</cmdsynopsis>
</listitem>

<listitem>
<cmdsynopsis>
<command><link linkend="macro">macro</link></command>
<arg choice="plain">
<replaceable class="parameter">menu</replaceable>
</arg>
<arg choice="plain">
<replaceable class="parameter">key</replaceable>
</arg>
<arg choice="plain">
<replaceable class="parameter">sequence</replaceable>
</arg>
<arg choice="opt">
<replaceable class="parameter">description</replaceable>
</arg>
</cmdsynopsis>
</listitem>

<listitem>
<cmdsynopsis>
<command><link linkend="mailboxes">mailboxes</link></command>
<arg choice="plain">
<replaceable class="parameter">mailbox</replaceable>
</arg>
<arg choice="opt" rep="repeat">
<replaceable class="parameter">mailbox</replaceable>
</arg>

<command><link linkend="mailboxes">unmailboxes</link></command>
<group choice="req">
<arg choice="plain">
<replaceable class="parameter">*</replaceable>
</arg>
<arg choice="plain" rep="repeat">
<replaceable class="parameter">mailbox</replaceable>
</arg>
</group>
</cmdsynopsis>
</listitem>

<listitem>
<cmdsynopsis>
<command><link linkend="mbox-hook">mbox-hook</link></command>
<arg choice="plain">
<replaceable class="parameter">&lsqb;!&rsqb;pattern</replaceable>
</arg>
<arg choice="plain">
<replaceable class="parameter">mailbox</replaceable>
</arg>
</cmdsynopsis>
</listitem>

<listitem>
<cmdsynopsis>
<command><link linkend="message-hook">message-hook</link></command>
<arg choice="plain">
<replaceable class="parameter">&lsqb;!&rsqb;pattern</replaceable>
</arg>
<arg choice="plain">
<replaceable class="parameter">command</replaceable>
</arg>
</cmdsynopsis>
</listitem>

<listitem>
<cmdsynopsis>
<command><link linkend="mime-lookup">mime-lookup</link></command>
<arg choice="plain">
<replaceable>mimetype</replaceable>
</arg>
<arg choice="opt" rep="repeat">
<replaceable>mimetype</replaceable>
</arg>

<command><link linkend="mime-lookup">unmime-lookup</link></command>
<group choice="req">
<arg choice="plain">
<replaceable>*</replaceable>
</arg>
<arg choice="plain" rep="repeat">
<replaceable>mimetype</replaceable>
</arg>
</group>
</cmdsynopsis>
</listitem>

<listitem>
<cmdsynopsis>
<command><link linkend="mono">mono</link></command>
<arg choice="plain">
<replaceable class="parameter">object</replaceable>
</arg>
<arg choice="plain">
<replaceable class="parameter">attribute</replaceable>
</arg>

<command><link linkend="mono">mono</link></command>
<group choice="req">
<arg choice="plain">
<option>header</option>
</arg>
<arg choice="plain">
<option>body</option>
</arg>
</group>
<arg choice="plain">
<replaceable class="parameter">attribute</replaceable>
</arg>
<arg choice="plain">
<replaceable class="parameter">regexp</replaceable>
</arg>

<command><link linkend="mono">mono</link></command>
<arg choice="plain">
<option>index</option>
</arg>
<arg choice="plain">
<replaceable class="parameter">attribute</replaceable>
</arg>
<arg choice="plain">
<replaceable class="parameter">pattern</replaceable>
</arg>

<command><link linkend="mono">unmono</link></command>
<group choice="req">
<arg choice="plain">
<option>index</option>
</arg>
<arg choice="plain">
<option>header</option>
</arg>
<arg choice="plain">
<option>body</option>
</arg>
</group>
<group choice="req">
<arg choice="plain">
<replaceable class="parameter">*</replaceable>
</arg>
<arg choice="plain" rep="repeat">
<replaceable class="parameter">pattern</replaceable>
</arg>
</group>
</cmdsynopsis>
</listitem>

<listitem>
<cmdsynopsis>
<command><link linkend="my-hdr">my&lowbar;hdr</link></command>
<arg choice="plain">
<replaceable class="parameter">string</replaceable>
</arg>

<command><link linkend="my-hdr">unmy&lowbar;hdr</link></command>
<group choice="req">
<arg choice="plain">
<replaceable class="parameter">*</replaceable>
</arg>
<arg choice="plain" rep="repeat">
<replaceable class="parameter">field</replaceable>
</arg>
</group>
</cmdsynopsis>
</listitem>

<listitem>
<cmdsynopsis>
<command><link linkend="push">push</link></command>
<arg choice="plain">
<replaceable class="parameter">string</replaceable>
</arg>
</cmdsynopsis>
</listitem>

<listitem>
<cmdsynopsis>
<command><link linkend="save-hook">save-hook</link></command>
<arg choice="plain">
<replaceable class="parameter">&lsqb;!&rsqb;pattern</replaceable>
</arg>
<arg choice="plain">
<replaceable class="parameter">mailbox</replaceable>
</arg>
</cmdsynopsis>
</listitem>

<listitem>
<cmdsynopsis>
<command><link linkend="score">score</link></command>
<arg choice="plain">
<replaceable class="parameter">pattern</replaceable>
</arg>
<arg choice="plain">
<replaceable class="parameter">value</replaceable>
</arg>

<command><link linkend="score">unscore</link></command>
<group choice="req">
<arg choice="plain">
<replaceable class="parameter">*</replaceable>
</arg>
<arg choice="plain" rep="repeat">
<replaceable class="parameter">pattern</replaceable>
</arg>
</group>
</cmdsynopsis>
</listitem>

<listitem>
<cmdsynopsis>
<command><link linkend="reply-hook">reply-hook</link></command>
<arg choice="plain">
<replaceable class="parameter">&lsqb;!&rsqb;pattern</replaceable>
</arg>
<arg choice="plain">
<replaceable class="parameter">command</replaceable>
</arg>
</cmdsynopsis>
</listitem>

<listitem>
<cmdsynopsis>
<command><link linkend="send-hook">send-hook</link></command>
<arg choice="plain">
<replaceable class="parameter">&lsqb;!&rsqb;pattern</replaceable>
</arg>
<arg choice="plain">
<replaceable class="parameter">command</replaceable>
</arg>
</cmdsynopsis>
</listitem>

<listitem>
<cmdsynopsis>
<command><link linkend="send2-hook">send2-hook</link></command>
<arg choice="plain">
<replaceable class="parameter">&lsqb;!&rsqb;pattern</replaceable>
</arg>
<arg choice="plain">
<replaceable class="parameter">command</replaceable>
</arg>
</cmdsynopsis>
</listitem>

<listitem>
<cmdsynopsis>
<command><link linkend="set">set</link></command>
<group choice="req">
<arg choice="plain">
<group choice="opt">
<arg choice="plain"><option>no</option></arg>
<arg choice="plain"><option>inv</option></arg>
</group>
<replaceable class="parameter">variable</replaceable>
</arg>
<arg choice="plain">
<replaceable class="parameter">variable=value</replaceable>
</arg>
</group>
<arg choice="opt" rep="repeat"></arg>

<command><link linkend="set">toggle</link></command>
<arg choice="plain">
<replaceable class="parameter">variable</replaceable>
</arg>
<arg choice="opt" rep="repeat">
<replaceable class="parameter">variable</replaceable>
</arg>

<command><link linkend="set">unset</link></command>
<arg choice="plain">
<replaceable class="parameter">variable</replaceable>
</arg>
<arg choice="opt" rep="repeat">
<replaceable class="parameter">variable</replaceable>
</arg>

<command><link linkend="set">reset</link></command>
<arg choice="plain">
<replaceable class="parameter">variable</replaceable>
</arg>
<arg choice="opt" rep="repeat">
<replaceable class="parameter">variable</replaceable>
</arg>
</cmdsynopsis>
</listitem>

<listitem>
<cmdsynopsis>
<command><link linkend="source">source</link></command>
<arg choice="plain">
<replaceable class="parameter">filename</replaceable>
</arg>
</cmdsynopsis>
</listitem>

<listitem>
<cmdsynopsis>
<command><link linkend="spam">spam</link></command>
<arg choice="plain">
<replaceable class="parameter">pattern</replaceable>
</arg>
<arg choice="plain">
<replaceable class="parameter">format</replaceable>
</arg>

<command><link linkend="spam">nospam</link></command>
<group choice="req">
<arg choice="plain">
<replaceable class="parameter">*</replaceable>
</arg>
<arg choice="plain">
<replaceable class="parameter">pattern</replaceable>
</arg>
</group>
</cmdsynopsis>
</listitem>

<listitem>
<cmdsynopsis>
<command><link linkend="subscribe">subscribe</link></command>
<arg choice="opt" rep="repeat">
<option>-group</option>
<replaceable class="parameter">name</replaceable>
</arg>
<arg choice="plain">
<replaceable class="parameter">regexp</replaceable>
</arg>
<arg choice="opt" rep="repeat">
<replaceable class="parameter">regexp</replaceable>
</arg>

<command><link linkend="subscribe">unsubscribe</link></command>
<arg choice="opt" rep="repeat">
<option>-group</option>
<replaceable>name</replaceable>
</arg>
<group choice="req">
<arg choice="plain">
<replaceable class="parameter">*</replaceable>
</arg>
<arg choice="plain" rep="repeat">
<replaceable class="parameter">regexp</replaceable>
</arg>
</group>
</cmdsynopsis>
</listitem>

<listitem>
<cmdsynopsis>
<command><link linkend="unhook">unhook</link></command>
<group choice="req">
<arg choice="plain">
<replaceable class="parameter">*</replaceable>
</arg>
<arg choice="plain">
<replaceable class="parameter">hook-type</replaceable>
</arg>
</group>
</cmdsynopsis>
</listitem>

</itemizedlist>

</sect1>

<sect1 id="variables">
<title>Configuration Variables</title>