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
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1" />
<title>getmail Documentation</title>
<style type="text/css" media="all">@import "getmail.css";</style>
<meta name="author" content="Charles Cazabon" />
</head>
<body id="top">
<div class="body">
<h2 id="docs">getmail Documentation</h2>
<p>
This is the formal documentation for getmail. If your question is not
answered here or in the <a href="faq.html#faq">Frequently Asked Questions</a>,
please subscribe to the <a href="getmail.html#maillist">mailing list</a>.
</p>
<h3 id="docs-about"><a href="#docs">About this document</a></h3>
<p>
The official location of this document is
<a href="http://www.qcc.ca/~charlesc/software/getmail-3.0/docs.html">http://www.qcc.ca/~charlesc/software/getmail-3.0/docs.html</a>.
For easy navigation, all headings in the HTML version of this document are
links to their parent heading.
</p>
<h3 id="toc"><a href="#docs">Table of Contents</a></h3>
<ol>
<li>
<a href="#install">Installing getmail</a>
</li>
<li>
<a href="#configure">Configuring getmail</a>
<ul>
<li>
<a href="#getmailrc">Configuration file</a>
</li>
<li>
<a href="#account-types">POP3 account types</a>
<ul>
<li>
<a href="#account-types-regular">Regular POP3 mailboxes</a>
</li>
<li>
<a href="#account-types-domain">POP3 domain mailboxes</a>
</li>
</ul>
</li>
<li>
<a href="#delivery-targets">Message delivery targets</a>
</li>
</ul>
</li>
<li>
<a href="#directives">getmailrc directives</a>
</li>
<li>
<a href="#run">Running getmail</a>
</li>
<li>
<a href="#commandline">Commandline options</a>
</li>
</ol>
<!--
***********************************************************************
-->
<h3 id="install"><a href="#toc">Installing getmail</a></h3>
<p>Follow these steps to install getmail:</p>
<ol>
<li>
<a href="download.html#download">Download</a> getmail.
</li>
<li>
Unpack the tarball.
<pre class="sample">tar xzf getmail-<em>version</em>.tar.gz</pre>
</li>
<li>
Copy the contents to a suitable location:
<pre class="sample">mkdir /usr/lib/getmail
cp -a getmail-<em>version</em>/* /usr/lib/getmail/
</pre>
You can install getmail in your home directory or elsewhere if you prefer. If
you use a directory other than <span class="sample">/usr/lib/getmail/</span>,
change the definition of <span class="sample">GETMAILPATH</span> in the <span
class="sample">getmail</span> wrapper script or ensure the directory you choose
is in your <span class="sample">PYTHONPATH</span> environment variable.
</li>
<li>
Copy the getmail helper script to a location in your <span class="sample">PATH</span>, and
ensure it is executable:
<pre class="sample">cp -a getmail-<em>version</em>/getmail /usr/bin/
chmod 755 /usr/bin/getmail</pre>
</li>
</ol>
<!--
***********************************************************************
-->
<h3 id="configure"><a href="#toc">Configuring getmail</a></h3>
<ol>
<li>
Create a getmail configuration/data directory in your
home directory:
<pre class="sample">mkdir ~/.getmail</pre>
You can use another path or directory name, but getmail
assumes this name by default. If you choose something
different, you will need to specify its name on the getmail
command line with the <a href="#cmdline-getmaildir">--getmaildir</a>
option.
</li>
<li>
Create a configuration file named <span class="sample">getmailrc</span> in the directory you
created in step 1 above (see the section <a href="#getmailrc">Configuration file</a> below
for details). You can use another file name or path, but
getmail assumes this name by default. If you choose something
different, you will need to specify its name on the getmail command
line with the <a href="#cmdline-rcfile">--rcfile</a> option.
</li>
</ol>
<h4 id="getmailrc"><a href="#configure">Configuration file</a></h4>
<p>
A getmail configuration file (typically named <span class="sample">getmailrc</span>,
and located in <span class="sample">$HOME/.getmail/</span>) looks similar to an MS-Windows <span class="sample">.INI</span>
file. For security reasons, your getmailrc file must not be group- or world-writable.
getmail will refuse to run if it finds your getmailrc file is writable by
others.
</p>
<p>
The file is broken into sections. Each section starts with an arbitrary label surrounded by square brackets:
</p>
<pre class="sample">[section name]</pre>
<p>
A section then contains one or more lines in <span class="sample">name = value</span> format. Values containing whitespace
must be surrounded with single- or double-quotes. The pound sign (<span class="sample">#</span>)
introduces a comment, which continues until the end of the line.
</p>
<pre class="sample">foo = 42
bar = "string value containing spaces"
baz = "" # This is a comment; baz is an empty value
</pre>
<p>
To include a pound sign in an option
value, quote it. Percent signs (<span class="sample">%</span>) must be doubled; for example, if you
want to specify a password of <span class="sample">foo%bar</span>, use the following:
</p>
<pre class="sample">password = foo%%bar
</pre>
<p>
The special section <span class="sample">[default]</span> must be the first section in the file; it supplies default values for
options in other sections.
For example, to set the option <span class="sample">verbose</span> to <span class="sample">1</span>
for all following sections, you could put it in the <span class="sample">[default]</span> section:
</p>
<pre class="sample">[default]
verbose = 1
[my home account]
username = foobar
password = "my password"
…
[my work account]
username = foobar
password = "my password"
…
</pre>
<p>
getmail ignores whitespace surrounding the <span class="sample">=</span> sign. The following
lines are equivalent:
</p>
<pre class="sample">account = joe.bloggs
account=joe.bloggs
account= joe.bloggs
</pre>
<p>
Option values containing single or double quote characters can be quoted with
the other character:
</p>
<pre class="sample">password = "this is a more 'secure' password"</pre>
<p>
To un-set an option taking a string value, set it to the empty string:
</p>
<pre class="sample">message_log = "" # Previously set to /var/log/getmail; turn it off for this account</pre>
<p>
Other sections in a getmail configuration file represent POP3 accounts
to retrieve mail from, one per account. The section name is unimportant,
but must be unique. An example account section might look like this:
</p>
<pre class="sample">[Home ISP account]
server = mailhost.isp.tld
username = brenda.bjorn
password = "my mail password"
postmaster = ~brendab/Maildir/ # Deliver all mail to the Maildir in my home directory</pre>
<p>
When getmail tries to determine the value of an option, it looks at the
following, in order, until it finds a match:
</p>
<ol>
<li>Options specified on the command line</li>
<li>Options specified in an account section of the getmail configuration file</li>
<li>Options specified in the [default] section of the getmail configuration file</li>
<li>getmail's built-in default value</li>
</ol>
<h4 id="account-types"><a href="#configure">POP3 Account types</a></h4>
<p>
There are two different types of POP3 email accounts:
</p>
<ul>
<li><a href="#account-types-regular">regular mailboxes</a></li>
<li><a href="#account-types-domain">domain mailboxes</a></li>
</ul>
<h5 id="account-types-regular"><a href="#account-types">Regular mailbox</a></h5>
<p>
This is a typical POP3 mailbox provided by an ISP for a single user. It
receives mail addressed to a single user (say,
<span class="sample">shannon.fotheringham@aqua.myisp.tld</span>).
For this type of account, the minimum configuration would be something like
this:
</p>
<pre class="sample">[My Aqua Account]
server = mailhost.aqua.myisp.tld
username = shannon.fotheringham
postmaster = ~shannonf/Maildir/</pre>
<p>
This <span class="sample">postmaster</span> directive tells getmail to deliver
all mail to Shannon's Maildir. Since a password was not configured, getmail
will prompt the user for it when run.
</p>
<h5 id="account-types-domain"><a href="#account-types">Domain mailbox</a></h5>
<p>
This type of POP3 account is typically provided by an ISP to a small company
or organization. It receives mail addressed to any user in a given domain.
For example, mail to <span class="sample">info@smallcompany.tld</span>,
<span class="sample">tgrieg@smallcompany.tld</span>, and
<span class="sample">sales@smallcompany.tld</span> all ends up in the same
POP3 domain mailbox.
</p>
<p>
getmail includes features to enable retrieval of mail from this type of
account, filter it according to who the mail was addressed to, and
deliver it to different destinations. A minimal configuration with this
type of setup would be something like
this:
</p>
<pre class="sample">[Company domain mailbox]
server = mailhost.largeisp.tld
username = small.company
password = RRt49slP32m
envelope_recipient = delivered-to:1
postmaster = ~tgrieg/Mail/postmaster-maildir/
local = tgrieg@smallcompany.tld,~tgrieg/Mail/personal-maildir/
local = info@smallcompany.tld,~bobf/Maildir/
local = sales@smallcompany.tld,~darlab/Maildir/
</pre>
<p>
The <span class="sample">local</span> directives tell getmail to deliver
mail for those users to their various mail spools on the system, and the
<span class="sample">postmaster</span> directive tells getmail to deliver any
mail which doesn't match any of the local directives somewhere else.
</p>
<p>
To make getmail sort mail (with <span class="sample">local</span> directives
like the above) based on the envelope recipient address, you
<strong>must</strong> either enable the <span class="sample">use_*env</span>
option (if your mailhost supports it) or use the <span
class="sample">envelope_recipient</span> directive.
</p>
<h4 id="delivery-targets"><a href="#configure">Message Delivery Targets</a></h4>
<p>
In a getmailrc file, <a href="#directive-postmaster">postmaster</a> and
<a href="#directive-local">local</a> directives contain message delivery
targets, which instruct getmail to delivery messages in a particular manner.
A message delivery target may be a qmail-style Maildir or an arbitrary command
(such as an external Message Delivery Agent or MDA).
</p>
<table class="summary">
<tr>
<th>Target Type</th><th>Syntax</th><th>Notes</th>
</tr>
<tr>
<td>Maildir</td><td>/path/to/Maildir/</td><td>Maildir targets must have a trailing slash</td>
</tr>
<tr>
<td>Command</td><td>|/path/to/command [arguments]</td><td>Command deliveries must start with a pipe (|). Remember to quote values containing whitespace.</td>
</tr>
</table>
<p>
Note the following restrictions:
</p>
<ul>
<li>getmail refuses to deliver to maildirs as root.</li>
</ul>
<p>
For command deliveries, getmail provides the following environment variables.
</p>
<ul>
<li>
<span class="sample">SENDER</span> contains the envelope sender address
as extracted from the Return-Path: header field or *ENV results.
</li>
<li>
<span class="sample">RECIPIENT</span> contains the envelope recipient address
as extracted from the user-configured <a href="#directive-envelope-recipient" class="sample">envelope_recipient</a> header field or <a href="#directive-use-*env" class="sample">*ENV results</a>.
</li>
<li>
<span class="sample">EXT</span> contains the extension portion of <span class="sample">RECIPIENT</span>
calculated with the user-supplied values of <a class="sample" href="#directive-extension-sep">extension_sep</a> and
<a class="sample" href="#directive-extension-depth">extension_depth</a> directives.
This is primarily useful for external MDAs such as <a href="http://tmda.net/">TMDA</a>.
</li>
</ul>
<p>
getmail will normally prepend messages with an mbox-style From_ line before delivering
them to an external command; to disable this behaviour, use the
<a href="#directive-fromline">command_add_fromline</a> directive.
</p>
<p>
Note the following restrictions:
</p>
<ul>
<li>getmail refuses to run external commands when running as root.</li>
<li>If an external command writes to stderr, getmail will consider
the delivery a failure. If you know your MDA can write to stderr
on a successful delivery,
either supply a <span class="sample">--quiet</span> option to the
MDA (if it supports such), or throw away or redirect stderr
in one of the following manners:
<pre class="sample">postmaster = "|/path/to/mda [options] 2>/dev/null"
postmaster = "|/path/to/mda [options] 2>&1"
</pre>
This will, of course, also work with delivery targets in
<span class="sample">local</span> directives.
</li>
<li>getmail will not create Maildirs if they do not exist.
You must create them prior to having getmail deliver mail to them.
Use maildirmake to create empty Maildirs.
</li>
<li>getmail requires write access to any Maildir you wish
to deliver mail to. This can be done by making the Maildirs group-writable
by the group you run getmail under, for example. There are other ways as well.
</li>
</ul>
<p>
Leading tilde characters (~) on paths will be expanded -- i.e. ~jason/Maildir/ likely
becomes /home/jason/Maildir/ on most systems.
</p>
<h4 id="directives"><a href="#run">getmailrc Directives</a></h4>
<p>
getmail understands the following getmailrc directives:
</p>
<table class="summary">
<tr>
<th>Directive</th><th>Optional?</th><th>Default</th><th>Summary</th>
</tr>
<tr>
<td colspan="4" class="subheader"><a href="#directive-server-config">POP3 Server Configuration</a></td>
</tr>
<tr>
<td class="listitem"><a href="#directive-server">server</a></td><td>No</td><td>None</td><td>POP3 server hostname</td>
</tr>
<tr>
<td class="listitem"><a href="#directive-port">port</a></td><td>Yes</td><td>110</td><td>POP3 server TCP port number</td>
</tr>
<tr>
<td class="listitem"><a href="#directive-timeout">timeout</a></td><td>Yes</td><td>180 seconds</td><td>POP3 server TCP timeout</td>
</tr>
<tr>
<td colspan="4" class="subheader"><a href="#directive-account-config">Account Configuration</a></td>
</tr>
<tr>
<td class="listitem"><a href="#directive-username">username</a></td><td>No</td><td>None</td><td>POP3 account username</td>
</tr>
<tr>
<td class="listitem"><a href="#directive-password">password</a></td><td>Yes</td><td>Prompt for password</td><td>POP3 account password</td>
</tr>
<tr>
<td class="listitem"><a href="#directive-apop">use_apop</a></td><td>Yes</td><td>0 (No)</td><td>Use POP3 APOP authentication</td>
</tr>
<tr>
<td colspan="4" class="subheader"><a href="#directive-message-format">Message Formatting</a></td>
</tr>
<tr>
<td class="listitem"><a href="#directive-no-delivered-to">no_delivered_to</a></td><td>Yes</td><td>0 (No)</td><td>Suppress addition of Delivered-To: header field</td>
</tr>
<tr>
<td class="listitem"><a href="#directive-no-received">no_received</a></td><td>Yes</td><td>0 (No)</td><td>Suppress addition of Received: header field</td>
</tr>
<tr>
<td colspan="4" class="subheader"><a href="#directive-delivery-targets">Message Delivery Targets</a></td>
</tr>
<tr>
<td class="listitem"><a href="#directive-postmaster">postmaster</a></td><td>No</td><td>None</td><td>Default message delivery target</td>
</tr>
<tr>
<td class="listitem"><a href="#directive-local">local</a></td><td>Yes</td><td>None</td><td>Header field pattern-matching delivery target for domain mailboxes</td>
</tr>
<tr>
<td class="listitem"><a href="#directive-envelope-recipient">envelope_recipient</a></td><td>Yes</td><td>None</td><td>Specify a header field the POP3 server records the envelope recipient address in.</td>
</tr>
<tr>
<td class="listitem"><a href="#directive-use-*env">use_*env</a></td><td>Yes</td><td>0 (No)</td><td>Use Demon's SPDS *ENV POP3 extension to retrieve message envelopes. Overrides envelope_recipient above.</td>
</tr>
<tr>
<td class="listitem"><a href="#directive-extension-sep">extension_sep</a></td><td>Yes</td><td>-</td><td>User extension address separator character</td>
</tr>
<tr>
<td class="listitem"><a href="#directive-extension-depth">extension_depth</a></td><td>Yes</td><td>1</td><td>User extension address base length</td>
</tr>
<tr>
<td class="listitem"><a href="#directive-fromline">command_add_fromline</a></td><td>Yes</td><td>1 (Yes)</td><td>Prepend command deliveries with mbox-style From_ line</td>
</tr>
<tr>
<td colspan="4" class="subheader"><a href="#directive-retrieval">Message Retrieval</a></td>
</tr>
<tr>
<td class="listitem"><a href="#directive-readall">readall</a></td><td>Yes</td><td>1 (Yes)</td><td>Retrieve all messages, or only previously unseen messages</td>
</tr>
<tr>
<td class="listitem"><a href="#directive-max-message-size">max_message_size</a></td><td>Yes</td><td>0 (No limit)</td><td>Do not retrieve messages larger than this setting</td>
</tr>
<tr>
<td class="listitem"><a href="#directive-max-messages-per-session">max_messages_per_session</a></td><td>Yes</td><td>0 (No limit)</td><td>Do not retrieve more than X messages</td>
</tr>
<tr>
<td class="listitem"><a href="#directive-delete">delete</a></td><td>Yes</td><td>0 (No)</td><td>Delete messages after retrieval</td>
</tr>
<tr>
<td class="listitem"><a href="#directive-delete-after">delete_after</a></td><td>Yes</td><td>0 (No)</td><td>Delete messages X days after retrieval</td>
</tr>
<tr>
<td colspan="4" class="subheader"><a href="#directive-behaviour">getmail Behaviour</a></td>
</tr>
<tr>
<td class="listitem"><a href="#directive-verbose">verbose</a></td><td>Yes</td><td>1 (Yes)</td><td>Show status messages while running</td>
</tr>
<tr>
<td class="listitem"><a href="#directive-message-log">message_log</a></td><td>Yes</td><td>None</td><td>Log message retrieval and delivery to file</td>
</tr>
</table>
<h5 id="directive-server-config"><a href="#directives">POP3 Server Configuration</a></h5>
<p>
The following directives are used to configure which POP3 servers
getmail will retrieve mail from.
</p>
<h6 id="directive-server"><a href="#directive-server-config">POP3 Server Hostname</a></h6>
<table class="directive">
<tr>
<td class="rowlabel">
Function
</td>
<td class="rowdata">
Specify POP3 server to connect to.
</td>
</tr>
<tr>
<td class="rowlabel">
Syntax
</td>
<td class="rowdata">
server = <span class="sample">hostname.domain.tld</span>
</td>
</tr>
<tr>
<td class="rowlabel">
Optional
</td>
<td class="rowdata">
No
</td>
</tr>
<tr>
<td class="rowlabel">
Default
</td>
<td class="rowdata">
None
</td>
</tr>
<tr>
<td class="rowlabel">
Commandline equivalent
</td>
<td class="rowdata">
None
</td>
</tr>
<tr>
<td class="rowlabel">
Examples
</td>
<td class="sample">
server = pop3.isp.com
</td>
</tr>
</table>
<h6 id="directive-port"><a href="#directive-server-config">POP3 TCP Port</a></h6>
<table class="directive">
<tr>
<td class="rowlabel">
Function
</td>
<td class="rowdata">
Specify TCP port on POP3 server to connect to.
</td>
</tr>
<tr>
<td class="rowlabel">
Syntax
</td>
<td class="rowdata">
port = <span class="sample">portnumber</span>
</td>
</tr>
<tr>
<td class="rowlabel">
Optional
</td>
<td class="rowdata">
Yes
</td>
</tr>
<tr>
<td class="rowlabel">
Default
</td>
<td class="rowdata">
110 (Default POP3 port)
</td>
</tr>
<tr>
<td class="rowlabel">
Commandline equivalent
</td>
<td class="rowdata">
None
</td>
</tr>
<tr>
<td class="rowlabel">
Examples
</td>
<td class="sample">
port = 8110
</td>
</tr>
</table>
<h6 id="directive-timeout"><a href="#directive-server-config">POP3 TCP timeout</a></h6>
<table class="directive">
<tr>
<td class="rowlabel">
Function
</td>
<td class="rowdata">
Specify the TCP timeout to use with an account.
</td>
</tr>
<tr>
<td class="rowlabel">
Syntax
</td>
<td class="rowdata">
timeout = <span class="sample">value (seconds)</span>
</td>
</tr>
<tr>
<td class="rowlabel">
Optional
</td>
<td class="rowdata">
Yes
</td>
</tr>
<tr>
<td class="rowlabel">
Default
</td>
<td class="rowdata">
180
</td>
</tr>
<tr>
<td class="rowlabel">
Commandline equivalent
</td>
<td class="rowdata">
--timeout = <span class="sample">value (seconds)</span>
</td>
</tr>
<tr>
<td class="rowlabel">
Examples
</td>
<td class="sample">
timeout = 360
</td>
</tr>
<tr>
<td class="rowlabel">
Note
</td>
<td class="sample">
The TCP timeout capabilities are enabled by the <span class="sample">
timeoutsocket.py</span> module by Timothy O'Malley. A copy of
timeoutsocket.py is included with getmail; however, getmail
will continue to function (without this capability) if
the timeoutsocket module is not present.
<pre>timeoutsocket.py Copyright 2000,2001 by Timothy O'Malley <timo@alum.mit.edu>
All Rights Reserved
Permission to use, copy, modify, and distribute this software
and its documentation for any purpose and without fee is hereby
granted, provided that the above copyright notice appear in all
copies and that both that copyright notice and this permission
notice appear in supporting documentation, and that the name of
Timothy O'Malley not be used in advertising or publicity
pertaining to distribution of the software without specific, written
prior permission.
Timothy O'Malley DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS, IN NO EVENT SHALL Timothy O'Malley BE LIABLE FOR
ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.</pre>
</td>
</tr>
</table>
<h5 id="directive-account-config"><a href="#directives">POP3 Account Configuration</a></h5>
<p>
The following directives are used to configure which POP3 accounts getmail will
retrieve mail from.
</p>
<h6 id="directive-username"><a href="#directive-account-config">POP3 account username</a></h6>
<table class="directive">
<tr>
<td class="rowlabel">
Function
</td>
<td class="rowdata">
Specify the account name for the POP3 server.
</td>
</tr>
<tr>
<td class="rowlabel">
Syntax
</td>
<td class="rowdata">
username = <span class="sample">user</span>
</td>
</tr>
<tr>
<td class="rowlabel">
Optional
</td>
<td class="rowdata">
No
</td>
</tr>
<tr>
<td class="rowlabel">
Default
</td>
<td class="rowdata">
None
</td>
</tr>
<tr>
<td class="rowlabel">
Commandline equivalent
</td>
<td class="rowdata">
None
</td>
</tr>
<tr>
<td class="rowlabel">
Examples
</td>
<td class="sample">
username = joe.bloggs<br />
username = joe.bloggs:vhost.example.net
</td>
</tr>
</table>
<h6 id="directive-password"><a href="#directive-account-config">POP3 account password</a></h6>
<table class="directive">
<tr>
<td class="rowlabel">
Function
</td>
<td class="rowdata">
Specify password to use with POP3 account
</td>
</tr>
<tr>
<td class="rowlabel">
Syntax
</td>
<td class="rowdata">
password = <span class="sample">password</span>
</td>
</tr>
<tr>
<td class="rowlabel">
Optional
</td>
<td class="rowdata">
Yes
</td>
</tr>
<tr>
<td class="rowlabel">
Default
</td>
<td class="rowdata">
Prompt for password
</td>
</tr>
<tr>
<td class="rowlabel">
Commandline equivalent
</td>
<td class="rowdata">
None
</td>
</tr>
<tr>
<td class="rowlabel">
Examples
</td>
<td class="sample">
password = "long password containing whitespace"<br />
password = foo_bar
</td>
</tr>
</table>
<h6 id="directive-apop"><a href="#directive-account-config">POP3 APOP authentication</a></h6>
<table class="directive">
<tr>
<td class="rowlabel">
Function
</td>
<td class="rowdata">
Use POP3 APOP authentication if available. getmail will exit
if APOP is configured but not supported by the server.
</td>
</tr>
<tr>
<td class="rowlabel">
Syntax
</td>
<td class="rowdata">
use_apop = <span class="sample">bool</span>
</td>
</tr>
<tr>
<td class="rowlabel">
Optional
</td>
<td class="rowdata">
Yes
</td>
</tr>
<tr>
<td class="rowlabel">
Default
</td>
<td class="rowdata">
0 (USER/PASS authentication)
</td>
</tr>
<tr>
<td class="rowlabel">
Commandline equivalent
</td>
<td class="rowdata">
None
</td>
</tr>
<tr>
<td class="rowlabel">
Examples
</td>
<td class="sample">
use_apop = 1<br />
use_apop = 0
</td>
</tr>
</table>
<h5 id="directive-message-format"><a href="#directives">Message Formatting</a></h5>
<p>
The following directives are specified in any getmailrc section, and are
used to configure how getmail will format messages that it retrieves.
</p>
<h6 id="directive-no-delivered-to"><a href="#directive-message-format">Delivered-To: header field suppression</a></h6>
<table class="directive">
<tr>
<td class="rowlabel">
Function
</td>
<td class="rowdata">
Suppress the addition of a Delivered-To: header field to messages
that getmail retrieves.
</td>
</tr>
<tr>
<td class="rowlabel">
Syntax
</td>
<td class="rowdata">
no_delivered_to = <span class="sample">bool</span>
</td>
</tr>
<tr>
<td class="rowlabel">
Optional
</td>
<td class="rowdata">
Yes
</td>
</tr>
<tr>
<td class="rowlabel">
Default
</td>
<td class="rowdata">
0 (No)
</td>
</tr>
<tr>
<td class="rowlabel">
Commandline equivalent
</td>
<td class="rowdata">
None
</td>
</tr>
<tr>
<td class="rowlabel">
Examples
</td>
<td class="sample">
no_delivered_to = 1<br />
no_delivered_to = 0
</td>
</tr>
</table>
<h6 id="directive-no-received"><a href="#directive-message-format">Received: header field suppression</a></h6>
<table class="directive">
<tr>
<td class="rowlabel">
Function
</td>
<td class="rowdata">
Suppress the addition of a Received: header field to messages
that getmail retrieves.
</td>
</tr>
<tr>
<td class="rowlabel">
Syntax
</td>
<td class="rowdata">
no_received = <span class="sample">bool</span>
</td>
</tr>
<tr>
<td class="rowlabel">
Optional
</td>
<td class="rowdata">
Yes
</td>
</tr>
<tr>
<td class="rowlabel">
Default
</td>
<td class="rowdata">
0 (No)
</td>
</tr>
<tr>
<td class="rowlabel">
Commandline equivalent
</td>
<td class="rowdata">
None
</td>
</tr>
<tr>
<td class="rowlabel">
Examples
</td>
<td class="sample">
no_received = 1<br />
no_received = 0
</td>
</tr>
</table>
<h5 id="directive-delivery-targets"><a href="#directives">Message Delivery Targets</a></h5>
<p>
The following directives are specified in any getmailrc section, and are
used to configure where getmail will deliver retrieved messages. Also see
the <a href="#delivery-targets">section on message delivery targets</a>.
</p>
<h6 id="directive-postmaster"><a href="#directive-delivery-targets">Default delivery target</a></h6>
<table class="directive">
<tr>
<td class="rowlabel">
Function
</td>
<td class="rowdata">
In non-domain mailbox operation, specifies the delivery target
for all retrieved mail.
<br />
<br />
In domain mailbox operation, this specifies the default delivery
target for all retrieved messages which are not handled by a
matching <a href="#directive-local">local</a> directive.
</td>
</tr>
<tr>
<td class="rowlabel">
Syntax
</td>
<td class="rowdata">
postmaster = <span class="sample">target</span>
</td>
</tr>
<tr>
<td class="rowlabel">
Optional
</td>
<td class="rowdata">
No
</td>
</tr>
<tr>
<td class="rowlabel">
Default
</td>
<td class="rowdata">
None
</td>
</tr>
<tr>
<td class="rowlabel">
Commandline equivalent
</td>
<td class="rowdata">
None
</td>
</tr>
<tr>
<td class="rowlabel">
Examples
</td>
<td class="sample">
postmaster = /home/joe/Maildir/<br />
postmaster = "|/usr/local/bin/my_mda -f foo -a all -b gone /home/postmaster/.mdarc"
</td>
</tr>
</table>
<h6 id="directive-local"><a href="#directive-delivery-targets">Header field pattern matching delivery target</a></h6>
<table class="directive">
<tr>
<td class="rowlabel">
Function
</td>
<td class="rowdata">
Specify the destination for retrieved messages which have an envelope recipient
address which matches a given pattern. getmail will match the specified Perl-
compatible extended regular expression against the envelope recipient address
(retrieved using <a href="#directive-use-*env"><span
class="sample">*ENV</span></a> support or found in the header field specified
with the <a href="#directive-recipient- header">envelope_recipient</a> directive).
If a match is found, the message will be delivered to the specified <a
href="#delivery-targets">target</a>. If multiple local directives contain
matching patterns, each matching target will receive a copy of the message. If
there are no local directives, or no match is found, the message will be
delivered according to the <a href="#directive- postmaster">default delivery
target</a>.<br />
<br />
If you do not understand Perl-compatible regular expressions,
just use email addresses here. They will work in virtually all
cases.<br />
<br />
Use multiple local directives to filter mail retrieved from a
domain mailbox to multiple local user accounts.<br />
<br />
<strong class="warning">Note that <span class="sample">local</span>
directives can only be used in multidrop mode.</strong>
</td>
</tr>
<tr>
<td class="rowlabel">
Syntax
</td>
<td class="rowdata">
local = <span class="sample">pattern,target</span>
</td>
</tr>
<tr>
<td class="rowlabel">
Optional
</td>
<td class="rowdata">
Yes
</td>
</tr>
<tr>
<td class="rowlabel">
Default
</td>
<td class="rowdata">
None
</td>
</tr>
<tr>
<td class="rowlabel">
Commandline equivalent
</td>
<td class="rowdata">
None
</td>
</tr>
<tr>
<td class="rowlabel">
Examples
</td>
<td class="sample">
local = joe@isp.tld,~joe/Maildir/<br />
local = brenda@homeisp.tld,/home/brenda/Mail/personal/<br />
local = brenda@workisp.tld,/home/brenda/Mail/work/<br />
local = "^(joe|fred)@company\.(tld|dom.tld)$,|/path/to/mda -opts"
</td>
</tr>
</table>
<h6 id="directive-envelope-recipient"><a href="#directive-delivery-targets">Recipient header field specification</a></h6>
<table class="directive">
<tr>
<td class="rowlabel">
Function
</td>
<td class="rowdata">
Extract envelope recipient address from listed header field.<br />
<br />
This directive enables domain mailbox operation and is useful
only if the POP3 server records envelope recipient addresses in
a specific header field
(i.e. Delivered-To: or X-Envelope-To:).
<br />
Use it if wish to process mail from a domain mailbox, sorting
and delivering it to multiple local user accounts using <a
href="#directive-local">local</a> directives.
</td>
</tr>
<tr>
<td class="rowlabel">
Syntax
</td>
<td class="rowdata">
envelope_recipient = <span class="sample">fieldname:fieldnum</span><br />
fieldnum refers to the occurrence of that header field; the value
<span class="sample">2</span> is the second occurrence of fieldname.
</td>
</tr>
<tr>
<td class="rowlabel">
Optional
</td>
<td class="rowdata">
Yes
</td>
</tr>
<tr>
<td class="rowlabel">
Default
</td>
<td class="rowdata">
None
</td>
</tr>
<tr>
<td class="rowlabel">
Commandline equivalent
</td>
<td class="rowdata">
None
</td>
</tr>
<tr>
<td class="rowlabel">
Examples
</td>
<td class="sample">
envelope_recipient = Delivered-To:2<br />
envelope_recipient = X-Envelope-To:1
</td>
</tr>
</table>
<h6 id="directive-use-*env"><a href="#directive-delivery-targets">SPDS *ENV POP3 Extension</a></h6>
<table class="directive">
<tr>
<td class="rowlabel">
Function
</td>
<td class="rowdata">
Retrieve envelope sender and recipient addresses from the server using
Demon's SPDS *ENV POP3 extension (described at
<a href="http://www.demon.net/helpdesk/products/mail/sdps-tech.shtml">http://www.demon.net/helpdesk/products/mail/sdps-tech.shtml</a>).<br />
<br />
This directive enables domain mailbox operation and overrides the <span class="sample">envelope_recipient</span>
directive.
</td>
</tr>
<tr>
<td class="rowlabel">
Syntax
</td>
<td class="rowdata">
use_*env = <span class="sample">bool</span>
</td>
</tr>
<tr>
<td class="rowlabel">
Optional
</td>
<td class="rowdata">
Yes
</td>
</tr>
<tr>
<td class="rowlabel">
Default
</td>
<td class="rowdata">
0 (No)
</td>
</tr>
<tr>
<td class="rowlabel">
Commandline equivalent
</td>
<td class="rowdata">
None
</td>
</tr>
<tr>
<td class="rowlabel">
Examples
</td>
<td class="sample">
use_*env = 1<br />
use_*env = 0
</td>
</tr>
</table>
<h6 id="directive-extension-sep"><a href="#directive-delivery-targets">User address extension separator character</a></h6>
<table class="directive">
<tr>
<td class="rowlabel">
Function
</td>
<td class="rowdata">
Determine which part of a recipient address is the extension
to the base address.<br />
<br />
This directive is mostly useful if the POP3 server records
envelope recipient addresses in a specific header field
(i.e. Delivered-To: or X-Envelope-To:), and you wish to deliver
mail using <a href="http://tmda.sourceforge.net/">TMDA</a> or
another filtering MDA.<br />
<br />
getmail will export the detected envelope recipient address in the environment
variable <span class="sample">RECIPIENT</span>.
It will then split the local-part of the address at the first
occurrence of this character (default: <span class="sample">-</span>), and
export anything after it as the environment variable
<span class="sample">EXT</span>.<br />
<br />
Note that you will still need a wrapper script around your
filtering MDA; getmail will consider a delivery failed if the
MDA returns non-zero. This is left as an excercise for the
reader/user of TMDA.
</td>
</tr>
<tr>
<td class="rowlabel">
Syntax
</td>
<td class="rowdata">
extension_sep = <span class="sample">character</span>
</td>
</tr>
<tr>
<td class="rowlabel">
Optional
</td>
<td class="rowdata">
Yes
</td>
</tr>
<tr>
<td class="rowlabel">
Default
</td>
<td class="rowdata">
-
</td>
</tr>
<tr>
<td class="rowlabel">
Commandline equivalent
</td>
<td class="rowdata">
None
</td>
</tr>
<tr>
<td class="rowlabel">
Examples
</td>
<td class="sample">
extension_sep = +<br />
extension_sep = -
</td>
</tr>
</table>
<h6 id="directive-extension-depth"><a href="#directive-delivery-targets">User address extension base length/depth</a></h6>
<table class="directive">
<tr>
<td class="rowlabel">
Function
</td>
<td class="rowdata">
Determine which part of a recipient address is the extension
to the base address.<br />
<br />
This directive is mostly useful if the POP3 server records
envelope recipient addresses in a specific header field
(i.e. Delivered-To: or X-Envelope-To:), and you wish to deliver
mail using <a href="http://tmda.sourceforge.net/">TMDA</a> or
another filtering MDA.<br />
<br />
If you are using a <a href="#directive-local">local
directive</a> to configure delivery of mail per-recipient,
getmail will export the detected envelope
recipient address in the environment variable <span class="sample">RECIPIENT</span>.
It will then remove the base part of the address at the
<span class="sample">extension_depth</span> occurrence of the
extension separator character.
</td>
</tr>
<tr>
<td class="rowlabel">
Syntax
</td>
<td class="rowdata">
extension_depth = <span class="sample">count</span>
</td>
</tr>
<tr>
<td class="rowlabel">
Optional
</td>
<td class="rowdata">
Yes
</td>
</tr>
<tr>
<td class="rowlabel">
Default
</td>
<td class="rowdata">
1
</td>
</tr>
<tr>
<td class="rowlabel">
Commandline equivalent
</td>
<td class="rowdata">
None
</td>
</tr>
<tr>
<td class="rowlabel">
Examples
</td>
<td class="sample">
extension_depth = 2
</td>
</tr>
</table>
<h6 id="directive-fromline"><a href="#directive-delivery-targets">Command delivery From_ line prepend</a></h6>
<table class="directive">
<tr>
<td class="rowlabel">
Function
</td>
<td class="rowdata">
Specify whether to prepend command deliveries with an mbox-style From_ line.
</td>
</tr>
<tr>
<td class="rowlabel">
Syntax
</td>
<td class="rowdata">
command_add_fromline = <span class="sample">bool</span>
</td>
</tr>
<tr>
<td class="rowlabel">
Optional
</td>
<td class="rowdata">
Yes
</td>
</tr>
<tr>
<td class="rowlabel">
Default
</td>
<td class="rowdata">
1 (Yes)
</td>
</tr>
<tr>
<td class="rowlabel">
Commandline equivalent
</td>
<td class="rowdata">
None
</td>
</tr>
<tr>
<td class="rowlabel">
Examples
</td>
<td class="sample">
command_add_fromline = 0
</td>
</tr>
</table>
<h5 id="directive-retrieval"><a href="#directives">Message Retrieval</a></h5>
<p>
The following directives are specified in any getmailrc section, and are
used to configure how getmail will retrieve messages.
</p>
<h6 id="directive-readall"><a href="#directive-retrieval">Retrieve new messages / retrieve all messages</a></h6>
<table class="directive">
<tr>
<td class="rowlabel">
Function
</td>
<td class="rowdata">
Select whether to retrieve all messages, or only messages which
have previously not been seen by getmail.
</td>
</tr>
<tr>
<td class="rowlabel">
Syntax
</td>
<td class="rowdata">
readall = <span class="sample">bool</span>
</td>
</tr>
<tr>
<td class="rowlabel">
Optional
</td>
<td class="rowdata">
Yes
</td>
</tr>
<tr>
<td class="rowlabel">
Default
</td>
<td class="rowdata">
1 (Retrieve all messages)
</td>
</tr>
<tr>
<td class="rowlabel">
Commandline equivalent
</td>
<td class="rowdata">
--all (readall = 1)<br />
--new (readall = 0)
</td>
</tr>
<tr>
<td class="rowlabel">
Examples
</td>
<td class="sample">
readall = 1<br />
readall = 0
</td>
</tr>
</table>
<h6 id="directive-max-message-size"><a href="#directive-retrieval">Maximum message size to retrieve</a></h6>
<table class="directive">
<tr>
<td class="rowlabel">
Function
</td>
<td class="rowdata">
Specify a maximum message size to retrieve. Messages larger
than this will be left on the server and not retrieved.
</td>
</tr>
<tr>
<td class="rowlabel">
Syntax
</td>
<td class="rowdata">
max_message_size = <span class="sample">value (bytes)</span>
</td>
</tr>
<tr>
<td class="rowlabel">
Optional
</td>
<td class="rowdata">
Yes
</td>
</tr>
<tr>
<td class="rowlabel">
Default
</td>
<td class="rowdata">
0 (No limit)
</td>
</tr>
<tr>
<td class="rowlabel">
Commandline equivalent
</td>
<td class="rowdata">
None
</td>
</tr>
<tr>
<td class="rowlabel">
Examples
</td>
<td class="sample">
max_message_size = 2000000<br />
max_message_size = 150000
</td>
</tr>
</table>
<h6 id="directive-max-messages-per-session"><a href="#directive-retrieval">Maximum number of messages to retrieve per session</a></h6>
<table class="directive">
<tr>
<td class="rowlabel">
Function
</td>
<td class="rowdata">
Specify a maximum number of messages to retrieve and process before getmail exits.
If more than this number of messages are eligible for retrieval, they will be
left on the server for the next time getmail is run.
</td>
</tr>
<tr>
<td class="rowlabel">
Syntax
</td>
<td class="rowdata">
max_messages_per_session = <span class="sample">value (number)</span>
</td>
</tr>
<tr>
<td class="rowlabel">
Optional
</td>
<td class="rowdata">
Yes
</td>
</tr>
<tr>
<td class="rowlabel">
Default
</td>
<td class="rowdata">
0 (No limit)
</td>
</tr>
<tr>
<td class="rowlabel">
Commandline equivalent
</td>
<td class="rowdata">
None
</td>
</tr>
<tr>
<td class="rowlabel">
Examples
</td>
<td class="sample">
max_messages_per_session = 10<br />
</td>
</tr>
</table>
<h6 id="directive-delete"><a href="#directive-retrieval">Delete messages from server after retrieval</a></h6>
<table class="directive">
<tr>
<td class="rowlabel">
Function
</td>
<td class="rowdata">
Delete messages from the POP3 server after retrieval.
</td>
</tr>
<tr>
<td class="rowlabel">
Syntax
</td>
<td class="rowdata">
delete = <span class="sample">bool</span>
</td>
</tr>
<tr>
<td class="rowlabel">
Optional
</td>
<td class="rowdata">
Yes
</td>
</tr>
<tr>
<td class="rowlabel">
Default
</td>
<td class="rowdata">
0 (Do not delete)
</td>
</tr>
<tr>
<td class="rowlabel">
Commandline equivalent
</td>
<td class="rowdata">
--dont-delete (delete = 0)<br />
--delete (delete = 1)
</td>
</tr>
<tr>
<td class="rowlabel">
Examples
</td>
<td class="sample">
delete = 1<br />
delete = 0
</td>
</tr>
</table>
<h6 id="directive-delete-after"><a href="#directive-retrieval">Delete messages X days after retrieval</a></h6>
<table class="directive">
<tr>
<td class="rowlabel">
Function
</td>
<td class="rowdata">
Delete messages a specified number of days after they are first
retrieved.<br />
<br />
Note: delete overrides delete_after.
</td>
</tr>
<tr>
<td class="rowlabel">
Syntax
</td>
<td class="rowdata">
delete_after = <span class="sample">value (days)</span>
</td>
</tr>
<tr>
<td class="rowlabel">
Optional
</td>
<td class="rowdata">
Yes
</td>
</tr>
<tr>
<td class="rowlabel">
Default
</td>
<td class="rowdata">
0 (Do not use delete_after)
</td>
</tr>
<tr>
<td class="rowlabel">
Commandline equivalent
</td>
<td class="rowdata">
None
</td>
</tr>
<tr>
<td class="rowlabel">
Examples
</td>
<td class="sample">
delete_after = 3<br />
delete_after = 180
</td>
</tr>
</table>
<h5 id="directive-behaviour"><a href="#directives">getmail Behaviour</a></h5>
<p>
The following directives are specified in any getmailrc section, and are
used to control other aspects of getmail's behaviour.
</p>
<h6 id="directive-verbose"><a href="#directive-behaviour">Verbosity</a></h6>
<table class="directive">
<tr>
<td class="rowlabel">
Function
</td>
<td class="rowdata">
Specify whether getmail writes status and informational messages
to stdout while running.
</td>
</tr>
<tr>
<td class="rowlabel">
Syntax
</td>
<td class="rowdata">
verbose = <span class="sample">bool</span>
</td>
</tr>
<tr>
<td class="rowlabel">
Optional
</td>
<td class="rowdata">
Yes
</td>
</tr>
<tr>
<td class="rowlabel">
Default
</td>
<td class="rowdata">
1 (Verbose)
</td>
</tr>
<tr>
<td class="rowlabel">
Commandline equivalent
</td>
<td class="rowdata">
--verbose (verbose = 1)<br />
--quiet (verbose = 0)
</td>
</tr>
<tr>
<td class="rowlabel">
Examples
</td>
<td class="sample">
verbose = 1<br />
verbose = 0
</td>
</tr>
</table>
<h6 id="directive-message-log"><a href="#directive-behaviour">Message Logging</a></h6>
<table class="directive">
<tr>
<td class="rowlabel">
Function
</td>
<td class="rowdata">
Specify whether getmail writes message retrieval and delivery
information to a log file. Set to the empty string to
disable logging. This value is expanded for leading "~"
or "~user".
</td>
</tr>
<tr>
<td class="rowlabel">
Syntax
</td>
<td class="rowdata">
message_log = <span class="sample">file</span>
</td>
</tr>
<tr>
<td class="rowlabel">
Optional
</td>
<td class="rowdata">
Yes
</td>
</tr>
<tr>
<td class="rowlabel">
Default
</td>
<td class="rowdata">
None
</td>
</tr>
<tr>
<td class="rowlabel">
Commandline equivalent
</td>
<td class="rowdata">
None
</td>
</tr>
<tr>
<td class="rowlabel">
Examples
</td>
<td class="sample">
message_log = /var/log/getmail<br />
message_log = ""
</td>
</tr>
</table>
<!--
***********************************************************************
-->
<h3 id="run"><a href="#toc">Running getmail</a></h3>
<p>
Run the getmail helper script you installed earlier:
</p>
<pre class="sample">getmail</pre>
<p>
By default, getmail will read in the default getmailrc file
(<span class="sample">$HOME/.getmail/getmailrc</span>) and begin retrieving mail.
</p>
<p>
You can also supply <a href="#commandline">commandline options</a>.
For a brief summary of usage and commandline options, run:
</p>
<pre class="sample">getmail --help</pre>
<h4 id="commandline"><a href="#run">getmail Commandline Options</a></h4>
<p>getmail understands the following commandline options:</p>
<table class="summary">
<tr>
<th>Long Form</th><th>Short Form</th><th>Summary</th>
</tr>
<tr>
<td><a href="#cmdline-help">--help</a></td><td><a href="#cmdline-help">-h</a></td><td>Display usage and default option values and exit</td>
</tr>
<tr>
<td><a href="#cmdline-getmaildir">--getmaildir path</a></td><td><a href="#cmdline-getmaildir">-g path</a></td><td>Use path as getmail configuration/data directory</td>
</tr>
<tr>
<td><a href="#cmdline-rcfile">--rcfile file</a></td><td><a href="#cmdline-rcfile">-r file</a></td><td>Use file as getmailrc configuration file</td>
</tr>
<tr>
<td><a href="#cmdline-quiet">--quiet</a></td><td><a href="#cmdline-quiet">-q</a></td><td>No status output</td>
</tr>
<tr>
<td><a href="#cmdline-verbose">--verbose</a></td><td><a href="#cmdline-verbose">-v</a></td><td>Verbose status output</td>
</tr>
<tr>
<td><a href="#cmdline-message-log">--message-log file</a></td><td><a href="#cmdline-message-log">-m file</a></td><td>Log getmail operations to file</td>
</tr>
<tr>
<td><a href="#cmdline-all">--all</a></td><td><a href="#cmdline-all">-a</a></td><td>Retrieve all messages</td>
</tr>
<tr>
<td><a href="#cmdline-new">--new</a></td><td><a href="#cmdline-new">-n</a></td><td>Retrieve only new messages</td>
</tr>
<tr>
<td><a href="#cmdline-delete">--delete</a></td><td><a href="#cmdline-delete">-d</a></td><td>Delete messages after retrieval</td>
</tr>
<tr>
<td><a href="#cmdline-dont-delete">--dont-delete</a></td><td><a href="#cmdline-dont-delete">-l</a></td><td>Do not delete messages after retrieval</td>
</tr>
<tr>
<td><a href="#cmdline-timeout">--timeout val</a></td><td><a href="#cmdline-timeout">-t val</a></td><td>Set socket timeout to val seconds</td>
</tr>
<tr>
<td><a href="#cmdline-trace">--trace</a></td><td></td><td>Enable debugging output</td>
</tr>
<tr>
<td><a href="#cmdline-dump">--dump</a></td><td></td><td>Dump configuration and exit</td>
</tr>
</table>
<h5 id="cmdline-help"><a href="#commandline">--help or -h</a></h5>
<table class="cmdlineopt">
<tr>
<td class="rowlabel">
Long Option
</td>
<td class="rowdata">
--help
</td>
</tr>
<tr>
<td class="rowlabel">
Short Option
</td>
<td class="rowdata">
-h
</td>
</tr>
<tr>
<td class="rowlabel">
getmailrc equivalent
</td>
<td class="rowdata">
None
</td>
</tr>
<tr>
<td class="rowlabel">
Function
</td>
<td class="rowdata">
Display usage information, then exit.
</td>
</tr>
</table>
<h5 id="cmdline-getmaildir"><a href="#commandline">--getmaildir or -g</a></h5>
<table class="cmdlineopt">
<tr>
<td class="rowlabel">
Long Option
</td>
<td class="rowdata">
--getmaildir <span class="sample">path</span>
</td>
</tr>
<tr>
<td class="rowlabel">
Short Option
</td>
<td class="rowdata">
-g <span class="sample">path</span>
</td>
</tr>
<tr>
<td class="rowlabel">
getmailrc equivalent
</td>
<td class="rowdata">
None
</td>
</tr>
<tr>
<td class="rowlabel">
Function
</td>
<td class="rowdata">
Use <span class="sample">path</span> as getmail configuration/data
directory. Defaults to <span class="sample">$HOME/.getmail/</span>
</td>
</tr>
</table>
<h5 id="cmdline-rcfile"><a href="#commandline">--rcfile or -r</a></h5>
<table class="cmdlineopt">
<tr>
<td class="rowlabel">
Long Option
</td>
<td class="rowdata">
--rcfile <span class="sample">filename</span>
</td>
</tr>
<tr>
<td class="rowlabel">
Short Option
</td>
<td class="rowdata">
-r <span class="sample">filename</span>
</td>
</tr>
<tr>
<td class="rowlabel">
getmailrc equivalent
</td>
<td class="rowdata">
None
</td>
</tr>
<tr>
<td class="rowlabel">
Function
</td>
<td class="rowdata">
Use <span class="sample">filename</span> as getmailrc file.
Defaults to <span class="sample">getmailrc</span> in the
<a href="#cmdline-getmaildir">getmaildir</a> directory.
</td>
</tr>
</table>
<h5 id="cmdline-quiet"><a href="#commandline">--quiet or -q</a></h5>
<table class="cmdlineopt">
<tr>
<td class="rowlabel">
Long Option
</td>
<td class="rowdata">
--quiet
</td>
</tr>
<tr>
<td class="rowlabel">
Short Option
</td>
<td class="rowdata">
-q
</td>
</tr>
<tr>
<td class="rowlabel">
getmailrc equivalent
</td>
<td class="rowdata">
verbose = 0
</td>
</tr>
<tr>
<td class="rowlabel">
Function
</td>
<td class="rowdata">
Produce output only on error.
</td>
</tr>
</table>
<h5 id="cmdline-verbose"><a href="#commandline">--verbose or -v</a></h5>
<table class="cmdlineopt">
<tr>
<td class="rowlabel">
Long Option
</td>
<td class="rowdata">
--verbose
</td>
</tr>
<tr>
<td class="rowlabel">
Short Option
</td>
<td class="rowdata">
-v
</td>
</tr>
<tr>
<td class="rowlabel">
getmailrc equivalent
</td>
<td class="rowdata">
verbose = 1
</td>
</tr>
<tr>
<td class="rowlabel">
Function
</td>
<td class="rowdata">
Write status and progress messages to stdout.
</td>
</tr>
</table>
<h5 id="cmdline-message-log"><a href="#commandline">--message-log</a></h5>
<table class="cmdlineopt">
<tr>
<td class="rowlabel">
Long Option
</td>
<td class="rowdata">
--message-log <span class="sample">file</span>
</td>
</tr>
<tr>
<td class="rowlabel">
Short Option
</td>
<td class="rowdata">
None
</td>
</tr>
<tr>
<td class="rowlabel">
getmailrc equivalent
</td>
<td class="rowdata">
message_log = <span class="sample">file</span>
</td>
</tr>
<tr>
<td class="rowlabel">
Function
</td>
<td class="rowdata">
Log message retrieval and delivery information to <span class="sample">file</span>.
</td>
</tr>
</table>
<h5 id="cmdline-all"><a href="#commandline">--all or -a</a></h5>
<table class="cmdlineopt">
<tr>
<td class="rowlabel">
Long Option
</td>
<td class="rowdata">
--all
</td>
</tr>
<tr>
<td class="rowlabel">
Short Option
</td>
<td class="rowdata">
-a
</td>
</tr>
<tr>
<td class="rowlabel">
getmailrc equivalent
</td>
<td class="rowdata">
readall = 1
</td>
</tr>
<tr>
<td class="rowlabel">
Function
</td>
<td class="rowdata">
Retrieve all messages.
</td>
</tr>
</table>
<h5 id="cmdline-new"><a href="#commandline">--new or -n</a></h5>
<table class="cmdlineopt">
<tr>
<td class="rowlabel">
Long Option
</td>
<td class="rowdata">
--new
</td>
</tr>
<tr>
<td class="rowlabel">
Short Option
</td>
<td class="rowdata">
-n
</td>
</tr>
<tr>
<td class="rowlabel">
getmailrc equivalent
</td>
<td class="rowdata">
readall = 0
</td>
</tr>
<tr>
<td class="rowlabel">
Function
</td>
<td class="rowdata">
Retrieve only previously unseen messages.
</td>
</tr>
</table>
<h5 id="cmdline-delete"><a href="#commandline">--delete or -d</a></h5>
<table class="cmdlineopt">
<tr>
<td class="rowlabel">
Long Option
</td>
<td class="rowdata">
--delete
</td>
</tr>
<tr>
<td class="rowlabel">
Short Option
</td>
<td class="rowdata">
-d
</td>
</tr>
<tr>
<td class="rowlabel">
getmailrc equivalent
</td>
<td class="rowdata">
delete = 1
</td>
</tr>
<tr>
<td class="rowlabel">
Function
</td>
<td class="rowdata">
Delete messages from server after retrieval.
</td>
</tr>
</table>
<h5 id="cmdline-dont-delete"><a href="#commandline">--dont-delete or -l</a></h5>
<table class="cmdlineopt">
<tr>
<td class="rowlabel">
Long Option
</td>
<td class="rowdata">
--dont-delete
</td>
</tr>
<tr>
<td class="rowlabel">
Short Option
</td>
<td class="rowdata">
-l
</td>
</tr>
<tr>
<td class="rowlabel">
getmailrc equivalent
</td>
<td class="rowdata">
delete = 0
</td>
</tr>
<tr>
<td class="rowlabel">
Function
</td>
<td class="rowdata">
Leave messages on server after retrieval.
</td>
</tr>
</table>
<h5 id="cmdline-timeout"><a href="#commandline">--timeout or -t</a></h5>
<table class="cmdlineopt">
<tr>
<td class="rowlabel">
Long Option
</td>
<td class="rowdata">
--timeout <span class="sample">value (seconds)</span>
</td>
</tr>
<tr>
<td class="rowlabel">
Short Option
</td>
<td class="rowdata">
-t <span class="sample">value (seconds)</span>
</td>
</tr>
<tr>
<td class="rowlabel">
getmailrc equivalent
</td>
<td class="rowdata">
timeout = <span class="sample">value (seconds)</span>
</td>
</tr>
<tr>
<td class="rowlabel">
Function
</td>
<td class="rowdata">
Set TCP timeout to <span class="sample">value</span> seconds.
</td>
</tr>
</table>
<h5 id="cmdline-trace"><a href="#commandline">--trace</a></h5>
<table class="cmdlineopt">
<tr>
<td class="rowlabel">
Long Option
</td>
<td class="rowdata">
--trace
</td>
</tr>
<tr>
<td class="rowlabel">
Short Option
</td>
<td class="rowdata">
None
</td>
</tr>
<tr>
<td class="rowlabel">
getmailrc equivalent
</td>
<td class="rowdata">
None
</td>
</tr>
<tr>
<td class="rowlabel">
Function
</td>
<td class="rowdata">
Write verbose debugging information to stdout.
</td>
</tr>
</table>
<h5 id="cmdline-dump"><a href="#commandline">--dump</a></h5>
<table class="cmdlineopt">
<tr>
<td class="rowlabel">
Long Option
</td>
<td class="rowdata">
--dump
</td>
</tr>
<tr>
<td class="rowlabel">
Short Option
</td>
<td class="rowdata">
None
</td>
</tr>
<tr>
<td class="rowlabel">
getmailrc equivalent
</td>
<td class="rowdata">
None
</td>
</tr>
<tr>
<td class="rowlabel">
Function
</td>
<td class="rowdata">
Do not retrieve mail; read getmailrc file and commandline options,
then print configuration on stdout. This information should
be included in all bug reports or support requests.
</td>
</tr>
</table>
</div>
</body>
</html>
|