《NetBSD指南-26.邮件和新闻》

NetBSD用户指南中文版、NetBSD pkgsrc指南中文版...

版主: lionux

主题已锁定
头像
leo
帖子: 2465
注册时间: 2010-01-21 3:27

《NetBSD指南-26.邮件和新闻》

帖子 leo » 2010-03-08 1:44

目录

26.1. postfix
[INDENT]26.1.1. 配置常规映射
26.1.2. 测试配置
26.1.3. Using an alternative MTA [/INDENT]
26.2. fetchmail
26.3. Reading and writing mail with mutt
26.4. Strategy for receiving mail
26.5. Strategy for sending mail
26.6. Advanced mail tools
26.7. News with tin
This chapter explains how to set up NetBSD to use mail and news. Only a simple but very common setup is described: the configuration of a host connected to the Internet with a modem through a provider. You can think of this chapter as the continuation of Chapter 23, Setting up TCP/IP on NetBSD in practice, assuming a similar network configuration. Even this “simple” setup proves to be difficult if you don't know where to start or if you've only read introductory or technical documentation. A general description of mail and news configuration is beyond the scope of this guide; please read a good Unix Administration book (some very good ones are listed on the NetBSD site).

This chapter also briefly describes the configuration (but not the usage) of two popular applications, mutt for mail and tin for news. The usage is not described because they are easy to use and well documented. Obviously, both mutt and tin are not mandatory choices: many other similar applications exist but I think that they are a good starting point because they are widely used, simple, work well and don't use too much disk space and memory. Both are console mode programs; if you prefer graphics applications there are also many choices for X.

In short, the programs required for the configuration described in this chapter are:
  • postfix
  • fetchmail
  • mutt
  • tin
Of these, only postfix is installed with the base system; you can install the other programs from the NetBSD package collection, pkgsrc.
Note
Since NetBSD 4.0, postfix is the default MTA (Mail Transport Agent) and sendmail was removed. Also, because sendmail is widely popular and several programs like fetchmail are designed to be used with it, postfix includes a command line wrapper that accepts sendmail's commands line syntax but works with postfix. See sendmail(1) for more details.

Before continuing, remember that none of the programs presented in this chapter is mandatory: there are other applications performing similar tasks and many users prefer them. You'll find different opinions reading the mailing lists. You can also use different strategies for sending and receiving mail: the one explained here is only a starting point; once you understand how it works you'll probably want to modify it to suit your needs or to adopt a different method altogether.

At the opposite extreme of the example presented here, there is the usage of an application like Mozilla, which does everything and frees you from the need of configuring many components: with Mozilla you can browse the Internet, send and receive mail and read news. Besides, the setup is very simple. There is a price to pay, though: Mozilla is a “closed” program that will not cooperate easily with other standard Unix utilities.

Another possibility is to use emacs to read mail and news. Emacs needs no introduction to Unix users but, in case you don't know, it is an extensible editor (although calling emacs an editor is somewhat reductive) which becomes a complete work environment, and can be used to read mail, news and to perform many operations. For many people emacs is the only environment that they need and they use it for all their work. The configuration of emacs for mail and news is described in the emacs manual.

In the rest of this chapter we will deal with a host connected to the Internet through a PPP connection via serial modem to a provider.
  • the local host's name is “ape” and the internal network is “insetti.net”, which means that the FQDN (Fully Qualified Domain Name) is “ape.insetti.net”.
  • the user's login name on ape is “carlo”.
  • the provider's name is BigNet.
  • the provider's mail server is “mail.bignet.it”.
  • the provider's news server is “news.bignet.it”.
  • the user's (“carlo”) account at the provider is “alan” with the password “pZY9o”.
First some basic terminology:

MUA (mail user agent)
[INDENT]a program to read and write mail. For example: mutt, elm and pine but also the simple mail application installed with the base system.
[/INDENT]MTA (mail transfer agent)
[INDENT]a program that transfers mail between two host but also locally (on the same host). The MTA decides the path that the mail will follow to get to the destination. On other BSD systems (but not only) the standard MTA is sendmail, other examples are qmail, exim and Microsoft Exchange.
[/INDENT]MDA (mail delivery agent)
[INDENT]a program, usually used by the MTA, that delivers the mail; for example, it physically puts the messages in the recipient's mailbox. For example, postfix uses one or more MDAs to deliver mail, and procmail is another well-known MDA.
[/INDENT]Figure 26.1, “Structure of the mail system” depicts the mail system that we want to set up. Between the local network (or the single host) and the provider there is a modem PPP connection. The “bubbles” with the thick border (postfix, fetchmail, mutt) are the programs launched manually by the user; the remaining bubbles are the programs that are launched automatically. The circled numbers refer to the logical steps of the mail cycle:
  • 1. In step (1) mail is downloaded from the provider's POP server using fetchmail, which hands messages off to postfix's sendmail wrapper to put the messages in the user's mailbox.
  • 2. In step (2) the user launches mutt (or another MUA) to read mail, reply and write new messages.
  • 3. In step (3) the user “sends” the mail from within mutt. Messages are accumulated in the spool area.
  • 4. In step (4) the user calls postfix's sendmail wrapper to transfer the messages to the provider's SMTP server, that will deliver them to the final destination (possibly through other mail servers). The provider's SMTP server acts as a relay for our mail.
The connection with the provider must be up only during steps (1) and (4); for the remaining steps it is not needed.

Figure 26.1. Structure of the mail system
图片

主题已锁定

在线用户

正浏览此版面之用户: 没有注册用户 和 3 访客