《NetBSD指南-26.1.1.Configuration of generic mapping》

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

版主: lionux

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

《NetBSD指南-26.1.1.Configuration of generic mapping》

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

This type of configuration uses a new file /etc/postfix/generic which contains the hostname mapping used by postfix to rewrite the internal hostnames.

The first step is therefore to write the mapping file:

代码: 全选

carlo@ape.insetti.net			alan@bignet.it
root@ape.insetti.net			alan@bignet.it
news@ape.insetti.net			alan@bignet.it

These entries will map the mail sent from the users given on the left side into the globally valid email addresses given on the right, making it appear as if the mail was really sent from that address.

For the sake of efficiency, generic must be transformed into a binary file with the following command:

代码: 全选

# postmap /etc/postfix/generic

Now it's time to create the prototype configuration file which we'll use to create the postfix configuration file.

代码: 全选

# vi /etc/postfix/main.cf

For the sake of simplicity, we'll only show the variables you need change:
relayhost = mail.bignet.it
smtp_generic_maps = hash:/etc/postfix/generic

This configuration tells postfix to rewrite the addresses of type “ape.insetti.net” using the real names found in the /etc/postfix/generic file. It also says that mail should be sent to the “mail.bignet.it” server. The meaning of the options is described in detail in postconf(5).

The last step is to reload the configuration. You can do that easily with:

代码: 全选

# /etc/rc.d/postfix reload
postfix/postfix-script: refreshing the Postfix mail system

Now everything is ready to start sending mail.

主题已锁定

在线用户

正浏览此版面之用户: Google [Bot] 和 18 访客