分页: 1 / 1

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

发表于 : 2010-03-08 1:48
leo
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:

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.