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
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<!--Converted with LaTeX2HTML 99.2beta8 (1.46)
original version by: Nikos Drakos, CBLU, University of Leeds
* revised and updated by: Marcus Hennecke, Ross Moore, Herb Swan
* with significant contributions from:
Jens Lippmann, Marek Rouchal, Martin Wilck and others -->
<HTML>
<HEAD>
<TITLE>30. exim and sendmail</TITLE>
<META NAME="description" CONTENT="30. exim and sendmail">
<META NAME="keywords" CONTENT="rute">
<META NAME="resource-type" CONTENT="document">
<META NAME="distribution" CONTENT="global">
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="LaTeX2HTML v99.2beta8">
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">
<LINK REL="STYLESHEET" HREF="rute.css">
<LINK REL="next" HREF="node34.html">
<LINK REL="previous" HREF="node32.html">
<LINK REL="up" HREF="rute.html">
<LINK REL="next" HREF="node34.html">
</HEAD>
<BODY BGCOLOR=#FFFFFF >
<TABLE width="100%" border="0" cellspacing="0" cellpadding="0">
<TR><TD align=left bgcolor="#000000">
<FONT COLOR=white>
<A HREF="http://www.icon.co.za/~psheer/rute-purchase.html"><FONT COLOR=white>Purchase</FONT></A>
</FONT>
</TD><TD align=center bgcolor="#000000">
<FONT COLOR=white>
Copyright © 2002 Paul Sheer. <A HREF="copying.html"><FONT COLOR=white>Click here for copying permissions.</FONT></A>
</FONT>
</TD><TD align=right bgcolor="#000000">
<FONT COLOR=white>
<A HREF="http://www.icon.co.za/~psheer/rute-home.html"><FONT COLOR=white>Home</FONT></A>
</FONT>
</TD></TR>
<TR><TD colspan=2 align=left bgcolor="#ECEBF4">
<IMG SRC="va-btn-small-light-60.png">
</TD><TD align=right bgcolor="#ECEBF4">
<IMG SRC="sflogo2-steel-60.png">
</TD></TR>
</TABLE><BR>
<!--Navigation Panel-->
<A NAME="tex2html2375"
HREF="node34.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A>
<A NAME="tex2html2371"
HREF="rute.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A>
<A NAME="tex2html2365"
HREF="node32.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A>
<A NAME="tex2html2373"
HREF="node1.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A>
<BR>
<B> Next:</B> <A NAME="tex2html2376"
HREF="node34.html">31. lilo, initrd, and</A>
<B> Up:</B> <A NAME="tex2html2372"
HREF="rute.html">rute</A>
<B> Previous:</B> <A NAME="tex2html2366"
HREF="node32.html">29. Services Running Under</A>
  <B> <A NAME="tex2html2374"
