sendmail Cookbook
暫譯: sendmail 食譜

Craig Hunt

  • 出版商: O'Reilly
  • 出版日期: 2004-01-20
  • 售價: $1,900
  • 貴賓價: 9.5$1,805
  • 語言: 英文
  • 頁數: 408
  • 裝訂: Paperback
  • ISBN: 0596004710
  • ISBN-13: 9780596004712
  • 海外代購書籍(需單獨結帳)

買這商品的人也買了...

商品描述

 

Summary

More often than not, the words "sendmail configuration" strike dread in the hearts of sendmail and system administrators--and not without reason. sendmail configuration languages are as complex as any other programming languages, but used much more infrequently--only when sendmail is installed or configured. The average system administrator doesn't get enough practice to truly master this inscrutable technology.

Fortunately, there's help. The sendmail Cookbook provides step-by-step solutions for the administrator who needs to solve configuration problems fast. Say you need to configure sendmail to relay mail for your clients without creating an open relay that will be abused by spammers. A recipe in the Cookbook shows you how to do just that. No more wading through pages of dense documentation and tutorials and creating your own custom solution--just go directly to the recipe that addresses your specific problem.

Each recipe in the sendmail Cookbook outlines a configuration problem, presents the configuration code that solves that problem, and then explains the code in detail. The discussion of the code is critical because it provides the insight you need to tweak the code for your own circumstances.

The sendmail Cookbook begins with an overview of the configuration languages, offering a quick how-to for downloading and compiling the sendmail distribution. Next, you'll find a baseline configuration recipe upon which many of the subsequent configurations, or recipes, in the book are based. Recipes in the following chapters stand on their own and offer solutions for properly configuring important sendmail functions such as:


  • Delivering and forwarding mail
  • Relaying
  • Masquerading
  • Routing mail
  • Controlling spam
  • Strong authentication
  • Securing the mail transport
  • Managing the queue
  • Securing sendmail


sendmail Cookbook is more than just a new approach to discussing sendmail configuration. The book also provides lots of new material that doesn't get much coverage elsewhere--STARTTLS and AUTH are given entire chapters, and LDAP is covered in recipes throughout the book. But most of all, this book is about saving time--something that most system administrators have in short supply. Pick up the sendmail Cookbook and say good-bye to sendmail dread.   

Table of Contents

Preface

1. Getting Started

      1.1 Downloading the Latest Release 

      1.2 Installing sendmail 

      1.3 Compiling sendmail to Use LDAP 

      1.4 Adding the regex Map Type to sendmail 

      1.5 Compiling sendmail with SASL Support 

      1.6 Compiling sendmail with STARTTLS Support 

      1.7 Compiling in STARTTLS File Paths 

      1.8 Building a sendmail Configuration 

      1.9 Testing a New Configuration 

      1.10 Logging sendmail 

2. Delivery and Forwarding

      2.1 Accepting Mail for Other Hosts 

      2.2 Fixing the Alias0 Missing Map Error and Creating Simple Aliases 

      2.3 Reading Aliases via LDAP 

      2.4 Configuring Red Hat 7.3 to Read Aliases from a NIS Server 

      2.5 Configuring Solaris 8 to Read Aliases from a NIS Server 

      2.6 Forwarding to an External Address 

      2.7 Creating Mailing Lists 

      2.8 Migrating Ex-Users to New Addresses 

      2.9 Delivering Mail to a Program 

      2.10 Using Program Names in Mailing Lists 

      2.11 Allowing Nonlogin Users to Forward to Programs 

      2.12 Fixing a .forward Loop 

      2.13 Enabling the User Database 

3. Relaying

      3.1 Passing All Mail to a Relay 

      3.2 Passing Outbound Mail to a Relay 

      3.3 Passing Local Mail to a Mail Hub 

      3.4 Passing Apparently Local Mail to a Relay 

      3.5 Passing UUCP Mail to a Relay 

      3.6 Relaying Mail for All Hosts in a Domain 

      3.7 Relaying Mail for Individual Hosts 

      3.8 Configuring Relaying on a Mail Exchanger 

      3.9 Loading Class $=R via LDAP 

      3.10 Relaying Only Outbound Mail 

