Exim the Mail Transfer Agent.Pdf
Total Page:16
File Type:pdf, Size:1020Kb
,Title.10724 Page 1 Tuesday, October 9, 2001 9:25 AM Exim The Mail Transfer Agent ,Title.10724 Page 2 Tuesday, October 9, 2001 9:25 AM ,Title.10724 Page 3 Tuesday, October 9, 2001 9:25 AM Exim The Mail Transfer Agent Philip Hazel Beijing • Cambridge • Farnham • Köln • Paris • Sebastopol • Taipei • Tokyo ,Copyright.10561 Page 1 Tuesday, October 9, 2001 9:25 AM Exim: The Mail Transfer Agent by Philip Hazel Copyright © 2001 O’Reilly & Associates, Inc. All rights reserved. Printed in the United States of America. Published by O’Reilly & Associates, Inc., 101 Morris Street, Sebastopol, CA 95472. Editor: Andy Oram Production Editor: Mary Brady Cover Designer: Ellie Volckhausen Printing History: June 2001: First Edition. Nutshell Handbook, the Nutshell Handbook logo, and the O’Reilly logo are registered trademarks of O’Reilly & Associates, Inc. Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and O’Reilly & Associates, Inc. was aware of a trademark claim, the designations have been printed in caps or initial caps. The association between the image of an aye-aye and Exim is a trademark of O’Reilly & Associates, Inc. While every precaution has been taken in the preparation of this book, the publisher assumes no responsibility for errors or omissions, or for damages resulting from the use of the information contained herein. Library of Congress Cataloging-in-Publication Data Hazel, Philip Exim: the mail transfer agent/by Philip Hazel p.cm. ISBN 0-596-00098-7 1. Exim (Computer program) 2. Email--Computer programs I. Title TK5105.73 .H39 2001 004.692--dc21 2001036079 [DS] Ta ble of Contents Preface .................................................................................................................. xiii 1. Introduction .................................................................................................. 1 2. How Inter net Mail Works ......................................................................... 5 Dif ferent Types of MTA .................................................................................... 10 Inter net Message Standards ............................................................................. 11 RFC 822 Message Format ................................................................................. 11 The Message ‘‘On the Wir e’’ ............................................................................ 13 Summary of the SMTP Protocol ....................................................................... 15 Forgery .............................................................................................................. 18 Authentication and Encryption ........................................................................ 18 Routing a Message ............................................................................................ 18 Checking Incoming Mail .................................................................................. 19 Overview of the DNS ....................................................................................... 21 DNS Records Used for Mail Routing ............................................................... 24 Related DNS Records ....................................................................................... 25 Common DNS Errors ........................................................................................ 27 Role of the Postmaster ..................................................................................... 29 3. Exim Over view .......................................................................................... 30 Exim Philosophy ............................................................................................... 30 Exim’s Queue ................................................................................................... 31 Receiving and Delivering Messages ................................................................ 31 Exim Processes ................................................................................................. 32 v 9 October 2001 09:13 vi Table of Contents Coordination Between Processes .................................................................... 32 How Exim Is Configured ................................................................................. 33 How Exim Delivers Messages .......................................................................... 35 Local and Remote Addresses ........................................................................... 37 Pr ocessing an Address ..................................................................................... 38 A Simple Example ............................................................................................ 40 Complications While Directing and Routing ................................................... 46 Complications During Delivery ....................................................................... 48 Complications After Delivery ........................................................................... 49 Use of Transports by Directors and Routers ................................................... 49 4. Exim Operations Over view ................................................................... 52 How Exim Identifies Messages ........................................................................ 52 Watching Exim at Work .................................................................................... 53 The Runtime Configuration File ...................................................................... 54 The Default Qualification Domain .................................................................. 61 Handling Frozen Bounce Messages ................................................................ 62 Reducing Activity at High Load ....................................................................... 62 Limiting Message Sizes ..................................................................................... 65 Parallel Remote Delivery .................................................................................. 65 Contr olling the Number of Delivery Processes .............................................. 66 Large Message Queues ..................................................................................... 66 Large Installations ............................................................................................. 67 5. Extending the Deliver y Configuration ............................................. 71 Multiple Local Domains ................................................................................... 71 Virtual Domains ................................................................................................ 74 Mailing Lists ...................................................................................................... 78 Using an External Local Delivery Agent ......................................................... 85 Multiple User Addresses ................................................................................... 87 Mixed Local/Remote Domains ......................................................................... 88 Delivering to UUCP .......................................................................................... 90 Ignoring the Local Part in Local Deliveries ..................................................... 91 Handling Local Parts in a Case-Sensitive Manner ........................................... 93 Scanning Messages for Viruses ........................................................................ 94 Modifying Message Bodies .............................................................................. 99 9 October 2001 09:13 Ta ble of Contents vii 6. Options Common to Director s and Routers ................................ 101 Conditional Running of Routers and Directors ............................................. 102 Changing a Driver’s Successful Outcome ..................................................... 107 Adding Data for Use by Transports ............................................................... 108 Debugging Directors and Routers ................................................................. 113 Summary of Director/Router Generic Options ............................................. 114 7. The Director s ............................................................................................ 118 Conditional Running of Directors .................................................................. 119 Optimizing Single-Level Aliasing ................................................................... 120 Adding Data for Use by Transports ............................................................... 121 The aliasfile and forwardfile Directors .......................................................... 121 The aliasfile Director ...................................................................................... 133 The forwardfile Director ................................................................................ 138 The localuser Director .................................................................................... 146 The smartuser Director .................................................................................. 147 8. The Routers ............................................................................................... 150 Timeouts While Routing ...............................................................................