HREF="node1.html">Contents</A></B>
<BR>
<BR>
<!--End of Navigation Panel-->
<!--Table of Child-Links-->
<A NAME="CHILD_LINKS"><STRONG>Subsections</STRONG></A>
<UL>
<LI><A NAME="tex2html2377"
HREF="#SECTION003310000000000000000">30.1 Introduction</A>
<UL>
<LI><A NAME="tex2html2378"
HREF="#SECTION003311000000000000000">30.1.1 How mail works</A>
<LI><A NAME="tex2html2379"
HREF="#SECTION003312000000000000000">30.1.2 Configuring a POP/IMAP server</A>
<LI><A NAME="tex2html2380"
HREF="#SECTION003313000000000000000">30.1.3 Why <TT>
<FONT COLOR="#0000ff">exim</FONT></TT>?</A>
</UL>
<LI><A NAME="tex2html2381"
HREF="#SECTION003320000000000000000">30.2 <TT>
<FONT COLOR="#0000ff">exim</FONT></TT> Package Contents</A>
<LI><A NAME="tex2html2382"
HREF="#SECTION003330000000000000000">30.3 <TT>
<FONT COLOR="#0000ff">exim</FONT></TT> Configuration File</A>
<UL>
<LI><A NAME="tex2html2383"
HREF="#SECTION003331000000000000000">30.3.1 Global settings</A>
<LI><A NAME="tex2html2384"
HREF="#SECTION003332000000000000000">30.3.2 Transports</A>
<LI><A NAME="tex2html2385"
HREF="#SECTION003333000000000000000">30.3.3 Directors</A>
<LI><A NAME="tex2html2386"
HREF="#SECTION003334000000000000000">30.3.4 Routers</A>
</UL>
<LI><A NAME="tex2html2387"
HREF="#SECTION003340000000000000000">30.4 Full-blown Mail server</A>
<LI><A NAME="tex2html2388"
HREF="#SECTION003350000000000000000">30.5 Shell Commands for <TT>
<FONT COLOR="#0000ff">exim</FONT></TT> Administration</A>
<LI><A NAME="tex2html2389"
HREF="#SECTION003360000000000000000">30.6 The Queue</A>
<LI><A NAME="tex2html2390"
HREF="#SECTION003370000000000000000">30.7 <TT>
<FONT COLOR="#0000ff">/etc/aliases</FONT></TT> for Equivalent Addresses</A>
<LI><A NAME="tex2html2391"
HREF="#SECTION003380000000000000000">30.8 Real-Time Blocking List -- Combating Spam</A>
<UL>
<LI><A NAME="tex2html2392"
HREF="#SECTION003381000000000000000">30.8.1 What is <I>spam</I>?</A>
<LI><A NAME="tex2html2393"
HREF="#SECTION003382000000000000000">30.8.2 Basic spam prevention</A>
<LI><A NAME="tex2html2394"
HREF="#SECTION003383000000000000000">30.8.3 Real-time blocking list</A>
<LI><A NAME="tex2html2395"
HREF="#SECTION003384000000000000000">30.8.4 Mail administrator and user responsibilities</A>
</UL>
<LI><A NAME="tex2html2396"
HREF="#SECTION003390000000000000000">30.9 Sendmail</A>
</UL>
<!--End of Table of Child-Links-->
<HR>
<H1><A NAME="SECTION003300000000000000000">
30. <TT>
<FONT COLOR="#0000ff">exim</FONT></TT> and <TT>
<FONT COLOR="#0000ff">sendmail</FONT></TT></A>
</H1>
<P>
<A NAME="chap:eximsendmail"></A>
<P>
This chapter effectively explains how to get L<SMALL>INUX</SMALL> up and
running as a mail server. I have also included discussion on
the process of mail delivery right through to retrieval of
mail using POP and IMAP.
<P>
<H1><A NAME="SECTION003310000000000000000">
30.1 Introduction</A>
</H1>
<P>
<TT>
<FONT COLOR="#0000ff">exim</FONT></TT> and
<TT>
<FONT COLOR="#0000ff">sendmail</FONT></TT> are <I>MTA</I>s (<I>mail
transfer agents</I>). An MTA is just a daemon process that listens on
port 25 for incoming mail connections, spools <FONT COLOR="#ffa500">[See page
<A HREF="node24.html#page:spoolfile"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A> about spooling in general.]</FONT> that mail in a
<I>queue</I> (for <TT>
<FONT COLOR="#0000ff">exim</FONT></TT>, the
<TT>
<FONT COLOR="#0000ff">/var/spool/exim/input/</FONT></TT> directory,
for <TT>
<FONT COLOR="#0000ff">sendmail</FONT></TT>, the <TT>
<FONT COLOR="#0000ff">/var/spool/mqueue/</FONT></TT>
directory),
then resends that mail to some other MTA or
delivers it locally to some user's mailbox. In other
words, the MTA is the very package that handles all mail spooling,
routing, and delivery.
We saw in Section <A HREF="node13.html#sec:sendamail">10.2</A> how to
manually connect to an MTA with <TT>
<FONT COLOR="#0000ff">telnet</FONT></TT>.
In that example, <TT>
<FONT COLOR="#0000ff">sendmail</FONT></TT>
version 8.9.3 was the MTA running on machine <TT>
<FONT COLOR="#0000ff">mail.cranzgot.co.za</FONT></TT>.
<P>
<TT>
<FONT COLOR="#0000ff">sendmail</FONT></TT> is the original and popular U<SMALL>NIX</SMALL> MTA. It is probably
necessary to learn how to configure it because so many organizations
standardize on it. However, because <TT>
<FONT COLOR="#0000ff">exim</FONT></TT> is so easy to configure, it is
worthwhile replacing <TT>
<FONT COLOR="#0000ff">sendmail</FONT></TT> wherever you see it--there
are at least three MTAs that are preferable to <TT>
<FONT COLOR="#0000ff">sendmail</FONT></TT>.
I explain the minimum of what you need to know about
<TT>
<FONT COLOR="#0000ff">sendmail</FONT></TT> later on and explain <TT>
<FONT COLOR="#0000ff">exim</FONT></TT> in detail.
<P>
<H2><A NAME="SECTION003311000000000000000">
30.1.1 How mail works</A>
</H2>
<P>
Before we get into MTA configuration, a background in mail delivery and
indexii<TT>
<FONT COLOR="#0000ff">MX</FONT></TT> recordDNSMX record
handling is necessary. The sequence of events whereby a mail message (sent
by a typical interactive mail client) ends up on a
distant user's personal workstation is as follows:
<OL>
<LI>A user configures his mail client (Outlook Express, Netscape, etc.)
to use a particular <I>SMTP host</I> (for
<I>outgoing mail</I>, also called the
<I>SMTP gateway</I>) and
<I>POP host</I> (or <I>IMAP host</I>)
for <I>incoming mail</I>.
</LI>
<LI>The user composes a message to, say,
<TT>
<FONT COLOR="#0000ff">rrabbit@toonland.net</FONT></TT> and then clicks on ``Send.''
</LI>
<LI>The mail client initiates an outgoing TCP
connection to port 25 of the SMTP host.
An MTA running on the SMTP host and listening on port 25 services the request.
The mail client uses the SMTP protocol exactly as in Section <A HREF="node13.html#sec:sendamail">10.2</A>.
It fills in <TT>
<FONT COLOR="#0000ff">rrabbit@toonland.net</FONT></TT> as the recipient address
and transfers a properly composed header (hopefully)
and message body to the
MTA. The mail client then terminates the connection and reports any errors.
</LI>
<LI>The MTA queues the message as a spool file, periodically considering
whether to process the message further according to a retry schedule.
</LI>
<LI>Should the retry schedule permit, the MTA considers the
recipient address <TT>
<FONT COLOR="#0000ff">rrabbit@toonland.net</FONT></TT>. It strips out the
<I>domain part</I> of the email address--that is, everything after
the <TT>
<FONT COLOR="#0000ff">@</FONT></TT>. It then performs a DNS
<I>MX query</I> (or <I>MX lookup</I>indexii<TT>
<FONT COLOR="#0000ff">MX</FONT></TT> recordDNS) for the
domain <TT>
<FONT COLOR="#0000ff">toonland.net</FONT></TT>. DNS resolution for <TT>
<FONT COLOR="#0000ff">toonland.net</FONT></TT>
follows the procedure listed in Section <A HREF="node30.html#sec:nameresprocess">27.2.2</A>.
In short, this means (approximately) that it looks for the name
server that is authoritative for the domain <TT>
<FONT COLOR="#0000ff">toonland.net</FONT></TT>. It
queries that name server for the MX record of the domain <TT>
<FONT COLOR="#0000ff">toonland.net</FONT></TT>.
The name server returns a host name, say, <TT>
<FONT COLOR="#0000ff">mail.toonland.net</FONT></TT>
with corresponding IP address, say,
<TT>
<FONT COLOR="#0000ff">197.21.135.82</FONT></TT>. <FONT COLOR="#ffa500">[Section <A HREF="node30.html#sec:nsmxrecords">27.7.1</A> shows you
how you can manually lookup the MX record. Chapter <A HREF="node43.html#chap:name">40</A> shows
you how to set up your name server to return such an MX record.]</FONT>
</LI>
<LI>The MTA makes an SMTP connection to port 25 of <TT>
<FONT COLOR="#0000ff">197.21.135.82</FONT></TT>.
Another MTA running on <TT>
<FONT COLOR="#0000ff">mail.toonland.net</FONT></TT> services the request.
A recipient address, message header, and message body are transferred
using the SMTP protocol. The MTA then terminates the connection.
</LI>
<LI>The MTA running on <TT>
<FONT COLOR="#0000ff">mail.toonland.net</FONT></TT> considers the recipient
address <TT>
<FONT COLOR="#0000ff">rrabbit@toonland.net</FONT></TT>. It recognizes <TT>
<FONT COLOR="#0000ff">toonland.net</FONT></TT>
as a domain for which it hosts mail (that is, a <I>local domain</I>).
It recognizes <TT>
<FONT COLOR="#0000ff">rrabbit</FONT></TT> as a user name within its own
<TT>
<FONT COLOR="#0000ff">/etc/passwd</FONT></TT> file.
</LI>
<LI>The MTA running on <TT>
<FONT COLOR="#0000ff">mail.toonland.net</FONT></TT> appends the message
to the user's personal mailbox file, say, <TT>
<FONT COLOR="#0000ff">/var/spool/mail/rrabbit</FONT></TT>
or <TT>
<FONT COLOR="#0000ff">/home/rrabbit/Maildir/</FONT></TT>.
<I>The delivery is now complete. How the email gets from the mailbox
on <TT>
<FONT COLOR="#0000ff">mail.toonland.net</FONT></TT> to Mr Rabbit's personal workstation is
<I>not</I> the responsibility of the MTA and does <I>not</I> happen
through SMTP.</I>
</LI>
<LI>Mr Rabbit would have configured his mail client (running on his personal
workstation) to use a POP/IMAP host <TT>
<FONT COLOR="#0000ff">mail.toonland.net</FONT></TT> for incoming
mail. <TT>
<FONT COLOR="#0000ff">mail.toonland.net</FONT></TT> runs a POP or IMAP service on
port 110 or 143, respectively.
</LI>
<LI>Mr Rabbit's mail client makes a TCP connection to port 110 (or 143)
and communicates using the POP or IMAP protocol. The POP or IMAP service
is responsible for feeding the message to the mail client and deleting
it from the mailbox file.
</LI>
<LI>Mr Rabbit's mail client stores the message on his
workstation using its own methods and displays the message
as a ``new'' message.
</LI>
</OL>
<P>
<H2><A NAME="SECTION003312000000000000000">
30.1.2 Configuring a POP/IMAP server</A>
</H2>
<P>
POP and IMAP are invoked by <TT>
<FONT COLOR="#0000ff">inetd</FONT></TT> or
<TT>
<FONT COLOR="#0000ff">xinetd</FONT></TT>--see Chapter <A HREF="node32.html#chap:xinetd">29</A>.
Except for limiting the range of clients that are allowed
to connect (for
security reasons), no configuration is required.
Client connections authenticate themselves using the
normal U<SMALL>NIX</SMALL> login name and password. There are
specialized POP and IMAP packages for supporting
different mailbox types (like Maildir).
<P>
<H2><A NAME="SECTION003313000000000000000">
30.1.3 Why <TT>
<FONT COLOR="#0000ff">exim</FONT></TT>?</A>
</H2>
<P>
The <TT>
<FONT COLOR="#0000ff">exim</FONT></TT> <EM>home page</EM> <I><<TT><A NAME="tex2html43"
HREF="http://www.exim.org/">http://www.exim.org/</A></TT>></I> gives
you a full rundown. Here I will just say that <TT>
<FONT COLOR="#0000ff">exim</FONT></TT> is the
simplest MTA to configure. Moreover, its configuration file works the same
way you imagine mail to work. It's really easy to customize the <TT>
<FONT COLOR="#0000ff">exim</FONT></TT>
configuration to do some really weird things. The whole package fits
together cleanly, logically, and intuitively. This is in contrast to
<TT>
<FONT COLOR="#0000ff">sendmail</FONT></TT>'s <TT>
<FONT COLOR="#0000ff">sendmail.cf</FONT></TT>
file, which is widely considered
to be extremely cryptic and impractical. <TT>
<FONT COLOR="#0000ff">exim</FONT></TT> also seems to
have been written with proper security considerations, although
many people argue that <TT>
<FONT COLOR="#0000ff">postfix</FONT></TT> and
<TT>
<FONT COLOR="#0000ff">qmail</FONT></TT> are the last word in
secure mail.
<P>
<H1><A NAME="SECTION003320000000000000000">
30.2 <TT>
<FONT COLOR="#0000ff">exim</FONT></TT> Package Contents</A>
</H1>
<P>
You can get <TT>
<FONT COLOR="#0000ff">exim</FONT></TT> as a <TT>
<FONT COLOR="#0000ff">.rpm</FONT></TT> or <TT>
<FONT COLOR="#0000ff">.deb</FONT></TT> file. After
installation, the file
<TT>
<FONT COLOR="#0000ff">/usr/share/doc/exim-</FONT></TT><I>?</I><TT>
<FONT COLOR="#0000ff">.</FONT></TT><I>??</I><TT>
<FONT COLOR="#0000ff">/doc/spec.txt</FONT></TT> <FONT COLOR="#ffa500">[or <TT>
<FONT COLOR="#0000ff">/usr/doc/</FONT></TT>]</FONT>contains the complete <TT>
<FONT COLOR="#0000ff">exim</FONT></TT> documentation; there is also an HTML version
on the <TT>
<FONT COLOR="#0000ff">exim</FONT></TT> web page, whereas the man page contains only command-line information.
<TT>
<FONT COLOR="#0000ff">exim</FONT></TT> is a drop-in replacement for <TT>
<FONT COLOR="#0000ff">sendmail</FONT></TT>, meaning that for every critical
<TT>
<FONT COLOR="#0000ff">sendmail</FONT></TT> command, there is an <TT>
<FONT COLOR="#0000ff">exim</FONT></TT> command of the same name
that takes the same options, so that needy scripts won't know the
difference. These are:
<P><TABLE nowrap="1" width="100%" border="0" cellspacing="0" cellpadding="0">
<TR>
<TD valign="top" class="source" width="2%"><FONT color=red>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-1"><code>5</code></font><code> </code><br>
<code> </code><br>
</FONT></TD><TD valign="top" class="source" bgcolor="#FFE0C0"><FONT color=blue>
<code>/etc/aliases</code><br>
<code>/usr/bin/mailq</code><br>
<code>/usr/bin/newaliases</code><br>
<code>/usr/bin/rmail</code><br>
<code>/usr/lib/sendmail</code><br>
<code>/usr/sbin/sendmail</code><br>
</FONT></TD></TR></TABLE><P>
Finally, there is the <TT>
<FONT COLOR="#0000ff">exim</FONT></TT> binary itself,
<TT>
<FONT COLOR="#0000ff">/usr/sbin/exim</FONT></TT>, and configuration file
<TT>
<FONT COLOR="#0000ff">/etc/exim/config</FONT></TT>,
<TT>
<FONT COLOR="#0000ff">/etc/exim.conf</FONT></TT>, or
<TT>
<FONT COLOR="#0000ff">/etc/exim/exim.conf</FONT></TT>,
depending on your L<SMALL>INUX</SMALL> distribution.
Then there are the usual start/stop scripts,
<TT>
<FONT COLOR="#0000ff">/etc/init.d/exim</FONT></TT>. <FONT COLOR="#ffa500">[or <TT>
<FONT COLOR="#0000ff">/etc/rc.d/init.d/exim</FONT></TT>]</FONT>
<P>
<H1><A NAME="SECTION003330000000000000000">
30.3 <TT>
<FONT COLOR="#0000ff">exim</FONT></TT> Configuration File</A>
</H1>
<P>
As a preliminary example, here we create a simple spooling mail server
for a personal workstation, <TT>
<FONT COLOR="#0000ff">cericon.cranzgot.co.za</FONT></TT>.
<P>
Client applications (especially non-U<SMALL>NIX</SMALL> ones) are usually
configured to connect to an MTA running on a remote machine, however,
using a remote SMTP host can be irritating if the host or network
go down. Running <TT>
<FONT COLOR="#0000ff">exim</FONT></TT> on the local workstation enables all
applications to use <TT>
<FONT COLOR="#0000ff">localhost</FONT></TT> as their SMTP gateway:
that is, <TT>
<FONT COLOR="#0000ff">exim</FONT></TT> takes care of queuing
and periodic retries.
<P>
Here is the configuration. The difference between this
and a full-blown mail server is actually very slight.
<P><TABLE nowrap="1" width="100%" border="0" cellspacing="0" cellpadding="0">
<TR>
<TD valign="top" class="source" width="2%"><FONT color=red>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-1"><code>5</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-1"><code>10</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-1"><code>15</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-1"><code>20</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-1"><code>25</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-1"><code>30</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-1"><code>35</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-1"><code>40</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-1"><code>45</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-1"><code>50</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
</FONT></TD><TD valign="top" class="source" bgcolor="#FFE0C0"><FONT color=blue>
<code>#################### MAIN CONFIGURATION SETTINGS #####################</code><br>
<code>log_subject</code><br>
<code>errors_address = postmaster</code><br>
<code>freeze_tell_mailmaster = yes</code><br>
<code>queue_list_requires_admin = false</code><br>
<code>prod_requires_admin = false</code><br>
<code>trusted_users = psheer</code><br>
<code>local_domains = localhost : ${primary_hostname}</code><br>
<code>never_users = root</code><br>
<code># relay_domains = my.equivalent.domains : more.equivalent.domains</code><br>
<code>host_accept_relay = localhost : *.cranzgot.co.za : 192.168.0.0/16</code><br>
<code>exim_user = mail</code><br>
<code>exim_group = mail</code><br>
<code>end</code><br>
<code> </code><br>
<code>###################### TRANSPORTS CONFIGURATION ######################</code><br>
<code>remote_smtp:</code><br>
<code> driver = smtp</code><br>
<code> hosts = 192.168.2.1</code><br>
<code> hosts_override</code><br>
<code>local_delivery:</code><br>
<code> driver = appendfile</code><br>
<code> file = /var/spool/mail/${local_part}</code><br>
<code> delivery_date_add</code><br>
<code> envelope_to_add</code><br>
<code> return_path_add</code><br>
<code> group = mail</code><br>
<code> mode_fail_narrower =</code><br>
<code> mode = 0660</code><br>
<code>end</code><br>
<code> </code><br>
<code>###################### DIRECTORS CONFIGURATION #######################</code><br>
<code>localuser:</code><br>
<code> driver = localuser</code><br>
<code> transport = local_delivery</code><br>
<code>end</code><br>
<code> </code><br>
<code>###################### ROUTERS CONFIGURATION #########################</code><br>
<code>lookuphost:</code><br>
<code> driver = lookuphost</code><br>
<code> transport = remote_smtp</code><br>
<code>literal:</code><br>
<code> driver = ipliteral</code><br>
<code> transport = remote_smtp</code><br>
<code>end</code><br>
<code> </code><br>
<code>###################### RETRY CONFIGURATION ###########################</code><br>
<code>* * F,2h,15m; G,16h,1h,1.5; F,4d,8h</code><br>
<code>end</code><br>
<code> </code><br>
<code>###################### REWRITE CONFIGURATION #########################</code><br>
<code>*@cericon.cranzgot.co.za psheer@cranzgot.co.za</code><br>
</FONT></TD></TR></TABLE><P>
<P>
<H2><A NAME="SECTION003331000000000000000">
30.3.1 Global settings</A>
</H2>
<P>
The <TT>
<FONT COLOR="#0000ff">exim</FONT></TT> config file is divided into six logical sections
separated by the <TT>
<FONT COLOR="#0000ff">end</FONT></TT> keyword. The top or <TT>
<FONT COLOR="#0000ff">MAIN</FONT></TT> section
contains global settings. The global settings have the following meanings:
<DL>
<DT><STRONG><TT>
<FONT COLOR="#0000ff">log_subject</FONT></TT></STRONG></DT>
<DD>Tells <TT>
<FONT COLOR="#0000ff">exim</FONT></TT> to log the subject in the mail log file.
For example, <TT>
<FONT COLOR="#0000ff">T="I LOVE YOU"</FONT></TT> will be added to the log file.
</DD>
<DT><STRONG><TT>
<FONT COLOR="#0000ff">errors_address</FONT></TT></STRONG></DT>
<DD>The mail address where errors are to be sent. It doesn't
matter what you put here, because all mail will get rewritten to <TT>
<FONT COLOR="#0000ff">psheer@cranzgot.co.za</FONT></TT>,
as we see later.
</DD>
<DT><STRONG><TT>
<FONT COLOR="#0000ff">freeze_tell_mailmaster</FONT></TT></STRONG></DT>
<DD>Tells <TT>
<FONT COLOR="#0000ff">errors_address</FONT></TT> about <I>frozen</I> messages.
<I>frozen</I> messages are messages that could not be delivered for some reason (like
a permissions problem, or a failed message whose return address is invalid) and are
flagged to sit idly in the mail queue, and not be processed any further. Note
that frozen messages sometimes mean that something is wrong with your system
or mail configuration.
</DD>
<DT><STRONG><TT>
<FONT COLOR="#0000ff">local_domains</FONT></TT></STRONG></DT>
<DD>Each mail message received is processed in one of
two ways: by either a local or remote delivery. A local delivery is one to a
user on the local machine, and a remote delivery is one to somewhere else on
the Internet.
<TT>
<FONT COLOR="#0000ff">local_domains</FONT></TT> distinguishes between these two. For example, according to
the config line above, a message destined to <TT>
<FONT COLOR="#0000ff">psheer@localhost</FONT></TT> or
<TT>
<FONT COLOR="#0000ff">psheer@cericon.cranzgot.co.za</FONT></TT> is local, whereas a message to
<TT>
<FONT COLOR="#0000ff">psheer@elsewhere.co.za</FONT></TT> is remote. Note that the list is
colon delimited.
</DD>
<DT><STRONG><TT>
<FONT COLOR="#0000ff">never_users</FONT></TT></STRONG></DT>
<DD>Never become this user. Just for security.
</DD>
<DT><STRONG><TT>
<FONT COLOR="#0000ff">exim_user</FONT></TT></STRONG></DT>
<DD>Specifies the user that <TT>
<FONT COLOR="#0000ff">exim</FONT></TT> should run as.
</DD>
<DT><STRONG><TT>
<FONT COLOR="#0000ff">exim_group</FONT></TT></STRONG></DT>
<DD>Specifies the group that <TT>
<FONT COLOR="#0000ff">exim</FONT></TT> should run as.
</DD>
</DL>
<DIV ALIGN="CENTER">
<TABLE width="100%" border="0" cellspacing="0" cellpadding="0">
<TR><TD bgcolor="#FFE0FF">
<I>It is important to understand the <TT>
<FONT COLOR="#0000ff">host_accept_relay</FONT></TT> and <TT>
<FONT COLOR="#0000ff">relay_domains</FONT></TT> options for security.</I>
</TD></TR>
</TABLE>
</DIV>
<DL>
<DT><STRONG><TT>
<FONT COLOR="#0000ff">host_accept_relay</FONT></TT></STRONG></DT>
<DD>This option specifies machines that are allowed to use
<TT>
<FONT COLOR="#0000ff">cericon.cranzgot.co.za</FONT></TT> as a <I>relay</I>. A relay is a host
that sends mail on another machine's behalf: that is, we are acting as
a relay when we process a mail message that neither originated from
our machine nor is destined for a user on our machine.
<P>
We <I>never</I> want to relay from an untrusted host.
Why? Because it may, for example, allow someone to send 100,000
messages to 100,000 different addresses, each with <I>us</I> in the
message header.
<P>
<TT>
<FONT COLOR="#0000ff">host_accept_relay</FONT></TT> specifies a list of trusted hosts that
are allowed to send such arbitrary messages through us. Note again
that the list is colon delimited. In this example, we don't even
need to put in addresses of other machines on our LAN, except if
we are feeling friendly.
<P>
</DD>
<DT><STRONG><TT>
<FONT COLOR="#0000ff">relay_domains</FONT></TT></STRONG></DT>
<DD><TT>
<FONT COLOR="#0000ff">relay_domains</FONT></TT> gives an additional condition for which
an arbitrary host is allowed to use us as a relay. Consider that we are a
backup mail server for a particular domain; mail to the domain does
not originate from us nor is destined for us yet must be allowed
<I>only if the destination address matches the domains for which
we are a backup</I>. We put such domains under <TT>
<FONT COLOR="#0000ff">relay_domains</FONT></TT>.
</DD>
</DL>
<P>
<H2><A NAME="SECTION003332000000000000000">
30.3.2 Transports</A>
</H2>
<P>
<A NAME="sec:eximtransports"></A>
<P>
The transport section comes immediately after the main configuration
options. It defines various <I>methods</I> of delivering mail. We are
going to refer to these methods later in the configuration file. Our manual
<TT>
<FONT COLOR="#0000ff">telnet</FONT></TT>ing to port 25 was <I>transport</I>ing a mail message by
SMTP. Appending a mail message to the end of a mail folder is also
a transport method. These are represented by the
<TT>
<FONT COLOR="#0000ff">remote_smtp:</FONT></TT> and <TT>
<FONT COLOR="#0000ff">local_delivery:</FONT></TT> labels, respectively.
<P>
<DL>
<DT><STRONG><TT>
<FONT COLOR="#0000ff">remote_smtp:</FONT></TT></STRONG></DT>
<DD>This transport has the following suboptions:
<DL>
<DT><STRONG><TT>
<FONT COLOR="#0000ff">driver</FONT></TT></STRONG></DT>
<DD>The actual method of delivery. <TT>
<FONT COLOR="#0000ff">driver =</FONT></TT>
always specifies the kind of transport, director, or router.
</DD>
<DT><STRONG><TT>
<FONT COLOR="#0000ff">hosts_override</FONT></TT> and <TT>
<FONT COLOR="#0000ff">hosts</FONT></TT></STRONG></DT>
<DD>Using these two options together overrides any list of hosts that may have
been looked up by DNS MX queries. By ``list of hosts'' we mean
machines established from the recipients email address to
which we might like to make an SMTP delivery, but which we are
not going to use. Instead we send all mail to <TT>
<FONT COLOR="#0000ff">192.168.2.1</FONT></TT>,
which is this company's internal mail server.
</DD>
</DL>
<P>
</DD>
<DT><STRONG><TT>
<FONT COLOR="#0000ff">local_delivery:</FONT></TT></STRONG></DT>
<DD>This transport has the following suboptions:
<DL>
<DT><STRONG><TT>
<FONT COLOR="#0000ff">driver</FONT></TT></STRONG></DT>
<DD>The actual method of delivery. <TT>
<FONT COLOR="#0000ff">driver =</FONT></TT>
always specifies the kind of transport, director, or router.
</DD>
<DT><STRONG><TT>
<FONT COLOR="#0000ff">file</FONT></TT></STRONG></DT>
<DD>The file to append the mail message to. <TT>
<FONT COLOR="#0000ff">${local_part}</FONT></TT>
is replaced with everything before the <TT>
<FONT COLOR="#0000ff">@</FONT></TT> character of the recipient's
address.
</DD>
<DT><STRONG><TT>
<FONT COLOR="#0000ff">delivery_date_add</FONT></TT>, <TT>
<FONT COLOR="#0000ff">envelope_to_add</FONT></TT>, and <TT>
<FONT COLOR="#0000ff">return_path_add</FONT></TT></STRONG></DT>
<DD>Various things to add to the header.
</DD>
<DT><STRONG><TT>
<FONT COLOR="#0000ff">group</FONT></TT>, <TT>
<FONT COLOR="#0000ff">mode_fail_narrower</FONT></TT> and <TT>
<FONT COLOR="#0000ff">mode</FONT></TT></STRONG></DT>
<DD>Various permission settings.
</DD>
</DL>
</DD>
</DL>
<P>
(It should be obvious at this stage what these two transports
are going to be used for. As far as MTAs are concerned, the only
two things that ever happen to an email message are that it either (a)
gets sent through SMTP to another host or (b) gets appended to a file.)
<P>
<H2><A NAME="SECTION003333000000000000000">
30.3.3 Directors</A>
</H2>
<P>
If a message arrives and it is listed in <TT>
<FONT COLOR="#0000ff">local_domains</FONT></TT>,
<TT>
<FONT COLOR="#0000ff">exim</FONT></TT> will attempt a local delivery. This means <TT>
<FONT COLOR="#0000ff">exim</FONT></TT> works through
the list of <I>directors</I> until it finds one that does not fail. The
only director listed here is the one labeled <TT>
<FONT COLOR="#0000ff">localuser:</FONT></TT> with
<TT>
<FONT COLOR="#0000ff">local_delivery</FONT></TT> as its transport. So quite simply, email messages
having recipient addresses that are listed under <TT>
<FONT COLOR="#0000ff">local_domains</FONT></TT> are
appended to a user's mailbox file--not very complicated.
<P>
A director <I>directs</I> mail to a mailbox.
<P>
<H2><A NAME="SECTION003334000000000000000">
30.3.4 Routers</A>
</H2>
<P>
If a message arrives and it is not listed in <TT>
<FONT COLOR="#0000ff">local_domains</FONT></TT>,
<TT>
<FONT COLOR="#0000ff">exim</FONT></TT> attempts a remote delivery. Similarly, this means <TT>
<FONT COLOR="#0000ff">exim</FONT></TT>
works through the list of <I>routers</I> until it finds one that does not fail.
<P>
Two routers are listed here. The first is for common
email addresses. It uses the <TT>
<FONT COLOR="#0000ff">lookuphost</FONT></TT> driver, which
does a DNS MX query on the domain part of the email address
(i.e., everything after the <TT>
<FONT COLOR="#0000ff">@</FONT></TT>). The MX records found are
then passed to the <TT>
<FONT COLOR="#0000ff">remote_smtp</FONT></TT> transport (and in our case, then
ignored). The <TT>
<FONT COLOR="#0000ff">lookuphost</FONT></TT> driver will fail if the domain part of
the email address is a bracketed literal IP address.
<P>
The second router uses the <TT>
<FONT COLOR="#0000ff">ipliteral</FONT></TT> driver. It
sends mail directly to an IP address in the case of bracketed, literal
email addresses. For example, <TT>
<FONT COLOR="#0000ff">root@[111.1.1.1]</FONT></TT>.
<P>
A router <I>routes</I> mail to another host.
<P>
<H1><A NAME="SECTION003340000000000000000">
30.4 Full-blown Mail server</A>
</H1>
<P>
An actual mail server config file contains very little extra. This one is
the example config file that comes by default with <TT>
<FONT COLOR="#0000ff">exim-3.16</FONT></TT>:
<P>
<P><TABLE nowrap="1" width="100%" border="0" cellspacing="0" cellpadding="0">
<TR>
<TD valign="top" class="source" width="2%"><FONT color=red>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-1"><code>5</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-1"><code>10</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-1"><code>15</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-1"><code>20</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-1"><code>25</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-1"><code>30</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-1"><code>35</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-1"><code>40</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-1"><code>45</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-1"><code>50</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-1"><code>55</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-1"><code>60</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-1"><code>65</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-1"><code>70</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-1"><code>75</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-1"><code>80</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
</FONT></TD><TD valign="top" class="source" bgcolor="#FFE0C0"><FONT color=blue>
<code>#################### MAIN CONFIGURATION SETTINGS #####################</code><br>
<code># primary_hostname =</code><br>
<code># qualify_domain =</code><br>
<code># qualify_recipient =</code><br>
<code># local_domains =</code><br>
<code>never_users = root</code><br>
<code># host_accept_relay = localhost</code><br>
<code># host_accept_relay = my.friends.host : 131.111.0.0/16</code><br>
<code># relay_domains = my.equivalent.domains : more.equivalent.domains</code><br>
<code>host_lookup = 0.0.0.0/0</code><br>
<code># receiver_unqualified_hosts =</code><br>
<code># sender_unqualified_hosts =</code><br>
<code>rbl_domains = rbl.maps.vix.com</code><br>
<code>no_rbl_reject_recipients</code><br>
<code>sender_reject = "*@*.sex*.net:*@sex*.net"</code><br>
<code>host_reject = "open-relay.spamming-site.com"</code><br>
<code>rbl_warn_header</code><br>
<code># rbl_domains = rbl.maps.vix.com:dul.maps.vix.com:relays.orbs.org</code><br>
<code># percent_hack_domains = *</code><br>
<code>end</code><br>
<code>###################### TRANSPORTS CONFIGURATION ######################</code><br>
<code>remote_smtp:</code><br>
<code> driver = smtp</code><br>
<code># procmail transport goes here <---</code><br>
<code>local_delivery:</code><br>
<code> driver = appendfile</code><br>
<code> file = /var/spool/mail/${local_part}</code><br>
<code> delivery_date_add</code><br>
<code> envelope_to_add</code><br>
<code> return_path_add</code><br>
<code> group = mail</code><br>
<code> mode = 0660</code><br>
<code>address_pipe:</code><br>
<code> driver = pipe</code><br>
<code> return_output</code><br>
<code>address_file:</code><br>
<code> driver = appendfile</code><br>
<code> delivery_date_add</code><br>
<code> envelope_to_add</code><br>
<code> return_path_add</code><br>
<code>address_reply:</code><br>
<code> driver = autoreply</code><br>
<code>end</code><br>
<code>###################### DIRECTORS CONFIGURATION #######################</code><br>
<code># routers because of a "self=local" setting (not used in this configuration).</code><br>
<code>system_aliases:</code><br>
<code> driver = aliasfile</code><br>
<code> file = /etc/aliases</code><br>
<code> search_type = lsearch</code><br>
<code> user = mail</code><br>
<code> group = mail</code><br>
<code> file_transport = address_file</code><br>
<code> pipe_transport = address_pipe</code><br>
<code>userforward:</code><br>
<code> driver = forwardfile</code><br>
<code> file = .forward</code><br>
<code> no_verify</code><br>
<code> no_expn</code><br>
<code> check_ancestor</code><br>
<code># filter</code><br>
<code> file_transport = address_file</code><br>
<code> pipe_transport = address_pipe</code><br>
<code> reply_transport = address_reply</code><br>
<code># procmail director goes here <---</code><br>
<code>localuser:</code><br>
<code> driver = localuser</code><br>
<code> transport = local_delivery</code><br>
<code>end</code><br>
<code>###################### ROUTERS CONFIGURATION #########################</code><br>
<code># widen_domains = "sales.mycompany.com:mycompany.com"</code><br>
<code>lookuphost:</code><br>
<code> driver = lookuphost</code><br>
<code> transport = remote_smtp</code><br>
<code># widen_domains = </code><br>
<code>literal:</code><br>
<code> driver = ipliteral</code><br>
<code> transport = remote_smtp</code><br>
<code>end</code><br>
<code>###################### RETRY CONFIGURATION ###########################</code><br>
<code>* * F,2h,15m; G,16h,1h,1.5; F,4d,8h</code><br>
<code>end</code><br>
<code>######################################################################</code><br>
</FONT></TD></TR></TABLE><P>
<P>
For <TT>
<FONT COLOR="#0000ff">procmail</FONT></TT> support (see
<TT>
<FONT COLOR="#0000ff">procmail</FONT></TT>(1), <TT>
<FONT COLOR="#0000ff">procmailrc</FONT></TT>(6), and <TT>
<FONT COLOR="#0000ff">procmailex</FONT></TT>(5)), simply add
<P><TABLE nowrap="1" width="100%" border="0" cellspacing="0" cellpadding="0">
<TR>
<TD valign="top" class="source" width="2%"><FONT color=red>
<code> </code><br>
<code> </code><br>
<code> </code><br>
</FONT></TD><TD valign="top" class="source" bgcolor="#FFE0C0"><FONT color=blue>
<code>procmail:</code><br>
<code> driver = pipe</code><br>
<code> command = "/usr/bin/procmail -Y -d ${local_part}"</code><br>
</FONT></TD></TR></TABLE><P>
after your <TT>
<FONT COLOR="#0000ff">remote_smtp</FONT></TT> transport, and then also,
<P><TABLE nowrap="1" width="100%" border="0" cellspacing="0" cellpadding="0">
<TR>
<TD valign="top" class="source" width="2%"><FONT color=red>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
</FONT></TD><TD valign="top" class="source" bgcolor="#FFE0C0"><FONT color=blue>
<code>procmail:</code><br>
<code> driver = localuser</code><br>
<code> transport = procmail</code><br>
<code> require_files = /usr/bin/procmail</code><br>
</FONT></TD></TR></TABLE><P>
after your <TT>
<FONT COLOR="#0000ff">user_forward</FONT></TT> director.
<P>
<H1><A NAME="SECTION003350000000000000000">
30.5 Shell Commands for <TT>
<FONT COLOR="#0000ff">exim</FONT></TT> Administration</A>
</H1>
<P>
As with other daemons, you can stop <TT>
<FONT COLOR="#0000ff">exim</FONT></TT>, start <TT>
<FONT COLOR="#0000ff">exim</FONT></TT>, and
cause <TT>
<FONT COLOR="#0000ff">exim</FONT></TT> to reread its configuration file with:
<P><TABLE nowrap="1" width="100%" border="0" cellspacing="0" cellpadding="0">
<TR>
<TD valign="top" class="source" width="2%"><FONT color=red>
<code> </code><br>
<code> </code><br>
<code> </code><br>
</FONT></TD><TD valign="top" class="source" bgcolor="#FFE0C0"><FONT color=blue>
<code>/etc/init.d/exim stop</code><br>
<code>/etc/init.d/exim start</code><br>
<code>/etc/init.d/exim reload</code><br>
</FONT></TD></TR></TABLE><P>
You should always do a <TT>
<FONT COLOR="#0000ff">reload</FONT></TT> to cause config
file changes to take effect. The <TT>
<FONT COLOR="#0000ff">start</FONT></TT>up script
actually just runs <TT>
<FONT COLOR="#0000ff">exim -bd -q30m</FONT></TT>, which tells
<TT>
<FONT COLOR="#0000ff">exim</FONT></TT> to start as a standalone daemon, listening for
connections on port 25, and then execute a <TT>
<FONT COLOR="#0000ff">runq</FONT></TT> (explained
below) every 30 minutes.
<P>
To cause <TT>
<FONT COLOR="#0000ff">exim</FONT></TT> <FONT COLOR="#ffa500">[and many other MTAs for
that matter]</FONT> to loop through the queue of pending messages
and consider each one for deliver, run
<P><TABLE nowrap="1" width="100%" border="0" cellspacing="0" cellpadding="0">
<TR>
<TD valign="top" class="source" width="2%"><FONT color=red>
<code> </code><br>
</FONT></TD><TD valign="top" class="source" bgcolor="#FFE0C0"><FONT color=blue>
<code>runq</code><br>
</FONT></TD></TR></TABLE><P>
which is the same as <TT>
<FONT COLOR="#0000ff">exim -q</FONT></TT>.
<P>
To list mail that is queued for delivery, use
<P><TABLE nowrap="1" width="100%" border="0" cellspacing="0" cellpadding="0">
<TR>
<TD valign="top" class="source" width="2%"><FONT color=red>
<code> </code><br>
</FONT></TD><TD valign="top" class="source" bgcolor="#FFE0C0"><FONT color=blue>
<code>mailq</code><br>
</FONT></TD></TR></TABLE><P>
which is the same as <TT>
<FONT COLOR="#0000ff">exim -bp</FONT></TT>.
<P>
To forcibly attempt delivery on any mail in the queue, use
<P><TABLE nowrap="1" width="100%" border="0" cellspacing="0" cellpadding="0">
<TR>
<TD valign="top" class="source" width="2%"><FONT color=red>
<code> </code><br>
</FONT></TD><TD valign="top" class="source" bgcolor="#FFE0C0"><FONT color=blue>
<code>exim -qf</code><br>
</FONT></TD></TR></TABLE><P>
and then to forcibly retry even frozen messages in the queue, use
<P><TABLE nowrap="1" width="100%" border="0" cellspacing="0" cellpadding="0">
<TR>
<TD valign="top" class="source" width="2%"><FONT color=red>
<code> </code><br>
</FONT></TD><TD valign="top" class="source" bgcolor="#FFE0C0"><FONT color=blue>
<code>exim -qff</code><br>
</FONT></TD></TR></TABLE><P>
<P>
To delete a message from the queue, use
<P><TABLE nowrap="1" width="100%" border="0" cellspacing="0" cellpadding="0">
<TR>
<TD valign="top" class="source" width="2%"><FONT color=red>
<code> </code><br>
</FONT></TD><TD valign="top" class="source" bgcolor="#FFE0C0"><FONT color=blue>
<code>exim -Mrm <message-id></code><br>
</FONT></TD></TR></TABLE><P>
<P>
The man page <TT>
<FONT COLOR="#0000ff">exim</FONT></TT>(8) contains exhaustive treatment
of command-line options. Those above are most of what you will use,
however.
<P>
<H1><A NAME="SECTION003360000000000000000">
30.6 The Queue</A>
</H1>
<P>
It is often useful to check the queue directory
<TT>
<FONT COLOR="#0000ff">/var/spool/exim/input/</FONT></TT>
for mail messages, just to get an inside look at what's going on. The simple
session--
<P><TABLE nowrap="1" width="100%" border="0" cellspacing="0" cellpadding="0">
<TR>
<TD valign="top" class="source" width="2%"><FONT color=red>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-1"><code>5</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-1"><code>10</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
</FONT></TD><TD valign="top" class="source" bgcolor="#FFE0C0"><FONT color=blue>
<code>[root@cericon]# <font color="navy"><B>mailq</B></font></code><br>
<code> 0m 320 14Epss-0008DY-00 <psheer@cranzgot.co.za></code><br>
<code> freddy@elmstreet.org</code><br>
<code> </code><br>
<code> 0m 304 14Ept8-0008Dg-00 <psheer@cranzgot.co.za></code><br>
<code> igor@ghostbusters.com</code><br>
<code> </code><br>
<code>[root@cericon]# <font color="navy"><B>ls -l /var/spool/exim/input/</B></font></code><br>
<code>total 16</code><br>
<code>-rw------- 1 root root 25 Jan 6 11:43 14Epss-0008DY-00-D</code><br>
<code>-rw------- 1 root root 550 Jan 6 11:43 14Epss-0008DY-00-H</code><br>
<code>-rw------- 1 root root 25 Jan 6 11:43 14Ept8-0008Dg-00-D</code><br>
<code>-rw------- 1 root root 530 Jan 6 11:43 14Ept8-0008Dg-00-H</code><br>
</FONT></TD></TR></TABLE><P>
--clearly shows that two messages are queued for delivery. The
files ending in <TT>
<FONT COLOR="#0000ff">-H</FONT></TT> are <I>envelope headers</I>, and those ending in <TT>
<FONT COLOR="#0000ff">-D</FONT></TT>
are message bodies. The <TT>
<FONT COLOR="#0000ff">spec.txt</FONT></TT> document will show you how to
interpret the contents of the header files.
<P>
Don't be afraid to manually <TT>
<FONT COLOR="#0000ff">rm</FONT></TT> files from this directory, but
always delete them in pairs (i.e., remove the both the header <I>and</I> the
body file), and make sure <TT>
<FONT COLOR="#0000ff">exim</FONT></TT> is not running at the time.
In the above example, the commands,
<P><TABLE nowrap="1" width="100%" border="0" cellspacing="0" cellpadding="0">
<TR>
<TD valign="top" class="source" width="2%"><FONT color=red>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-1"><code>5</code></font><code> </code><br>
</FONT></TD><TD valign="top" class="source" bgcolor="#FFE0C0"><FONT color=blue>
<code>[root@cericon]# <font color="navy"><B>exim -Mrm 14Epss-0008DY-00 14Ept8-0008Dg-00</B></font></code><br>
<code>Message 14Epss-0008DY-00 has been removed</code><br>
<code>Message 14Ept8-0008Dg-00 has been removed</code><br>
<code>[root@cericon]# <font color="navy"><B>mailq</B></font></code><br>
<code>[root@cericon]# </code><br>
</FONT></TD></TR></TABLE><P>
work even better.
<P>
<H1><A NAME="SECTION003370000000000000000">
30.7 <TT>
<FONT COLOR="#0000ff">/etc/aliases</FONT></TT> for Equivalent Addresses</A>
</H1>
<P>
Often, we would like certain local addresses to <I>actually</I>
deliver to other addresses. For instance, we would like all
mail destined to user <TT>
<FONT COLOR="#0000ff">MAILER-DAEMON</FONT></TT> to actually go
to user <TT>
<FONT COLOR="#0000ff">postmaster</FONT></TT>; or perhaps some user has two
accounts but would like to read mail from only one of them.
<P>
The <TT>
<FONT COLOR="#0000ff">/etc/aliases</FONT></TT> file performs this mapping. This
file has become somewhat of an institution; however you
can see that in the case of <TT>
<FONT COLOR="#0000ff">exim</FONT></TT>, aliasing is
completely arbitrary: you can specify a lookup on <I>any</I>
file under the <TT>
<FONT COLOR="#0000ff">system_aliases:</FONT></TT> director provided
that file is colon delimited.
<P>
A default <TT>
<FONT COLOR="#0000ff">/etc/aliases</FONT></TT> file could contain as much as the following;
you should check that the <TT>
<FONT COLOR="#0000ff">postmaster</FONT></TT> account does
exist on your system, and test whether you can read, send, and
receive mail as user <TT>
<FONT COLOR="#0000ff">postmaster</FONT></TT>.
<P>
<P><TABLE nowrap="1" width="100%" border="0" cellspacing="0" cellpadding="0">
<TR>
<TD valign="top" class="source" width="2%"><FONT color=red>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-1"><code>5</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-1"><code>10</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-1"><code>15</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-1"><code>20</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-1"><code>25</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-1"><code>30</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-1"><code>35</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-1"><code>40</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-1"><code>45</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
</FONT></TD><TD valign="top" class="source" bgcolor="#FFE0C0"><FONT color=blue>
<code># This is a combination of what I found in the Debian</code><br>
<code># and RedHat distributions.</code><br>
<code> </code><br>
<code>MAILER-DAEMON: postmaster</code><br>
<code>abuse: postmaster</code><br>
<code>anonymous: postmaster</code><br>
<code>backup: postmaster</code><br>
<code>backup-reports: postmaster</code><br>
<code>bin: postmaster</code><br>
<code>daemon: postmaster</code><br>
<code>decode: postmaster</code><br>
<code>dns: postmaster</code><br>
<code>dns-admin: postmaster</code><br>
<code>dumper: postmaster</code><br>
<code>fetchmail-daemon: postmaster</code><br>
<code>games: postmaster</code><br>
<code>gnats: postmaster</code><br>
<code>ingres: postmaster</code><br>
<code>info: postmaster</code><br>
<code>irc: postmaster</code><br>
<code>list: postmaster</code><br>
<code>listmaster: postmaster</code><br>
<code>lp: postmaster</code><br>
<code>mail: postmaster</code><br>
<code>mailer-daemon: postmaster</code><br>
<code>majordom: postmaster</code><br>
<code>man: postmaster</code><br>
<code>manager: postmaster</code><br>
<code>msql: postmaster</code><br>
<code>news: postmaster</code><br>
<code>nobody: postmaster</code><br>
<code>operator: postmaster</code><br>
<code>postgres: postmaster</code><br>
<code>proxy: postmaster</code><br>
<code>root: postmaster</code><br>
<code>sync: postmaster</code><br>
<code>support: postmaster</code><br>
<code>sys: postmaster</code><br>
<code>system: postmaster</code><br>
<code>toor: postmaster</code><br>
<code>uucp: postmaster</code><br>
<code>warnings: postmaster</code><br>
<code>web-master: postmaster</code><br>
<code>www-data: postmaster</code><br>
<code> </code><br>
<code># some users who want their mail redirected</code><br>
<code>arny: mail@swartzneger.co.us</code><br>
<code>larry: lking@cnn.com</code><br>
</FONT></TD></TR></TABLE><P>
<P>
You can remove a lot of these aliases, since they assume services
to be running that might not be installed--<TT>
<FONT COLOR="#0000ff">games</FONT></TT>, <TT>
<FONT COLOR="#0000ff">ingres</FONT></TT>,
for example. Aliases can do two things: firstly, anticipate what mail
people are likely to use if they need to contact the administrator;
and secondly, catch any mail sent by system daemons: for
example the, email address of the DNS administrator is dictated
by the DNS config files, as explained on page <A HREF="node43.html#page:dnsemail"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>.
<P>
Note that an alias in the <TT>
<FONT COLOR="#0000ff">/etc/aliases</FONT></TT> file does not have to
have an account on the system--<TT>
<FONT COLOR="#0000ff">larry</FONT></TT> and <TT>
<FONT COLOR="#0000ff">arny</FONT></TT> need
not have entries in the <TT>
<FONT COLOR="#0000ff">/etc/passwd</FONT></TT> file.
<P>
<H1><A NAME="SECTION003380000000000000000">
30.8 Real-Time Blocking List -- Combating Spam</A>
</H1>
<P>
<H2><A NAME="SECTION003381000000000000000">
30.8.1 What is <I>spam</I>?</A>
</H2>
<P>
<I>Spam</I> refers to unsolicited <FONT COLOR="#ffa500">[Not looked for or requested; unsought]</FONT>bulk mail sent to users usually for promotional purposes. That is, mail
is sent automatically to many people with whom the sender has no
relationship, and where the recipient did nothing to prompt the
mail: all on the <I>chance</I> that the recipient might be interested in the
subject matter.
<P>
Alternatively, spam can be thought of as any mail sent
to email addresses, where those addresses were obtained without
their owners consent. More practically, anyone who has had an
email account for very long will have gotten messages like
<TT>
<FONT COLOR="#0000ff">Subject: Fast way to earn big $$$!</FONT></TT>, which clutters my
mailbox. The longer you have an email address, the more of these
messages you will get, and the more irritated you will get.
<P>
To send spam is easy. Work your way around the Internet till you
find a mail server that allows relaying. Then send it 10,000 email
addresses and a message about where to get pictures of naked
underage girls. Now you are a genuine worthy-of-being-arrested
spammer. Unfortunately for the unsuspecting administrator of that
machine and provided you have even a little clue what you're
doing, he will probably never be able to track you down. Several
other tricks are employed to get the most out of your
$100-for-1,000,000-genuine-email-addresses.
<P>
Note that spam is not merely email you are not interested in. People
often confuse mail with other types of communication... like
telephone calls: if you get a telephone call, you <I>have</I> to pick
up the phone then and there--the call is an an invasion of your
privacy. The beauty of email is that you never need to have your
privacy invaded. You can simply delete the mail. If you never want
to get email from a particular person again, you can simply add a
filter that blocks mail from that person's address (see <TT>
<FONT COLOR="#0000ff">procmailex</FONT></TT>(5)).
<FONT COLOR="#ffa500">[If you are irritated by the presumption of the sender, then that's
<I>your</I> problem. Replying to that person with ``Please don't email me...''
not only shows that you are insecure, but also that you are clueless, don't
get much mail, and are therefore also unpopular.]</FONT>
<P>
The point at which email becomes intrusive is purely a question
of volume, much like airwave advertisements. <I>Because it comes
from a different place each time, you cannot protect yourself against
it with a simple mail filter.</I>
<P>
Typical spam mail will begin with a spammer
subject like <TT>
<FONT COLOR="#0000ff">Create Wealth From Home Now!!</FONT></TT> and then
the spammer will audaciously append the footer:
<P>
<BLOCKQUOTE><FONT SIZE="-1">This is not a SPAM. You are receiving this because
you are on a list of email addresses that I have bought.
And you have opted to receive information about
business opportunities. If you did not opt in to receive
information on business opportunities then please accept
our apology. To be REMOVED from this list simply reply
with REMOVE as the subject. And you will NEVER receive
another email from me.
</FONT></BLOCKQUOTE>
<P>
Need I say that you should be wary of replying with <TT>
<FONT COLOR="#0000ff">REMOVE</FONT></TT>,
since it clearly tells the sender that your email is a valid address.
<P>
<H2><A NAME="SECTION003382000000000000000">
30.8.2 Basic spam prevention</A>
</H2>
<P>
You can start by at least adding the following lines to your
<TT>
<FONT COLOR="#0000ff">MAIN</FONT></TT> configuration section:
<P><TABLE nowrap="1" width="100%" border="0" cellspacing="0" cellpadding="0">
<TR>
<TD valign="top" class="source" width="2%"><FONT color=red>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
</FONT></TD><TD valign="top" class="source" bgcolor="#FFE0C0"><FONT color=blue>
<code>headers_check_syntax</code><br>
<code>headers_sender_verify</code><br>
<code>sender_verify</code><br>
<code>receiver_verify</code><br>
</FONT></TD></TR></TABLE><P>
The option <TT>
<FONT COLOR="#0000ff">headers_check_syntax</FONT></TT> causes <TT>
<FONT COLOR="#0000ff">exim</FONT></TT> to
check all headers of incoming mail messages for correct syntax,
failing them otherwise. The next three options check that one of the
<TT>
<FONT COLOR="#0000ff">Sender:</FONT></TT>, <TT>
<FONT COLOR="#0000ff">Reply-To:</FONT></TT> or <TT>
<FONT COLOR="#0000ff">From:</FONT></TT> headers, as well
as both the addresses in the SMTP <TT>
<FONT COLOR="#0000ff">MAIL</FONT></TT> and <TT>
<FONT COLOR="#0000ff">RCPT</FONT></TT>
commands, are genuine email
addresses.
<P>
The reasoning here is that spammers will often use
malformed headers to trick the MTA into sending things it ordinarily
wouldn't, I am not sure exactly how this applies in <TT>
<FONT COLOR="#0000ff">exim</FONT></TT>'s
case, but these are for the good measure of rejecting email
messages at the point where the SMTP exchange is being initiated.
<P>
<H2><A NAME="SECTION003383000000000000000">
30.8.3 Real-time blocking list</A>
</H2>
<P>
To find out a lot more about spamming, banning hosts,
reporting spam and email usage in general,
see
<EM>MAPS (Mail Abuse Prevention
System LLC)</EM> <I><<TT><A NAME="tex2html44"
HREF="http://www.mail-abuse.org/">http://www.mail-abuse.org/</A></TT>></I>, as well as <EM>Open Relay
Behavior-modification System</EM> <I><<TT><A NAME="tex2html45"
HREF="http://www.orbs.org/">http://www.orbs.org/</A></TT>></I>. <FONT COLOR="#ffa500">[If this site is not working,
there is also <I><TT><A NAME="tex2html46"
HREF="http://www.orbl.org/">http://www.orbl.org/</A></TT></I> and
<I><TT><A NAME="tex2html47"
HREF="http://www.ordb.org/">http://www.ordb.org/</A></TT></I>.]</FONT><I>Real-time Blocking Lists</I>
or RBL's are a not-so-new idea that has been
incorporated into <TT>
<FONT COLOR="#0000ff">exim</FONT></TT> as a feature. It works as follows. The
spammer has to use a host that allows relays. The IP of that
relay host will be clear to the MTA at the time of connection. The
MTA can then check that against a database of publicly available
<I>banned IP addresses</I> of relay hosts. For <TT>
<FONT COLOR="#0000ff">exim</FONT></TT>, this
means the list under <TT>
<FONT COLOR="#0000ff">rbl_domains</FONT></TT>. If the <TT>
<FONT COLOR="#0000ff">rbl_domains</FONT></TT>
friendly has this IP blacklisted, then <TT>
<FONT COLOR="#0000ff">exim</FONT></TT> denies it also.
You can enable this capability with <FONT COLOR="#ffa500">[This example comes
from <TT>
<FONT COLOR="#0000ff">exim</FONT></TT>'s front web page.]</FONT>
<P><TABLE nowrap="1" width="100%" border="0" cellspacing="0" cellpadding="0">
<TR>
<TD valign="top" class="source" width="2%"><FONT color=red>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-1"><code>5</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-1"><code>10</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
</FONT></TD><TD valign="top" class="source" bgcolor="#FFE0C0"><FONT color=blue>
<code># reject messages whose sending host is in MAPS/RBL</code><br>
<code># add warning to messages whose sending host is in ORBS</code><br>
<code>rbl_domains = blackholes.mail-abuse.org/reject : \</code><br>
<code> dialups.mail-abuse.org/reject : \</code><br>
<code> relays.mail-abuse.org/reject : \</code><br>
<code> relays.orbs.org/warn</code><br>
<code># check all hosts other than those on internal network</code><br>
<code>rbl_hosts = !192.168.0.0/16:0.0.0.0/0</code><br>
<code># but allow mail to postmaster@my.dom.ain even from rejected host</code><br>
<code>recipients_reject_except = postmaster@my.dom.ain</code><br>
<code># change some logging actions (collect more data)</code><br>
<code>rbl_log_headers # log headers of accepted RBLed messages</code><br>
<code>rbl_log_rcpt_count # log recipient info of accepted RBLed messages</code><br>
</FONT></TD></TR></TABLE><P>
in your <TT>
<FONT COLOR="#0000ff">MAIN</FONT></TT> configuration section. Also remember
to remove the line <TT>
<FONT COLOR="#0000ff">no_rbl_reject_recipients</FONT></TT>; otherwise,
<TT>
<FONT COLOR="#0000ff">exim</FONT></TT> will only log a warning message and not actually refuse
email.
<P>
<H2><A NAME="SECTION003384000000000000000">
30.8.4 Mail administrator and user responsibilities</A>
</H2>
<P>
Mail administrator and email users are expected to be aware of the
following:
<UL>
<LI>Spam is evil.
</LI>
<LI>Spam is caused by poorly configured mail servers.
</LI>
<LI>It is the responsibility of the mail administrator to ensure
that proper measures have been taken to prevent spam.
</LI>
<LI>Even as a user, you should follow up spam by checking where it came
from and complaining to those administrators.
</LI>
<LI>Many mail administrators are not aware there is an issue.
Remind them.
</LI>
</UL>
<P>
<H1><A NAME="SECTION003390000000000000000">
30.9 Sendmail</A>
</H1>
<P>
<TT>
<FONT COLOR="#0000ff">sendmail</FONT></TT>'s configuration file is <TT>
<FONT COLOR="#0000ff">/etc/sendmail.cf</FONT></TT>.
This file format was inherited from the first U<SMALL>NIX</SMALL> servers and
references simpler files under the directory <TT>
<FONT COLOR="#0000ff">/etc/mail/</FONT></TT>.
You can do most ordinary things by editing one or another file under
<TT>
<FONT COLOR="#0000ff">/etc/mail/</FONT></TT> without having to deal with the complexities of
<TT>
<FONT COLOR="#0000ff">/etc/sendmail.cf</FONT></TT>.
<P>
Like most stock MTAs shipped with L<SMALL>INUX</SMALL> distributions,
the <TT>
<FONT COLOR="#0000ff">sendmail</FONT></TT> package will work by default as a mailer without
any configuration. However, as always, you will have to add a list of relay
hosts. This is done in the file <TT>
<FONT COLOR="#0000ff">/etc/mail/access</FONT></TT> for <TT>
<FONT COLOR="#0000ff">sendmail-8.10</FONT></TT>
and above. To relay from yourself and, say, the hosts on network <TT>
<FONT COLOR="#0000ff">192.168.0.0/16</FONT></TT>,
as well as, say, the domain <I>hosts</I><TT>
<FONT COLOR="#0000ff">.trusted.com</FONT></TT>, you must have at least:
<P><TABLE nowrap="1" width="100%" border="0" cellspacing="0" cellpadding="0">
<TR>
<TD valign="top" class="source" width="2%"><FONT color=red>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-1"><code>5</code></font><code> </code><br>
</FONT></TD><TD valign="top" class="source" bgcolor="#FFE0C0"><FONT color=blue>
<code>localhost.localdomain RELAY</code><br>
<code>localhost RELAY</code><br>
<code>127.0.0.1 RELAY</code><br>
<code>192.168 RELAY</code><br>
<code>trusted.com RELAY</code><br>
</FONT></TD></TR></TABLE><P>
which is exactly what the <TT>
<FONT COLOR="#0000ff">host_accept_relay</FONT></TT> option does
in the case of <TT>
<FONT COLOR="#0000ff">exim</FONT></TT>.
<P>
The domains for which you are acting as a backup mail server must be
listed in the file
<TT>
<FONT COLOR="#0000ff">/etc/mail/relay-domains</FONT></TT>, each on a single
line. This is analogous to the
<TT>
<FONT COLOR="#0000ff">relay_domains</FONT></TT> option of <TT>
<FONT COLOR="#0000ff">exim</FONT></TT>.
<P>
Then, of course, the domains for which <TT>
<FONT COLOR="#0000ff">sendmail</FONT></TT> is going
to receive mail must also be specified. This is analogous to the
<TT>
<FONT COLOR="#0000ff">local_domains</FONT></TT> option of <TT>
<FONT COLOR="#0000ff">exim</FONT></TT>. These are listed in the
file
<TT>
<FONT COLOR="#0000ff">/etc/mail/local-host-names</FONT></TT>, each on a single line.
<P>
The same <TT>
<FONT COLOR="#0000ff">/etc/aliases</FONT></TT> file is used by <TT>
<FONT COLOR="#0000ff">exim</FONT></TT>
and <TT>
<FONT COLOR="#0000ff">sendmail</FONT></TT>.
<P>
Having configured anything under <TT>
<FONT COLOR="#0000ff">/etc/mail/</FONT></TT>, you should
now run <TT>
<FONT COLOR="#0000ff">make</FONT></TT> in this directory to rebuild lookup tables
for these files. You also have to run the command <TT>
<FONT COLOR="#0000ff">newaliases</FONT></TT>
whenever you modify the <TT>
<FONT COLOR="#0000ff">/etc/aliases</FONT></TT> file. In both cases,
you must restart <TT>
<FONT COLOR="#0000ff">sendmail</FONT></TT>.
<P>
<TT>
<FONT COLOR="#0000ff">sendmail</FONT></TT> has received a large number of security
alerts in its time. It is imperative that you install the latest version. Note
that older versions of <TT>
<FONT COLOR="#0000ff">sendmail</FONT></TT> have configurations that allowed
relaying by default--another reason to upgrade.
<P>
A useful resource to for finding out more tricks with <TT>
<FONT COLOR="#0000ff">sendmail</FONT></TT>
is <EM>The Sendmail FAQ</EM> <I><<TT><A NAME="tex2html48"
HREF="http://www.sendmail.org/faq/">http://www.sendmail.org/faq/</A></TT>></I>.
<P>
<HR>
<!--Navigation Panel-->
<A NAME="tex2html2375"
HREF="node34.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A>
<A NAME="tex2html2371"
HREF="rute.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A>
<A NAME="tex2html2365"
HREF="node32.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A>
<A NAME="tex2html2373"
HREF="node1.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A>
<BR>
<B> Next:</B> <A NAME="tex2html2376"
HREF="node34.html">31. lilo, initrd, and</A>
<B> Up:</B> <A NAME="tex2html2372"
HREF="rute.html">rute</A>
<B> Previous:</B> <A NAME="tex2html2366"
HREF="node32.html">29. Services Running Under</A>
  <B> <A NAME="tex2html2374"
HREF="node1.html">Contents</A></B>
<!--End of Navigation Panel-->
</BODY>
</HTML>
|