4. Masquerading

      4.1 Adding Domains to All Sender Addresses 

      4.2 Masquerading the Sender Hostname 

      4.3 Eliminating Masquerading for the Local Mailer 

      4.4 Forcing Masquerading of Local Mail 

      4.5 Masquerading Recipient Addresses 

      4.6 Masquerading at the Relay Host 

      4.7 Limiting Masquerading 

      4.8 Masquerading All Hosts in a Domain 

      4.9 Masquerading Most of the Hosts in a Domain 

      4.10 Masquerading the Envelope Address 

      4.11 Rewriting the From Address with the genericstable 

      4.12 Rewriting Sender Addresses for an Entire Domain

      4.13 Masquerading with LDAP 

      4.14 Reading the genericstable via LDAP 

5. Routing Mail

      5.1 Routing Mail to Special Purpose Mailers 

      5.2 Sending Error Messages from the mailertable 

      5.3 Disabling MX Processing to Avoid Loops 

      5.4 Routing Mail for Local Delivery 

      5.5 Reading the mailertable via LDAP 

      5.6 Routing Mail for Individual Virtual Hosts 

      5.7 Routing Mail for Entire Virtual Domains 

      5.8 Reading the virtusertable via LDAP 

      5.9 Routing Mail with LDAP 

      5.10 Using LDAP Routing with Masquerading 

6. Controlling Spam

      6.1 Blocking Spam with the access Database 

      6.2 Preventing Local Users from Replying to Spammers

      6.3 Reading the access Database via LDAP 

      6.4 Using a DNS Blackhole List Service 

      6.5 Building Your Own DNS Blackhole List 

      6.6 Whitelisting Blacklisted Sites 

      6.7 Filtering Local Mail with procmail 

      6.8 Filtering Outbound Mail with procmail 

      6.9 Invoking Special Header Processing 

      6.10 Using Regular Expressions in sendmail 

      6.11 Identifying Local Problem Users 

      6.12 Using MILTER 

      6.13 Bypassing Spam Checks 

      6.14 Enabling Spam Checks on a Per-User Basis 

7. Authenticating with AUTH

      7.1 Offering AUTH Authentication 

      7.2 Authenticating with AUTH 

      7.3 Storing AUTH Credentials in the authinfo File 

      7.4 Limiting Advertised Authentication Mechanisms 

      7.5 Using AUTH to Permit Relaying 

      7.6 Controlling the AUTH= Parameter 

      7.7 Avoiding Double Encryption 

      7.8 Requiring Authentication 

      7.9 Selectively Requiring Authentication 

8. Securing the Mail Transport

      8.1 Building a Private Certificate Authority 

      8.2 Creating a Certificate Request 

      8.3 Signing a Certificate Request 

      8.4 Configuring sendmail for STARTTLS 

      8.5 Relaying Based on the CA 

      8.6 Relaying Based on the Certificate Subject 

      8.7 Requiring Outbound Encryption 

      8.8 Requiring Inbound Encryption 

      8.9 Requiring a Verified Certificate 

      8.10 Requiring TLS for a Recipient 

      8.11 Refusing STARTTLS Service 

      8.12 Selectively Advertising STARTTLS 

      8.13 Requesting Client Certificates 

9. Managing the Queue

      9.1 Creating Multiple Queues 

      9.2 Using qf, df, and xf Subdirectories 

      9.3 Defining Queue Groups 

      9.4 Assigning Recipients to Specific Queues 

      9.5 Using Persistent Queue Runners 

      9.6 Using a Queue Server 

      9.7 Setting Protocol Timers 

10. Securing sendmail

      10.1 Limiting the Number of sendmail Servers 

      10.2 Limiting the Number of Network Accessible Servers 

      10.3 Updating to Close Security Holes 

      10.4 Patching to Close Security Holes 

      10.5 Disabling Delivery to Programs 

      10.6 Controlling Delivery to Programs 

      10.7 Disabling Delivery to Files 

      10.8 Bypassing User .forward Files 

      10.9 Controlling Delivery to Files 

      10.10 Running sendmail Non-Set-User-ID root 

      10.11 Setting a Safe Default User ID 

      10.12 Defining Trusted Users 

      10.13 Identifying the sendmail Administrator 

      10.14 Limiting the SMTP Command Set 

      10.15 Requiring a Valid HELO 

      10.16 Restricting Command-Line Options 

      10.17 Denying DoS Attacks 

Index

商品描述(中文翻譯)

摘要

「sendmail 配置」這個詞常常讓 sendmail 和系統管理員感到恐懼,這並非沒有原因。sendmail 的配置語言與其他任何編程語言一樣複雜,但使用頻率卻低得多——僅在安裝或配置 sendmail 時才會使用。一般的系統管理員沒有足夠的實踐來真正掌握這種難以理解的技術。

幸運的是,有幫助。《sendmail 食譜》為需要快速解決配置問題的管理員提供逐步解決方案。假設您需要配置 sendmail 以轉發客戶的郵件,而不創建一個會被垃圾郵件發送者濫用的開放轉發。食譜中有一個示例告訴您如何做到這一點。再也不需要翻閱密密麻麻的文檔和教程,或創建自己的自定義解決方案——只需直接查看解決您特定問題的食譜。

《sendmail 食譜》中的每個食譜都概述了一個配置問題,提供了解決該問題的配置代碼,然後詳細解釋該代碼。對代碼的討論至關重要,因為它提供了您所需的見解,以便根據自己的情況調整代碼。

《sendmail 食譜》首先概述了配置語言,提供了下載和編譯 sendmail 發行版的快速指南。接下來,您將找到一個基線配置食譜,許多後續的配置或食譜都是基於此。後續章節中的食譜獨立存在,提供正確配置重要 sendmail 功能的解決方案,例如:
- 傳遞和轉發郵件
- 轉發
- 偽裝
- 郵件路由
- 控制垃圾郵件
- 強身份驗證
- 保護郵件傳輸
- 管理佇列
- 保護 sendmail

《sendmail 食譜》不僅僅是討論 sendmail 配置的新方法。這本書還提供了許多其他地方不常見的新材料——STARTTLS 和 AUTH 各有整章內容,LDAP 在全書的食譜中都有涉及。但最重要的是,這本書是關於節省時間的——這是大多數系統管理員所缺乏的。拿起《sendmail 食譜》,告別對 sendmail 的恐懼。

目錄

前言

1. 開始使用
1.1 下載最新版本
1.2 安裝 sendmail
1.3 編譯 sendmail 以使用 LDAP
1.4 將 regex 映射類型添加到 sendmail
1.5 編譯帶有 SASL 支持的 sendmail
1.6 編譯帶有 STARTTLS 支持的 sendmail
1.7 編譯 STARTTLS 文件路徑
1.8 建立 sendmail 配置
1.9 測試新配置
1.10 記錄 sendmail

2. 傳遞和轉發
2.1 接受其他主機的郵件
2.2 修復 Alias0 缺失映射錯誤並創建簡單別名
2.3 通過 LDAP 讀取別名
2.4 配置 Red Hat 7.3 從 NIS 伺服器讀取別名
2.5 配置 Solaris 8 從 NIS 伺服器讀取別名
2.6 轉發到外部地址
2.7 創建郵件列表
2.8 將前用戶遷移到新地址
2.9 將郵件傳遞到程序
2.10 在郵件列表中使用程序名稱
2.11 允許非登錄用戶轉發到程序
2.12 修復 .forward 循環
2.13 啟用用戶數據庫

3. 轉發
3.1 將所有郵件傳遞到轉發
3.2 將出站郵件傳遞到轉發
3.3 將本地郵件傳遞到郵件中心
3.4 將顯然本地的郵件傳遞到轉發
3.5 將 UUCP 郵件傳遞到轉發
3.6 為域中的所有主機轉發郵件
3.7 為單個主機轉發郵件
3.8 在郵件交換器上配置轉發
3.9 通過 LDAP 加載類 $=R
3.10 僅轉發出站郵件

4. 偽裝
4.1 將域添加到所有發件人地址
4.2 偽裝發件人主機名
4.3 消除本地郵件發件人的偽裝
4.4 強制本地郵件的偽裝
4.5 偽裝收件人地址
4.6 在轉發主機上偽裝
4.7 限制偽裝
4.8 偽裝域中的所有主機
4.9 偽裝域中大多數主機
4.10 偽裝信封地址
4.11 使用 genericstable 重寫發件人地址
4.12 為整個域重寫發件人地址
4.13 使用 LDAP 偽裝
4.14 通過 LDAP 讀取 genericstable

5. 郵件路由
5.1 將郵件路由到特殊目的郵件發送者
5.2 從 mailertable 發送錯誤消息
5.3 禁用 MX 處理以避免循環
5.4 為本地傳遞路由郵件
5.5 通過 LDAP 讀取 mailertable
5.6 為單個虛擬主機路由郵件
5.7 為整個虛擬域路由郵件
5.8 通過 LDAP 讀取 virtusertable
5.9 使用 LDAP 路由郵件
5.10 使用偽裝的 LDAP 路由

6. 控制垃圾郵件
6.1 使用 access 數據庫阻止垃圾郵件
6.2 防止本地用戶回覆垃圾郵件發送者
6.3 通過 LDAP 讀取 access 數據庫
6.4 使用 DNS 黑洞列表服務
6.5 建立自己的 DNS 黑洞列表
6.6 對黑名單網站進行白名單處理
6.7 使用 procmail 過濾本地郵件
6.8 使用 procmail 過濾出站郵件
6.9 調用特殊標頭處理
6.10 在 sendmail 中使用正則表達式
6.11 識別本地問題用戶
6.12 使用 MILTER
6.13 繞過垃圾郵件檢查
6.14 按用戶啟用垃圾郵件檢查

7. 使用 AUTH 進行身份驗證
7.1 提供 AUTH 身份驗證
7.2 使用 AUTH 進行身份驗證
7.3 將 AUTH 憑據存儲在 authinfo 文件中
7.4 限制廣告的身份驗證機制
7.5 使用 AUTH 允許轉發
7.6 控制 AUTH= 參數
7.7 避免雙重加密
7.8 要求身份驗證
7.9 有選擇性地要求身份驗證

8. 保護郵件傳輸
8.1 建立私有證書授權機構
8.2 創建證書請求
8.3 簽署證書請求
8.4 配置 sendmail 以支持 STARTTLS
8.5 根據 CA 進行轉發
8.6 根據證書主題進行轉發
8.7 要求出站加密
8.8 要求入站加密
8.9 要求經過驗證的證書
8.10 要求收件人使用 TLS
8.11 拒絕 STARTTLS 服務
8.12 有選擇性地廣告 STARTTLS
8.13 請求客戶端證書

9. 管理佇列
9.1 創建多個佇列
9.2 使用 qf、df 和 xf 子目錄
9.3 定義佇列組
9.4 將收件人分配到特定佇列
9.5 使用持久佇列運行器
9.6 使用佇列伺服器
9.7 設置協議計時器

10. 保護 sendmail
10.1 限制 sendmail 伺服器的數量
10.2 限制可網絡訪問的伺服器數量
10.3 更新以修補安全漏洞
10.4 修補以關閉安全漏洞
10.5 禁用對程序的交付
10.6 控制對程序的交付
10.7 禁用對文件的交付
10.8 繞過用戶 .forward 文件
10.9 控制對文件的交付
10.10 以非設置用戶 ID root 運行 sendmail
10.11 設置安全的默認用戶 ID
10.12 定義受信用戶
10.13 識別